Skip to content

Commit 649c46e

Browse files
WIP: Use Overcloud deployment image build
1 parent a4c00c3 commit 649c46e

File tree

7 files changed

+138
-53
lines changed

7 files changed

+138
-53
lines changed

.github/workflows/ipa-image-build.yml

Lines changed: 63 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,33 @@ jobs:
8484
EOF
8585
working-directory: ${{ github.workspace }}/src/kayobe-config/terraform/aio
8686

87+
- name: Output image tag
88+
id: image_tag
89+
run: |
90+
echo image_tag=$(grep stackhpc_ubuntu_jammy_overcloud_host_image_version: etc/kayobe/pulp-host-image-versions.yml | awk '{print $2}') >> $GITHUB_OUTPUT
91+
working-directory: ${{ github.workspace }}/src/kayobe-config
92+
93+
# Use the image override if set, otherwise use overcloud-os_distribution-os_release-tag
94+
- name: Output image name
95+
id: image_name
96+
run: |
97+
echo image_name=overcloud-ubuntu-jammy-${{ steps.image_tag.outputs.image_tag }} >> $GITHUB_OUTPUT
98+
8799
- name: Generate terraform.tfvars
88100
run: |
89101
cat << EOF > terraform.tfvars
90102
ssh_public_key = "id_rsa.pub"
91103
ssh_username = "ubuntu"
92-
aio_vm_name = "skc-host-image-builder"
93-
# Must be an Ubuntu Jammy host to successfully build all images
94-
# This MUST NOT be an LVM image. It can cause confusing conficts with the built image.
95-
aio_vm_image = "Ubuntu-22.04"
104+
aio_vm_name = "skc-ipa-image-builder"
105+
aio_vm_image = "${{ env.VM_IMAGE }}"
96106
aio_vm_flavor = "en1.medium"
97107
aio_vm_network = "stackhpc-ci"
98108
aio_vm_subnet = "stackhpc-ci"
99109
aio_vm_interface = "ens3"
100110
EOF
101111
working-directory: ${{ github.workspace }}/src/kayobe-config/terraform/aio
112+
env:
113+
VM_IMAGE: ${{ steps.image_name.outputs.image_name }}
102114

103115
- name: Terraform Plan
104116
run: terraform plan
@@ -170,56 +182,69 @@ jobs:
170182
source src/kayobe-config/kayobe-env --environment ci-builder &&
171183
kayobe control host bootstrap
172184
173-
- name: Configure the seed host (Builder VM)
185+
- name: Growpart
174186
run: |
175187
source venvs/kayobe/bin/activate &&
176188
source src/kayobe-config/kayobe-env --environment ci-builder &&
177-
kayobe seed host configure -e seed_bootstrap_user=ubuntu --skip-tags network
189+
kayobe playbook run src/kayobe-config/etc/kayobe/ansible/growroot.yml \
190+
-e growroot_group="seed" \
191+
-e seed_bootstrap_user="ubuntu"
192+
env:
193+
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
178194

179-
- name: Install dependencies
195+
- name: Configure the seed host (Builder VM)
180196
run: |
181197
source venvs/kayobe/bin/activate &&
182198
source src/kayobe-config/kayobe-env --environment ci-builder &&
183-
kayobe seed host command run \
184-
--command "sudo apt update && sudo apt -y install gcc git libffi-dev python3-dev python-is-python3 python3-venv" --show-output
199+
kayobe seed host configure \
200+
-e seed_bootstrap_user=ubuntu \
201+
--skip-tags network,apt,docker,docker-registry
185202
env:
186203
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
187204

188-
- name: Deploy Bifrost (Builder VM)
205+
- name: Install dependencies
189206
run: |
190207
source venvs/kayobe/bin/activate &&
191208
source src/kayobe-config/kayobe-env --environment ci-builder &&
192-
kayobe seed service deploy --kolla-tags bifrost --tags kolla-bifrost
209+
kayobe seed host command run \
210+
--command "sudo apt update && sudo apt -y install gcc git libffi-dev python3-dev python-is-python3 python3-venv" --show-output
211+
env:
212+
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
193213

194-
- name: Create bifrost_httpboot Docker volume
214+
- name: Build an Ironic Python Agent (IPA) image
215+
id: build_ipa
216+
continue-on-error: true
195217
run: |
196218
source venvs/kayobe/bin/activate &&
197219
source src/kayobe-config/kayobe-env --environment ci-builder &&
198-
kayobe seed host command run --command "sudo mkdir -p /var/lib/docker/volumes/bifrost_httpboot/_data" --show-output
220+
kayobe overcloud deployment image build --force-rebuild \
221+
-e os_distribution="ubuntu" \
222+
-e os_release="jammy" \
199223
env:
200224
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
201225

