The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
ci(remote-backends): debian 13 for the test sshd, container setup as a mounted script
Teknium8f05f890c581
diff --git a/.github/workflows/remote-backends.yml b/.github/workflows/remote-backends.ymlindex 2ddca83aef0..d7ad38b8a83 100644--- a/.github/workflows/remote-backends.yml+++ b/.github/workflows/remote-backends.yml@@ -26,7 +26,7 @@ concurrency:env:# One small image for both the sshd host and the docker backend's sandbox, pinned# by digest so a tag move cannot change what the lane tests.- HERMES_TEST_IMAGE_REF: debian:12-slim@sha256:7c7b2c966bc9ee8cedfeef67e0e279108992c77681fa595db4a9d65c06ccc587+ HERMES_TEST_IMAGE_REF: debian:13-slim@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11fjobs:real-backends:diff --git a/scripts/ci/classify_changes.py b/scripts/ci/classify_changes.pyindex 4ded763deec..85bda819262 100644--- a/scripts/ci/classify_changes.py+++ b/scripts/ci/classify_changes.py@@ -198,6 +198,7 @@ _REMOTE_BACKEND_PATHS = ("tests/tools/test_ssh_environment.py","tests/tools/test_docker_backend_real.py","scripts/ci/start_test_sshd.sh",+ "scripts/ci/test_sshd_container_setup.sh","scripts/run_tests.sh",)diff --git a/scripts/ci/start_test_sshd.sh b/scripts/ci/start_test_sshd.shindex aff79834575..d83a4d4e067 100755--- a/scripts/ci/start_test_sshd.sh+++ b/scripts/ci/start_test_sshd.sh@@ -9,14 +9,14 @@# variables tests/tools/test_ssh_environment.py reads (appended to $GITHUB_ENV# too when it is set). `docker rm -f hermes-test-sshd` stops it.#-# The image is a plain Debian with GNU tar and bash, the shape of a real remote-# host (the backend's file sync uses `tar --no-overwrite-dir`). AcceptEnv lets-# the SendEnv passthrough test reach the remote shell.+# The image is a plain Debian (13, current stable) with GNU tar and bash, the shape of a real remote+# host (the backend's file sync uses `tar --no-overwrite-dir`). Container-side setup lives in+# test_sshd_container_setup.sh, mounted read-only at /setup.set -euo pipefailstate_dir="${1:?usage: start_test_sshd.sh <state-dir> [port]}"port="${2:-2222}"-image="${HERMES_TEST_SSHD_IMAGE:-debian:12-slim}"+image="${HERMES_TEST_SSHD_IMAGE:-debian:13-slim}"name="hermes-test-sshd"mkdir -p "$state_dir"@@ -26,23 +26,10 @@ state_dir="$(cd "$state_dir" && pwd)"cp "$state_dir/id_ed25519.pub" "$state_dir/authorized_keys"docker rm -f "$name" >/dev/null 2>&1 || true+setup="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/test_sshd_container_setup.sh"docker run -d --name "$name" -p "127.0.0.1:${port}:22" \- -v "$state_dir:/keys:ro" "$image" bash -c '- set -e- export DEBIAN_FRONTEND=noninteractive- apt-get update -qq- apt-get install -y -qq --no-install-recommends openssh-server >/dev/null- install -m 600 /keys/host_ed25519 /etc/ssh/ssh_host_ed25519_key- install -m 644 /keys/host_ed25519.pub /etc/ssh/ssh_host_ed25519_key.pub- useradd -m -s /bin/bash hermes- usermod -p "*" hermes- install -d -m 700 -o hermes -g hermes /home/hermes/.ssh- install -m 600 -o hermes -g hermes /keys/authorized_keys /home/hermes/.ssh/authorized_keys- printf "%s\n" "HostKey /etc/ssh/ssh_host_ed25519_key" "PasswordAuthentication no" \- "AcceptEnv HERMES_RB_*" > /etc/ssh/sshd_config.d/hermes-test.conf- mkdir -p /run/sshd- exec /usr/sbin/sshd -D -e- ' >/dev/null+ -v "$state_dir:/keys:ro" -v "$setup:/setup/setup.sh:ro" \+ "$image" bash /setup/setup.sh >/dev/nullfor _ in $(seq 1 120); doif ssh -i "$state_dir/id_ed25519" -p "$port" -o BatchMode=yes -o ConnectTimeout=2 \diff --git a/scripts/ci/test_sshd_container_setup.sh b/scripts/ci/test_sshd_container_setup.shnew file mode 100755index 00000000000..59072e49955--- /dev/null+++ b/scripts/ci/test_sshd_container_setup.sh@@ -0,0 +1,28 @@+#!/usr/bin/env bash+# Runs INSIDE the throwaway sshd container started by scripts/ci/start_test_sshd.sh+# (mounted read-only at /setup). Expects the keys at /keys: host_ed25519{,.pub} and+# authorized_keys. Installs openssh-server, adds user `hermes` that accepts only the+# test key, and execs sshd in the foreground.+set -euo pipefail++export DEBIAN_FRONTEND=noninteractive+apt-get update -qq+apt-get install -y -qq --no-install-recommends openssh-server >/dev/null++install -m 600 /keys/host_ed25519 /etc/ssh/ssh_host_ed25519_key+install -m 644 /keys/host_ed25519.pub /etc/ssh/ssh_host_ed25519_key.pub++useradd -m -s /bin/bash hermes+usermod -p '*' hermes # no password, but not locked: key auth still works+install -d -m 700 -o hermes -g hermes /home/hermes/.ssh+install -m 600 -o hermes -g hermes /keys/authorized_keys /home/hermes/.ssh/authorized_keys++# AcceptEnv lets the SendEnv passthrough test reach the remote shell.+cat > /etc/ssh/sshd_config.d/hermes-test.conf <<'EOF'+HostKey /etc/ssh/ssh_host_ed25519_key+PasswordAuthentication no+AcceptEnv HERMES_RB_*+EOF++mkdir -p /run/sshd+exec /usr/sbin/sshd -D -ediff --git a/tests/ci/test_classify_changes.py b/tests/ci/test_classify_changes.pyindex 8578f62ff40..84df60f89c2 100644--- a/tests/ci/test_classify_changes.py+++ b/tests/ci/test_classify_changes.py@@ -340,6 +340,8 @@ CASES = {["tests/tools/test_docker_environment.py"], _lanes(python=True, python_prod=False, scan=True)),"sshd harness → remote_backends": (["scripts/ci/start_test_sshd.sh"], _lanes(python=True, remote_backends=True)),+ "sshd container setup → remote_backends": (+ ["scripts/ci/test_sshd_container_setup.sh"], _lanes(python=True, remote_backends=True)),"other tool → no remote_backends": (["tools/file_tools.py"], _lanes(python=True, scan=True)),"gateway python → no slow lane": (["gateway/run.py", "agent/x.py"], _lanes(python=True, scan=True)),"desktop renderer → no slow lane": (["apps/desktop/src/app/chat/composer.tsx"], _lanes(frontend=True)),diff --git a/tests/tools/test_docker_backend_real.py b/tests/tools/test_docker_backend_real.pyindex b8c10776497..fdb5616c072 100644--- a/tests/tools/test_docker_backend_real.py+++ b/tests/tools/test_docker_backend_real.py@@ -6,7 +6,7 @@ a broken ``docker run``/``docker exec`` argv, snapshot bootstrap, cwd tracking oenv forwarding fails here instead of on a user's machine.Armed by ``HERMES_TEST_DOCKER_IMAGE`` (a small public image with bash, e.g.-``debian:12-slim``); the remote-backends CI lane sets it. Skipped otherwise. Once+``debian:13-slim``); the remote-backends CI lane sets it. Skipped otherwise. Oncearmed a missing daemon FAILS rather than skips: a lane that reports green overzero coverage is the state this file exists to end."""