From e5c0e8a53937ffb97503a9d11dfd5e9131505563 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Tue, 23 Jan 2024 10:03:44 +0000 Subject: [PATCH] WIP: Build containers in a container --- .../stackhpc-container-image-build.yml | 48 +++++-------------- .../environments/ci-builder/inventory/groups | 2 +- 2 files changed, 13 insertions(+), 37 deletions(-) diff --git a/.github/workflows/stackhpc-container-image-build.yml b/.github/workflows/stackhpc-container-image-build.yml index 7cd09b585..7d1408b9a 100644 --- a/.github/workflows/stackhpc-container-image-build.yml +++ b/.github/workflows/stackhpc-container-image-build.yml @@ -40,7 +40,7 @@ jobs: generate-tag: name: Generate container image tag if: github.repository == 'stackhpc/stackhpc-kayobe-config' - runs-on: [self-hosted, stackhpc-kayobe-config-kolla-builder-rl9] + runs-on: arc-skc-aio-runner permissions: {} outputs: datetime_tag: ${{ steps.datetime_tag.outputs.datetime_tag }} @@ -48,7 +48,7 @@ jobs: openstack_release: ${{ steps.openstack_release.outputs.openstack_release }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Determine OpenStack release id: openstack_release @@ -88,7 +88,7 @@ jobs: container-image-build: name: Build Kolla container images if: github.repository == 'stackhpc/stackhpc-kayobe-config' - runs-on: [self-hosted, stackhpc-kayobe-config-kolla-builder-rl9] + runs-on: arc-skc-aio-runner timeout-minutes: 720 permissions: {} strategy: @@ -97,32 +97,22 @@ jobs: needs: - generate-tag steps: - - uses: actions/checkout@v3 + - name: Install package dependencies + run: | + sudo apt update + sudo apt install -y build-essential git unzip nodejs python3-wheel python3-pip python3-venv + + - uses: actions/checkout@v4 with: path: src/kayobe-config - name: Clone StackHPC Kayobe repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: stackhpc/kayobe ref: refs/heads/stackhpc/${{ needs.generate-tag.outputs.openstack_release }} path: src/kayobe - - name: Setup networking - run: | - if ! ip l show breth1 >/dev/null 2>&1; then - sudo ip l add breth1 type bridge - fi - sudo ip l set breth1 up - if ! ip a show breth1 | grep 192.168.33.3/24; then - sudo ip a add 192.168.33.3/24 dev breth1 - fi - if ! ip l show dummy1 >/dev/null 2>&1; then - sudo ip l add dummy1 type dummy - fi - sudo ip l set dummy1 up - sudo ip l set dummy1 master breth1 - - name: Install Kayobe run: | mkdir -p venvs && @@ -132,23 +122,9 @@ jobs: pip install -U pip && pip install ../src/kayobe - - name: Bootstrap the control host - run: | - source venvs/kayobe/bin/activate && - source src/kayobe-config/kayobe-env --environment ci-builder && - kayobe control host bootstrap - - - name: Configure the seed host - run: | - source venvs/kayobe/bin/activate && - source src/kayobe-config/kayobe-env --environment ci-builder && - kayobe seed host configure - env: - KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} - - name: Prune local Kolla container images over 1 week old run: | - sudo docker image prune --all --force --filter until=168h --filter="label=kolla_version" + docker image prune --all --force --filter until=168h --filter="label=kolla_version" - name: Build and push kolla overcloud images run: | @@ -183,7 +159,7 @@ jobs: - name: Get built container images run: | - sudo docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:*${{ matrix.distro }}*${{ needs.generate-tag.outputs.datetime_tag }}" > ${{ matrix.distro }}-container-images + docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:*${{ matrix.distro }}*${{ needs.generate-tag.outputs.datetime_tag }}" > ${{ matrix.distro }}-container-images - name: Fail if no images have been built run: if [ $(wc -l < ${{ matrix.distro }}-container-images) -le 1 ]; then exit 1; fi diff --git a/etc/kayobe/environments/ci-builder/inventory/groups b/etc/kayobe/environments/ci-builder/inventory/groups index 155f353e2..886e9b906 100644 --- a/etc/kayobe/environments/ci-builder/inventory/groups +++ b/etc/kayobe/environments/ci-builder/inventory/groups @@ -1,7 +1,7 @@ [seed] [container-image-builders:children] -seed +localhost connection=local [network]