diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 6496e85a11..43f131f778 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -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 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: | @@ -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" diff --git a/eval/run-functional.sh b/eval/run-functional.sh index f84f485c4c..9e724676c0 100755 --- a/eval/run-functional.sh +++ b/eval/run-functional.sh @@ -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 +if command -v openshell >/dev/null 2>&1; then + source "${REPO_ROOT}/.github/scripts/openshell-version.sh" + 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"