Skip to content
Open
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
12 changes: 6 additions & 6 deletions .github/workflows/spread-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

spread:
name: Build a ${{ matrix.series }} image on ${{ matrix.group }} (${{ matrix.systems }})
runs-on: [self-hosted, ubuntu-image]
runs-on: [self-hosted, spread-enabled]
needs: [snap-build-amd64, snap-build-arm64]
strategy:
fail-fast: false
Expand Down Expand Up @@ -159,13 +159,13 @@ jobs:
# Register a problem matcher to highlight spread failures
echo "::add-matcher::.github/spread-problem-matcher.json"

BACKEND=google
BACKEND=openstack
SERIES=${{ matrix.series }}

if [[ "${{ matrix.systems }}" =~ -arm- ]]; then
BACKEND=google-arm
BACKEND=openstack-arm
elif [[ "${{ matrix.group }}" =~ -crossbuild ]]; then
BACKEND=google-crossbuild
BACKEND=openstack-crossbuild
fi

RUN_TESTS=""
Expand Down Expand Up @@ -201,9 +201,9 @@ jobs:
echo "Running spread log parser"
./tests/lib/external/snapd-testing-tools/utils/log-parser spread.log --output spread-results.json

BACKEND=google
BACKEND=openstack
if [[ "${{ matrix.systems }}" =~ -arm- ]]; then
BACKEND=google-arm
BACKEND=openstack-arm
fi

echo "Determining which tests were executed"
Expand Down
8 changes: 7 additions & 1 deletion internal/statemachine/classic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2151,6 +2151,9 @@ func TestPrepareClassicImage(t *testing.T) {
SnapName: "lxd",
Channel: "latest/stable",
},
{
SnapName: "core26",
},
{
SnapName: "core24",
},
Expand All @@ -2171,7 +2174,7 @@ func TestPrepareClassicImage(t *testing.T) {

// check that the lxd and hello snaps, as well as lxd's base, core20
// were prepared in the correct location
snaps := map[string]string{"lxd": "stable", "hello": "candidate", "core20": "stable", "core22": "stable", "core24": "stable"}
snaps := map[string]string{"lxd": "stable", "hello": "candidate", "core20": "stable", "core22": "stable", "core24": "stable", "core26": "stable"}
for snapName, snapChannel := range snaps {
// reach out to the snap store to find the revision
// of the snap for the specified channel
Expand Down Expand Up @@ -5182,6 +5185,9 @@ func TestPreseedResetChroot(t *testing.T) {
{
SnapName: "core24",
},
{
SnapName: "core26",
},
},
},
}
Expand Down
87 changes: 54 additions & 33 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,69 @@ environment:


backends:
google:
key: '$(HOST: echo "$SPREAD_GOOGLE_KEY")'
location: snapd-spread/us-east1-b
plan: n2-standard-2
openstack:
key: '$(HOST: echo "$OS_CREDENTIALS_AMD64_PS7")'
plan: shared.xsmall
halt-timeout: 2h
wait-timeout: 10m
groups: [default]
proxy: ingress-haproxy.ps7.canonical.com
cidr-port-rel: [10.151.96.0/21:5000]
volume-auto-delete: true
environment: &openstack-env
SNAPD_USE_PROXY: 'true'
HTTP_PROXY: 'http://egress.ps7.internal:3128'
HTTPS_PROXY: 'http://egress.ps7.internal:3128'
http_proxy: 'http://egress.ps7.internal:3128'
https_proxy: 'http://egress.ps7.internal:3128'
no_proxy: '127.0.0.1,127.0.0.53,localhost'
NO_PROXY: '127.0.0.1,127.0.0.53,localhost'
NTP_SERVER: 'ntp.ps7.internal'
systems:
- ubuntu-20.04-64:
storage: 45G
image: snapd-spread/ubuntu-20.04-64
workers: 1
- ubuntu-22.04-64:
storage: 45G
image: snapd-spread/ubuntu-22.04-64
workers: 1
- ubuntu-24.04-64:
storage: 45G
image: snapd-spread/ubuntu-24.04-64
workers: 1
google-crossbuild:
type: google
key: '$(HOST: echo "$SPREAD_GOOGLE_KEY")'
location: snapd-spread/us-east1-b
plan: n2-standard-4
openstack-crossbuild:
type: openstack
key: '$(HOST: echo "$OS_CREDENTIALS_AMD64_PS7")'
plan: shared.medium
halt-timeout: 2h
wait-timeout: 10m
proxy: ingress-haproxy.ps7.canonical.com
cidr-port-rel: [10.151.96.0/21:5000]
volume-auto-delete: true
environment: *openstack-env
systems:
- ubuntu-24.04-64:
storage: 45G
image: snapd-spread/ubuntu-24.04-64
workers: 1
google-arm:
type: google
key: '$(HOST: echo "$SPREAD_GOOGLE_KEY")'
location: snapd-spread/us-central1-a
plan: t2a-standard-1
openstack-arm:
type: openstack
key: '$(HOST: echo "$OS_CREDENTIALS_ARM64_PS7")'
plan: shared.xsmall.arm64
halt-timeout: 2h
wait-timeout: 10m
groups: [default]
proxy: ingress-haproxy.ps7.canonical.com
cidr-port-rel: [10.151.89.0/24:8000]
volume-auto-delete: true
environment: *openstack-env
systems:
- ubuntu-20.04-arm-64:
image: ubuntu-os-cloud/ubuntu-2004-lts-arm64
image: snapd-spread/ubuntu-20.04-arm-64
workers: 1
storage: 45G
- ubuntu-22.04-arm-64:
image: ubuntu-os-cloud/ubuntu-2204-lts-arm64
image: snapd-spread/ubuntu-22.04-arm-64
workers: 1
storage: 45G
- ubuntu-24.04-arm-64:
image: ubuntu-os-cloud/ubuntu-2404-lts-arm64
image: snapd-spread/ubuntu-24.04-arm-64
workers: 1
storage: 45G
qemu:
memory: 4G
systems:
Expand All @@ -75,6 +94,14 @@ backends:
path: /home/ubuntu-image

