diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 1b1abba..8e31c6e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -36,9 +36,19 @@ jobs: # hosted Github Actions runners don't offer much space. Clean up unused # dependencies so that we don't run out of disk. Borrowed from # https://carlosbecker.com/posts/github-actions-disk-space. + # + # Note: deleting these directories can be very slow, so we only remove + # enough to allow the build to complete. We'll drop this workaround and + # get better build times once we switch to self-hosted runners with + # persistent storage and more disk. - name: "cleanup" run: | - sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL + time du -sh /usr/share/dotnet + time du -sh /opt/hostedtoolcache/CodeQL + + time sudo rm -rf /usr/share/dotnet + time sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo docker image prune --all --force sudo docker builder prune -a - uses: actions/checkout@v5 @@ -57,11 +67,15 @@ jobs: echo "$(pwd)/bin" >> $GITHUB_PATH # Run simulated omicron in the background with docker compose. # TODO(jmcarp): support tests against multiple omicron versions. - # TODO(jmcarp): publish this image for faster builds. + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: omicron-dev working-directory: acctest run: | - docker compose build if ! docker compose up --wait --wait-timeout 1500; then docker compose logs exit 1 diff --git a/acctest/Dockerfile b/acctest/Dockerfile index 242f630..2fbc619 100644 --- a/acctest/Dockerfile +++ b/acctest/Dockerfile @@ -2,11 +2,15 @@ FROM rust SHELL ["/bin/bash", "-c"] +ARG OMICRON_REF=main + RUN \ - git clone https://github.com/oxidecomputer/omicron.git --branch main --depth 1 && \ + git clone https://github.com/oxidecomputer/omicron.git && \ cd omicron && \ + git checkout $OMICRON_REF && \ source env.sh && \ - ./tools/install_builder_prerequisites.sh -y -s + ./tools/install_builder_prerequisites.sh -y -s && \ + cargo xtask omicron-dev help COPY nexus-config.toml omicron diff --git a/acctest/docker-compose.yaml b/acctest/docker-compose.yaml index 5577714..a7a02f2 100644 --- a/acctest/docker-compose.yaml +++ b/acctest/docker-compose.yaml @@ -1,6 +1,6 @@ services: omicron-dev: - build: . + image: ghcr.io/oxidecomputer/omicron-acceptance-test:4449f0156baa80430eec3a98d53b3c1d8ed06c8d command: /bin/bash -c 'source env.sh && cargo xtask omicron-dev run-all --nexus-config ./nexus-config.toml' healthcheck: test: ["CMD", "curl", "-f", "http://localhost:12220"] diff --git a/acctest/nexus-config.toml b/acctest/nexus-config.toml index 7924381..39be41e 100644 --- a/acctest/nexus-config.toml +++ b/acctest/nexus-config.toml @@ -98,13 +98,16 @@ metrics_producer_gc.period_secs = 60 external_endpoints.period_secs = 60 nat_cleanup.period_secs = 30 bfd_manager.period_secs = 30 +# How frequently to check for a new inventory collection (made by any Nexus). +# This is cheap, so we should check frequently. +inventory.period_secs_load = 15 # How frequently to collect hardware/software inventory from the whole system # (even if we don't have reason to believe anything has changed). -inventory.period_secs = 600 +inventory.period_secs_collect = 600 # Maximum number of past collections to keep in the database inventory.nkeep = 5 # Disable inventory collection altogether (for emergencies) -inventory.disable = false +inventory.disable_collect = false phantom_disks.period_secs = 30 physical_disk_adoption.period_secs = 30 support_bundle_collector.period_secs = 30