202-
- name: Build an Ironic Python Agent (IPA) image
203-
id: build_ipa
226+
- name: Show last error logs
204227
continue-on-error: true
205228
run: |
206229
source venvs/kayobe/bin/activate &&
207230
source src/kayobe-config/kayobe-env --environment ci-builder &&
208-
kayobe seed deployment image build --force-rebuild
231+
kayobe seed host command run --command "tail -200 /opt/kayobe/images/ipa/ipa.stdout" --show-output
209232
env:
210233
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
234+
if: steps.build_ipa.outcome == 'failure'
211235

212236
- name: Upload IPA kernel image to Ark
213237
run: |
214238
source venvs/kayobe/bin/activate &&
215239
source src/kayobe-config/kayobe-env --environment ci-builder &&
216240
kayobe playbook run \
217241
src/kayobe-config/etc/kayobe/ansible/pulp-image-upload.yml \
218-
-e image_path=/etc/kolla/ipa.kernel \
219-
-e repository_name="ipa-{{ openstack_release }}" \
220-
-e pulp_base_path="ipa/{{ openstack_release }}" \
242+
-e image_path=/opt/kayobe/images/ipa \
243+
-e image_name=ipa \
221244
-e image_tag=${{ steps.ipa_image_tag.outputs.ipa_image_tag }} \
222-
-e file_extension='ipa.*'
245+
-e os_distribution="ubuntu" \
246+
-e os_release="jammy" \
247+
-e file_extension='kernel'
223248
env:
224249
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
225250
if: steps.build_ipa.outcome == 'success'
@@ -230,15 +255,29 @@ jobs:
230255
source src/kayobe-config/kayobe-env --environment ci-builder &&
231256
kayobe playbook run \
232257
src/kayobe-config/etc/kayobe/ansible/pulp-image-upload.yml \
233-
-e image_path=/etc/kolla/ipa.initramfs \
234-
-e repository_name="ipa-{{ openstack_release }}" \
235-
-e pulp_base_path="ipa/{{ openstack_release }}" \
258+
-e image_path=/opt/kayobe/images/ipa \
259+
-e image_name=ipa \
236260
-e image_tag=${{ steps.ipa_image_tag.outputs.ipa_image_tag }} \
237-
-e file_extension='ipa.*'
261+
-e os_distribution="ubuntu" \
262+
-e os_release="jammy" \
263+
-e file_extension='initramfs'
238264
env:
239265
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
240266
if: steps.build_ipa.outcome == 'success'
241267