prepare: |
#shellcheck source=tests/lib/spread/tools.sh
. $SPREAD_PATH/tests/lib/spread/tools.sh
if [ -n "$HTTP_PROXY" ]; then
# The snapd daemon doesn't see the environment variables, so we must modify its config
# to use a proxy with it. Came from:
# https://github.com/canonical/snapd/blob/619cc925793591348db21bb45fa4af65288d2c42/tests/lib/prepare.sh#L90
tools.setup_snapd_proxy
fi
# Make sure there is a hostname file because it could be missing
# We will need it to have debootstrap properly run
if [ ! -f /etc/hostname ]; then
Expand Down Expand Up @@ -107,12 +134,6 @@ prepare: |
systemctl mask unattended-upgrades.service
fi

# Make sure ssh service is restarted after it is killed by spread (pkill -o -HUP sshd)
# during the machine setup in google systems. For more details see lp:2011458
if [ "$SPREAD_BACKEND" = "google" ] && [[ "$SPREAD_SYSTEM" == ubuntu-2* ]] && ! systemctl is-active ssh; then
systemctl restart ssh
fi

apt update
apt install -y snapd libc6-dev git ubuntu-dev-tools
if [[ ! "$SPREAD_BACKEND" == *-arm ]]; then
Expand Down Expand Up @@ -146,18 +167,18 @@ suites:
summary: Common integration tests for ubuntu-image
tests/amd64/:
summary: Integration tests for ubuntu-image on amd64
backends: [google, qemu]
backends: [openstack, qemu]
environment:
IMG/ubuntu_server_pc_amd64: ubuntu-server-pc-amd64
tests/amd64-crossbuild/:
summary: Integration tests for ubuntu-image on amd64
backends: [google-crossbuild, qemu]
backends: [openstack-crossbuild, qemu]
environment:
IMG/ubuntu_server_riscv64: ubuntu-server-riscv64
IMG/ubuntu_server_pi_arm64: ubuntu-server-pi-arm64
tests/arm64/:
summary: Integration tests for ubuntu-image on arm64
backends: [google-arm]
backends: [openstack-arm]
environment:
IMG/ubuntu_server_pi_arm64: ubuntu-server-pi-arm64
IMG/ubuntu_server_pc_arm64: ubuntu-server-pc-arm64
Expand Down
17 changes: 17 additions & 0 deletions tests/lib/spread/tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
tools.setup_snapd_proxy() {
if [ "${SNAPD_USE_PROXY:-}" != true ]; then
return
fi

local SNAPD_CONFD="/etc/systemd/system/snapd.service.d"
mkdir -p "$SNAPD_CONFD"

cat <<EOF > ${SNAPD_CONFD}/proxy.conf
[Service]
Environment=HTTPS_PROXY="$HTTPS_PROXY" HTTP_PROXY="$HTTP_PROXY" https_proxy="$HTTPS_PROXY" http_proxy="$HTTP_PROXY" NO_PROXY="$NO_PROXY" no_proxy="$NO_PROXY"
EOF

# Since the service config changed, restart
systemctl daemon-reload
systemctl restart snapd.service
}
Loading