Skip to content

Commit d786510

Browse files
committed
acctests: use docker image from ghcr.
Rather than building the acctests omicron image from scratch on every run, push the image to ghcr out of band, and pull during tests.
1 parent fb7e507 commit d786510

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

.github/workflows/build-test.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
- name: "cleanup"
4040
run: |
4141
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
42-
sudo docker image prune --all --force
43-
sudo docker builder prune -a
42+
# sudo docker image prune --all --force
43+
# sudo docker builder prune -a
4444
- uses: actions/checkout@v5
4545
- uses: hashicorp/setup-terraform@v3
4646
- uses: actions/setup-go@v5
@@ -57,11 +57,15 @@ jobs:
5757
echo "$(pwd)/bin" >> $GITHUB_PATH
5858
# Run simulated omicron in the background with docker compose.
5959
# TODO(jmcarp): support tests against multiple omicron versions.
60-
# TODO(jmcarp): publish this image for faster builds.
60+
- name: Login to GitHub Container Registry
61+
uses: docker/login-action@v3
62+
with:
63+
registry: ghcr.io
64+
username: ${{ github.actor }}
65+
password: ${{ secrets.GITHUB_TOKEN }}
6166
- name: omicron-dev
6267
working-directory: acctest
6368
run: |
64-
docker compose build
6569
if ! docker compose up --wait --wait-timeout 1500; then
6670
docker compose logs
6771
exit 1

acctest/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ FROM rust
22

33
SHELL ["/bin/bash", "-c"]
44

5+
ARG OMICRON_REF=main
6+
57
RUN \
6-
git clone https://github.com/oxidecomputer/omicron.git --branch main --depth 1 && \
8+
git clone https://github.com/oxidecomputer/omicron.git && \
79
cd omicron && \
10+
git checkout $OMICRON_REF && \
811
source env.sh && \
9-
./tools/install_builder_prerequisites.sh -y -s
12+
./tools/install_builder_prerequisites.sh -y -s && \
13+
cargo xtask omicron-dev help
1014

1115
COPY nexus-config.toml omicron
1216

acctest/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
omicron-dev:
3-
build: .
3+
image: ghcr.io/oxidecomputer/omicron-acceptance-test:4449f0156baa80430eec3a98d53b3c1d8ed06c8d
44
command: /bin/bash -c 'source env.sh && cargo xtask omicron-dev run-all --nexus-config ./nexus-config.toml'
55
healthcheck:
66
test: ["CMD", "curl", "-f", "http://localhost:12220"]

acctest/nexus-config.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,16 @@ metrics_producer_gc.period_secs = 60
9898
external_endpoints.period_secs = 60
9999
nat_cleanup.period_secs = 30
100100
bfd_manager.period_secs = 30
101+
# How frequently to check for a new inventory collection (made by any Nexus).
102+
# This is cheap, so we should check frequently.
103+
inventory.period_secs_load = 15
101104
# How frequently to collect hardware/software inventory from the whole system
102105
# (even if we don't have reason to believe anything has changed).
103-
inventory.period_secs = 600
106+
inventory.period_secs_collect = 600
104107
# Maximum number of past collections to keep in the database
105108
inventory.nkeep = 5
106109
# Disable inventory collection altogether (for emergencies)
107-
inventory.disable = false
110+
inventory.disable_collect = false
108111
phantom_disks.period_secs = 30
109112
physical_disk_adoption.period_secs = 30
110113
support_bundle_collector.period_secs = 30

0 commit comments

Comments
 (0)