268+
- name: Copy logs back
269+
continue-on-error: true
270+
run: |
271+
mkdir logs
272+
scp -r ubuntu@$(jq -r .access_ip_v4.value src/kayobe-config/etc/kayobe/environments/ci-builder/tf-outputs.yml):/opt/kayobe/images/*/*.std* ./logs/
273+
if: always()
274+
275+
- name: Upload logs artifact
276+
uses: actions/upload-artifact@v4
277+
with:
278+
name: Build logs
279+
path: ./logs
280+
242281
- name: Fail if the IPA image build failed
243282
run: |
244283
echo "Builds failed. See workflow artifacts for details." &&

.github/workflows/package-build-ofed.yml

Lines changed: 63 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,33 @@ jobs:
8484
EOF
8585
working-directory: ${{ github.workspace }}/src/kayobe-config/terraform/aio
8686

87+
- name: Output image tag
88+
id: image_tag
89+
run: |
90+
echo image_tag=$(grep stackhpc_ubuntu_jammy_overcloud_host_image_version: etc/kayobe/pulp-host-image-versions.yml | awk '{print $2}') >> $GITHUB_OUTPUT
91+
working-directory: ${{ github.workspace }}/src/kayobe-config
92+
93+
# Use the image override if set, otherwise use overcloud-os_distribution-os_release-tag
94+
- name: Output image name
95+
id: image_name
96+
run: |
97+
echo image_name=overcloud-ubuntu-jammy-${{ steps.image_tag.outputs.image_tag }} >> $GITHUB_OUTPUT
98+
8799
- name: Generate terraform.tfvars
88100
run: |
89101
cat << EOF > terraform.tfvars
90102
ssh_public_key = "id_rsa.pub"
91103
ssh_username = "ubuntu"
92-
aio_vm_name = "skc-host-image-builder"
93-
# Must be an Ubuntu Jammy host to successfully build all images
94-
# This MUST NOT be an LVM image. It can cause confusing conficts with the built image.
95-
aio_vm_image = "Ubuntu-22.04"
104+
aio_vm_name = "skc-ipa-image-builder"
105+
aio_vm_image = "${{ env.VM_IMAGE }}"
96106
aio_vm_flavor = "en1.medium"
97107
aio_vm_network = "stackhpc-ci"
98108
aio_vm_subnet = "stackhpc-ci"
99109
aio_vm_interface = "ens3"
100110
EOF
101111
working-directory: ${{ github.workspace }}/src/kayobe-config/terraform/aio
112+
env:
113+
VM_IMAGE: ${{ steps.image_name.outputs.image_name }}
102114

103115
- name: Terraform Plan
104116
run: terraform plan
@@ -170,56 +182,69 @@ jobs:
170182
source src/kayobe-config/kayobe-env --environment ci-builder &&
171183
kayobe control host bootstrap
172184
173-
- name: Configure the seed host (Builder VM)
185+
- name: Growpart
174186
run: |
175187
source venvs/kayobe/bin/activate &&
176188
source src/kayobe-config/kayobe-env --environment ci-builder &&
177-
kayobe seed host configure -e seed_bootstrap_user=ubuntu
189+
kayobe playbook run src/kayobe-config/etc/kayobe/ansible/growroot.yml \
190+
-e growroot_group="seed" \
191+
-e seed_bootstrap_user="ubuntu"
192+
env:
193+
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
178194

179-
- name: Install dependencies
195+
- name: Configure the seed host (Builder VM)
180196
run: |
181197
source venvs/kayobe/bin/activate &&
182198
source src/kayobe-config/kayobe-env --environment ci-builder &&
183-
kayobe seed host command run \
184-
--command "sudo apt update && sudo apt -y install gcc git libffi-dev python3-dev python-is-python3 python3-venv" --show-output
199+
kayobe seed host configure \
200+
-e seed_bootstrap_user=ubuntu \
201+
--skip-tags network,apt,docker,docker-registry
185202
env:
186203
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
187204

188-
- name: Deploy Bifrost (Builder VM)
205+
- name: Install dependencies
189206
run: |
190207
source venvs/kayobe/bin/activate &&
191208
source src/kayobe-config/kayobe-env --environment ci-builder &&
192-
kayobe seed service deploy --kolla-tags bifrost --tags bifrost -ke include_dhcp_server=false
209+
kayobe seed host command run \
210+
--command "sudo apt update && sudo apt -y install gcc git libffi-dev python3-dev python-is-python3 python3-venv" --show-output
211+
env:
212+
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
193213

194-
- name: Create bifrost_httpboot Docker volume
214+
- name: Build an Ironic Python Agent (IPA) image
215+
id: build_ipa
216+
continue-on-error: true
195217
run: |
196218
source venvs/kayobe/bin/activate &&
197219
source src/kayobe-config/kayobe-env --environment ci-builder &&
198-
kayobe seed host command run --command "sudo mkdir -p /var/lib/docker/volumes/bifrost_httpboot/_data" --show-output
220+
kayobe overcloud deployment image build --force-rebuild \
221+
-e os_distribution="ubuntu" \
222+
-e os_release="jammy" \
199223
env:
200224
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
201225

202-
- name: Build an Ironic Python Agent (IPA) image
203-
id: build_ipa
226+
- name: Show last error logs
204227
continue-on-error: true
205228
run: |
206229
source venvs/kayobe/bin/activate &&
207230
source src/kayobe-config/kayobe-env --environment ci-builder &&
208-
kayobe seed deployment image build --force-rebuild
231+
kayobe seed host command run --command "tail -200 /opt/kayobe/images/ipa/ipa.stdout" --show-output
209232
env:
210233
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
234+
if: steps.build_ipa.outcome == 'failure'
211235

212236
- name: Upload IPA kernel image to Ark
213237
run: |
214238
source venvs/kayobe/bin/activate &&
215239
source src/kayobe-config/kayobe-env --environment ci-builder &&
216240
kayobe playbook run \
217241
src/kayobe-config/etc/kayobe/ansible/pulp-image-upload.yml \
218-
-e image_path=/etc/kolla/ipa.kernel \
219-
-e repository_name="ipa-{{ openstack_release }}" \
220-
-e pulp_base_path="ipa/{{ openstack_release }}" \
242+
-e image_path=/opt/kayobe/images/ipa \
243+
-e image_name=ipa \
221244
-e image_tag=${{ steps.ipa_image_tag.outputs.ipa_image_tag }} \
222-
-e file_extension='ipa.*'
245+
-e os_distribution="ubuntu" \
246+
-e os_release="jammy" \
247+
-e file_extension='kernel'
223248
env:
224249
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
225250
if: steps.build_ipa.outcome == 'success'
@@ -230,15 +255,29 @@ jobs:
230255
source src/kayobe-config/kayobe-env --environment ci-builder &&
231256
kayobe playbook run \
232257
src/kayobe-config/etc/kayobe/ansible/pulp-image-upload.yml \
233-
-e image_path=/etc/kolla/ipa.initramfs \
234-
-e repository_name="ipa-{{ openstack_release }}" \
235-
-e pulp_base_path="ipa/{{ openstack_release }}" \
258+
-e image_path=/opt/kayobe/images/ipa \
259+
-e image_name=ipa \
236260
-e image_tag=${{ steps.ipa_image_tag.outputs.ipa_image_tag }} \
237-
-e file_extension='ipa.*'
261+
-e os_distribution="ubuntu" \
262+
-e os_release="jammy" \
263+
-e file_extension='initramfs'
238264
env:
239265
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
240266
if: steps.build_ipa.outcome == 'success'
241267

268+
- name: Copy logs back
269+
continue-on-error: true
270+
run: |
271+
mkdir logs
272+
scp -r ubuntu@$(jq -r .access_ip_v4.value src/kayobe-config/etc/kayobe/environments/ci-builder/tf-outputs.yml):/opt/kayobe/images/*/*.std* ./logs/
273+
if: always()
274+
275+
- name: Upload logs artifact
276+
uses: actions/upload-artifact@v4
277+
with:
278+
name: Build logs
279+
path: ./logs
280+
242281
- name: Fail if the IPA image build failed
243282
run: |
244283
echo "Builds failed. See workflow artifacts for details." &&

