archive.ubuntu.com has been crawling (a few KB/s), taking the sshd install in every job from 8 seconds to 3.5-9.5 minutes (another agent measured it; the runner and inference-4090 were healthy). scripts/ci-sshd.sh skips the install when the image has sshd, and otherwise points apt at mirrors.edge.kernel.org first (both source layouts, 22.04 and 24.04). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPQ14L3LikyefCMFBqEbKE
21 lines
942 B
Bash
Executable File
21 lines
942 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# The throwaway sshd the tests need (nisse_dev/testing.py), in a CI job.
|
|
# Skipped when the job's image already has it. Otherwise apt fetches from a
|
|
# kernel.org mirror rather than archive.ubuntu.com, which has been slow
|
|
# enough (a few KB/s) to add minutes to every job.
|
|
set -euo pipefail
|
|
SUDO=$(command -v sudo || true)
|
|
if command -v /usr/sbin/sshd > /dev/null && command -v ssh > /dev/null; then
|
|
echo "sshd already installed"
|
|
else
|
|
MIRROR=${APT_MIRROR:-http://mirrors.edge.kernel.org/ubuntu}
|
|
# Both layouts: deb822 (ubuntu.sources, 24.04+) and sources.list (older).
|
|
for f in /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list; do
|
|
[ -f "$f" ] && $SUDO sed -i -E \
|
|
"s#https?://(archive|security)\.ubuntu\.com/ubuntu/?#$MIRROR/#g" "$f"
|
|
done
|
|
$SUDO apt-get update -qq
|
|
$SUDO apt-get install -y -qq openssh-server openssh-client > /dev/null
|
|
fi
|
|
$SUDO mkdir -p /run/sshd
|