Skip to content

Commit

Permalink
WIP: Build containers in a container
Browse files Browse the repository at this point in the history
  • Loading branch information
markgoddard committed Jan 23, 2024
1 parent 5b2b98b commit e5c0e8a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 37 deletions.
48 changes: 12 additions & 36 deletions .github/workflows/stackhpc-container-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ 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 }}
matrix: ${{ steps.set-matrix.outputs.matrix }}
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
Expand Down Expand Up @@ -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:
Expand All @@ -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 &&
Expand All @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion etc/kayobe/environments/ci-builder/inventory/groups
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[seed]

[container-image-builders:children]
seed
localhost connection=local

[network]

Expand Down

0 comments on commit e5c0e8a

Please sign in to comment.