etc/kayobe/environments/ci-builder/inventory/group_vars/seed/lvm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ stackhpc_lvm_group_rootvg_lvs_extra:
1010
stackhpc_lvm_lv_swap_size: 500m
1111

1212
# StackHPC LVM lv_root LV size.
13-
stackhpc_lvm_lv_root_size: 2g
13+
stackhpc_lvm_lv_root_size: 20g
1414

1515
# StackHPC LVM lv_tmp LV size.
1616
stackhpc_lvm_lv_tmp_size: 2g
@@ -31,4 +31,4 @@ stackhpc_lvm_lv_audit_size: 250m
3131
stackhpc_lvm_lv_home_size: 2g
3232

3333
# StackHPC LVM lv_docker LV size.
34-
stackhpc_lvm_lv_docker_size: 95%FREE
34+
stackhpc_lvm_lv_docker_size: 2g

etc/kayobe/environments/ci-builder/inventory/hosts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
[ofed-builder:children]
44
seed
55

6+
[controllers]
7+
builder
8+
69
[seed]
710
builder

etc/kayobe/environments/ci-builder/seed.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ seed_bootstrap_user: "{{ os_distribution if os_distribution == 'ubuntu' else 'cl
99
# Uncomment this if using an LVM-based image.
1010
# Seed lvm configuration. See inventory/group_vars/seed/lvm.yml
1111
# for the exact configuration.
12-
# seed_lvm_groups:
13-
# - "{{ stackhpc_lvm_group_rootvg }}"
12+
seed_lvm_groups:
13+
- "{{ stackhpc_lvm_group_rootvg }}"

etc/kayobe/environments/ci-builder/stackhpc-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,6 @@ stackhpc_docker_registry_password: !vault |
9696
# Username and password of the overcloud host image repository.
9797
stackhpc_image_repository_username: "{{ stackhpc_docker_registry_username }}"
9898
stackhpc_image_repository_password: "{{ stackhpc_docker_registry_password }}"
99+
100+
# Build during IPA builder workflow
101+
ipa_build_images: true

etc/kayobe/ipa.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ ipa_build_dib_elements_extra:
4545

4646
# Dictionary of additional environment variables to provide to Diskimage
4747
# Builder (DIB) during IPA image build.
48-
#ipa_build_dib_env_extra:
48+
ipa_build_dib_env_extra:
49+
DISTRO_NAME: ubuntu
4950

5051
# Dictionary of environment variables to provide to Diskimage Builder (DIB)
5152
# during IPA image build.

0 commit comments

Comments
 (0)