Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 5 additions & 50 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,13 @@ jobs:
- name: Add bin to PATH
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"

# TODO: The openshell setup below (version, CLI, gateway, Podman,
# gateway start) is duplicated from action.yml. Extract into a
# shared script (e.g. .github/scripts/setup-openshell.sh) so the
# version and config stay in sync across both places.
- name: Set OpenShell version
run: echo "OPENSHELL_VERSION=0.0.38" >> "${GITHUB_ENV}"

- name: Install OpenShell CLI
- name: Configure OpenShell gateway

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] incomplete-duplication-removal

The diff removes the TODO comment that identified duplication between functional-tests.yml and action.yml. The PR resolves version pin and CLI install duplication, but Podman setup remains duplicated. Removing the TODO is slightly premature.

run: |
uv tool install "openshell==${OPENSHELL_VERSION}"
openshell --version
mkdir -p "$HOME/.config/openshell"
echo "OPENSHELL_BIND_ADDRESS=0.0.0.0" > "$HOME/.config/openshell/gateway.env"

- name: Download openshell-gateway
run: |
set -euo pipefail
arch="$(uname -m)"
case "${arch}" in
x86_64) ;;
aarch64|arm64) arch=aarch64 ;;
*) echo "::error::Unsupported architecture: ${arch}"; exit 1 ;;
esac
GATEWAY_ASSET="openshell-gateway-${arch}-unknown-linux-gnu.tar.gz"
GATEWAY_URL="https://github.com/NVIDIA/OpenShell/releases/download/v${OPENSHELL_VERSION}/${GATEWAY_ASSET}"
curl -fsSL "${GATEWAY_URL}" -o "/tmp/${GATEWAY_ASSET}"
tar xzf "/tmp/${GATEWAY_ASSET}" -C "${{ runner.temp }}"
rm -f "/tmp/${GATEWAY_ASSET}"
- name: Install OpenShell CLI
run: .github/scripts/install-openshell.sh

- name: Install Podman
run: |
Expand All @@ -112,32 +93,6 @@ jobs:
[ -S "${SOCKET_PATH}" ] || { echo "::error::Podman socket not ready"; exit 1; }
fi

- name: Start openshell-gateway
run: |
set -euo pipefail
OPENSHELL_SSH_HANDSHAKE_SECRET="ci-$(openssl rand -hex 16)"
export OPENSHELL_SSH_HANDSHAKE_SECRET
echo "::add-mask::${OPENSHELL_SSH_HANDSHAKE_SECRET}"
export OPENSHELL_SUPERVISOR_IMAGE="ghcr.io/nvidia/openshell/supervisor:dfd47683e7da4f1a4a8fa5d77f92d3696e6a41f9"
"${{ runner.temp }}/openshell-gateway" \
--bind-address 0.0.0.0 \
--health-port 8081 \
--drivers podman \
--disable-tls \
--db-url "sqlite:/tmp/gateway.db?mode=rwc" \
>/tmp/gateway.log 2>&1 &
for _i in $(seq 1 30); do
curl -sf http://127.0.0.1:8081/healthz >/dev/null 2>&1 && break
sleep 2
done
curl -sf http://127.0.0.1:8081/healthz >/dev/null 2>&1 || {
echo "::error::Gateway health check failed"
cat /tmp/gateway.log 2>/dev/null || true
exit 1
}
openshell gateway add http://127.0.0.1:8080 --local --name local
openshell gateway select local

- name: Install validation dependencies
run: pip install --quiet "jsonschema>=4.18.0"

Expand Down
14 changes: 14 additions & 0 deletions eval/run-functional.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ if ! python3 -c "import agent_eval" 2>/dev/null; then
exit 1
fi

# Fail fast if openshell version doesn't match the repo pin

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] error-handling-gap

The source of openshell-version.sh is not guarded by a file-existence check. The script's set -euo pipefail ensures it exits on failure, but unlike the other pre-flight checks in this file, there is no user-friendly error message.

Suggested fix: Add a guard before sourcing: if [[ ! -f "${REPO_ROOT}/.github/scripts/openshell-version.sh" ]]; then echo "ERROR: ..."; exit 1; fi

if command -v openshell >/dev/null 2>&1; then
source "${REPO_ROOT}/.github/scripts/openshell-version.sh"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] edge-case

The version extraction openshell --version | awk '{print $NF}' assumes the last whitespace-delimited field is the version string. If the output format were to include additional tokens, $NF would return the wrong value. Risk is theoretical — standard Python CLI tools output toolname X.Y.Z where $NF works correctly.

installed="$(openshell --version | awk '{print $NF}')"
installed="${installed#v}"
if [[ "${installed}" != "${OPENSHELL_VERSION}" ]]; then
echo "ERROR: OpenShell version mismatch: installed ${installed}, expected ${OPENSHELL_VERSION}" >&2
exit 1
fi
else
echo "ERROR: openshell is not installed" >&2
exit 1
fi

WORKSPACE_PY="${HARNESS_DIR}/skills/eval-run/scripts/workspace.py"
EXECUTE_PY="${HARNESS_DIR}/skills/eval-run/scripts/execute.py"
SCORE_PY="${HARNESS_DIR}/skills/eval-run/scripts/score.py"
Expand Down
Loading