Skip to content

Commit df7481b

Browse files
authored
Merge branch 'stackhpc/yoga' into remove-network-config
2 parents dd18412 + a41fe3f commit df7481b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1663
-200
lines changed

.github/workflows/overcloud-host-image-build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
- name: Install OpenStack client
140140
run: |
141141
source venvs/kayobe/bin/activate &&
142-
pip install python-openstackclient -c https://opendev.org/openstack/requirements/raw/branch/stable/${{ steps.openstack_release.outputs.openstack_release }}/upper-constraints.txt
142+
pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/${{ steps.openstack_release.outputs.openstack_release }}
143143
144144
- name: Build a CentOS Stream 8 overcloud host image
145145
id: build_centos_stream_8
@@ -362,7 +362,7 @@ jobs:
362362
if: inputs.ubuntu-jammy && steps.build_ubuntu_jammy.outcome == 'success'
363363

364364
- name: Upload updated images artifact
365-
uses: actions/upload-artifact@v3
365+
uses: actions/upload-artifact@v4
366366
with:
367367
name: Updated images list
368368
path: /tmp/updated_images.txt
@@ -374,7 +374,7 @@ jobs:
374374
steps.build_ubuntu_jammy.outcome == 'success'
375375

376376
- name: Upload CentOS build logs if build failed
377-
uses: actions/upload-artifact@v3
377+
uses: actions/upload-artifact@v4
378378
with:
379379
name: CentOS build logs
380380
path: |
@@ -384,7 +384,7 @@ jobs:
384384
if: steps.build_centos_stream_8.outcome == 'failure'
385385

386386
- name: Upload Rocky 8 build logs if build failed
387-
uses: actions/upload-artifact@v3
387+
uses: actions/upload-artifact@v4
388388
with:
389389
name: Rocky 8 build logs
390390
path: |
@@ -394,7 +394,7 @@ jobs:
394394
if: steps.build_rocky_8.outcome == 'failure'
395395

396396
- name: Upload Rocky 9 build logs if build failed
397-
uses: actions/upload-artifact@v3
397+
uses: actions/upload-artifact@v4
398398
with:
399399
name: Rocky 9 build logs
400400
path: |
@@ -404,7 +404,7 @@ jobs:
404404
if: steps.build_rocky_9.outcome == 'failure'
405405

406406
- name: Upload Ubuntu Focal 20.04 build logs if build failed
407-
uses: actions/upload-artifact@v3
407+
uses: actions/upload-artifact@v4
408408
with:
409409
name: Ubuntu Focal 20.04 build logs
410410
path: |
@@ -414,7 +414,7 @@ jobs:
414414
if: steps.build_ubuntu_focal.outcome == 'failure'
415415

416416
- name: Upload Ubuntu Jammy 22.04 build logs if build failed
417-
uses: actions/upload-artifact@v3
417+
uses: actions/upload-artifact@v4
418418
with:
419419
name: Ubuntu Jammy 22.04 build logs
420420
path: |

.github/workflows/overcloud-host-image-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Install OpenStack client
9393
run: |
9494
source venvs/kayobe/bin/activate &&
95-
pip install python-openstackclient -c https://opendev.org/openstack/requirements/raw/branch/stable/yoga/upper-constraints.txt
95+
pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/${{ steps.openstack_release.outputs.openstack_release }}
9696
9797
- name: Output CentOS Stream 8 image tag
9898
id: centos_8_stream_image_tag

.github/workflows/stackhpc-all-in-one.yml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ on:
3434
vm_interface:
3535
description: Default network interface name
3636
type: string
37-
default: enp3s0
37+
default: ens3
3838
vm_flavor:
3939
description: Flavor for the all-in-one VM
4040
type: string
41-
default: general.v1.medium
41+
default: en1.medium
4242
vm_network:
4343
description: Network for the all-in-one VM
4444
type: string
45-
default: stackhpc-release
45+
default: stackhpc-ci
4646
vm_subnet:
4747
description: Subnet for the all-in-one VM
4848
type: string
49-
default: stackhpc-release-subnet
49+
default: stackhpc-ci
5050
OS_CLOUD:
5151
description: Name of cloud in clouds.yaml
5252
type: string
@@ -69,18 +69,27 @@ jobs:
6969
# NOTE: Runner needs unzip and nodejs packages.
7070
all-in-one:
7171
name: All in one
72-
if: inputs.if
73-
runs-on: [self-hosted, stackhpc-kayobe-config-aio]
72+
if: ${{ inputs.if && !cancelled() }}
73+
runs-on: arc-skc-aio-runner
7474
permissions: {}
7575
env:
7676
KAYOBE_ENVIRONMENT: ci-aio
7777
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
7878
KAYOBE_IMAGE: ${{ inputs.kayobe_image }}
7979
steps:
80+
- name: Install Package
81+
uses: ConorMacBride/install-package@main
82+
with:
83+
apt: git unzip nodejs
84+
8085
- uses: actions/checkout@v4
8186
with:
8287
submodules: true
8388

89+
- name: Make sure dockerd is running and test Docker
90+
run: |
91+
docker ps
92+
8493
- name: Output image tag
8594
id: image_tag
8695
run: |
@@ -125,6 +134,7 @@ jobs:
125134
aio_vm_flavor = "${{ env.VM_FLAVOR }}"
126135
aio_vm_network = "${{ env.VM_NETWORK }}"
127136
aio_vm_subnet = "${{ env.VM_SUBNET }}"
137+
aio_vm_tags = ${{ env.VM_TAGS }}
128138
EOF
129139
working-directory: ${{ github.workspace }}/terraform/aio
130140
env:
@@ -135,6 +145,7 @@ jobs:
135145
VM_NETWORK: ${{ inputs.vm_network }}
136146
VM_SUBNET: ${{ inputs.vm_subnet }}
137147
VM_INTERFACE: ${{ inputs.vm_interface }}
148+
VM_TAGS: '["skc-ci-aio", "PR=${{ github.event.number }}"]'
138149

139150
- name: Terraform Plan
140151
run: terraform plan
@@ -145,7 +156,19 @@ jobs:
145156
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
146157

147158
- name: Terraform Apply
148-
run: terraform apply -auto-approve
159+
run: |
160+
for attempt in $(seq 5); do
161+
if terraform apply -auto-approve; then
162+
echo "Created infrastructure on attempt $attempt"
163+
exit 0
164+
fi
165+
echo "Failed to create infrastructure on attempt $attempt"
166+
sleep 10
167+
terraform destroy -auto-approve
168+
sleep 60
169+
done
170+
echo "Failed to create infrastructure after $attempt attempts"
171+
exit 1
149172
working-directory: ${{ github.workspace }}/terraform/aio
150173
env:
151174
OS_CLOUD: ${{ inputs.OS_CLOUD }}
@@ -209,11 +232,11 @@ jobs:
209232
# The same tag may be reused (e.g. pr-123), so ensure we have the latest image.
210233
- name: Pull latest Kayobe image
211234
run: |
212-
sudo docker image pull $KAYOBE_IMAGE
235+
docker image pull $KAYOBE_IMAGE
213236
214237
- name: Run growroot
215238
run: |
216-
sudo -E docker run -t --rm \
239+
docker run -t --rm \
217240
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
218241
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
219242
$KAYOBE_IMAGE \
@@ -223,7 +246,7 @@ jobs:
223246

224247
- name: Host configure
225248
run: |
226-
sudo -E docker run -t --rm \
249+
docker run -t --rm \
227250
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
228251
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
229252
$KAYOBE_IMAGE \
@@ -233,7 +256,7 @@ jobs:
233256

234257
- name: Service deploy
235258
run: |
236-
sudo -E docker run -t --rm \
259+
docker run -t --rm \
237260
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
238261
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
239262
$KAYOBE_IMAGE \
@@ -243,7 +266,7 @@ jobs:
243266

244267
- name: Configure aio resources
245268
run: |
246-
sudo -E docker run -t --rm \
269+
docker run -t --rm \
247270
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
248271
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
249272
$KAYOBE_IMAGE \
@@ -254,7 +277,7 @@ jobs:
254277
- name: Tempest tests
255278
run: |
256279
mkdir -p tempest-artifacts
257-
sudo -E docker run -t --rm \
280+
docker run -t --rm \
258281
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
259282
-v $(pwd)/tempest-artifacts:/stack/tempest-artifacts \
260283
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
@@ -264,7 +287,7 @@ jobs:
264287
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
265288

266289
- name: Upload test result artifacts
267-
uses: actions/upload-artifact@v3
290+
uses: actions/upload-artifact@v4
268291
with:
269292
name: tempest-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}
270293
path: tempest-artifacts/*
@@ -281,8 +304,3 @@ jobs:
281304
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
282305
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
283306
if: always()
284-
285-
- name: Prune Docker images over 1 week old
286-
# May fail if another prune is running
287-
run: sudo docker image prune --all --force --filter until=168h || true
288-
if: always()

.github/workflows/stackhpc-build-kayobe-image.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ jobs:
5252
submodules: true
5353

5454
- name: Log in to the Container registry
55-
uses: docker/login-action@v2
55+
uses: docker/login-action@v3
5656
with:
5757
registry: ${{ env.REGISTRY }}
5858
username: ${{ github.actor }}
5959
password: ${{ secrets.GITHUB_TOKEN }}
6060

6161
- name: Extract metadata (tags, labels) for Docker
6262
id: meta
63-
uses: docker/metadata-action@v4
63+
uses: docker/metadata-action@v5
6464
with:
6565
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6666

6767
- name: Set up Docker Buildx
68-
uses: docker/setup-buildx-action@v2
68+
uses: docker/setup-buildx-action@v3
6969
with:
7070
driver-opts: |
7171
image=moby/buildkit:master
@@ -78,14 +78,18 @@ jobs:
7878
https_proxy: ${{ inputs.https_proxy }}
7979
no_proxy: ${{ inputs.no_proxy }}
8080

81+
# Setting KAYOBE_USER_UID and KAYOBE_USER_GID to 1001 to match docker's defaults
82+
# so that docker can run as a privileged user within the Kayobe image.
8183
- name: Build and push Docker image
82-
uses: docker/build-push-action@v3
84+
uses: docker/build-push-action@v5
8385
with:
8486
file: ./.automation/docker/kayobe/Dockerfile
8587
context: .
8688
build-args: |
8789
http_proxy=${{ inputs.http_proxy }}
8890
https_proxy=${{ inputs.https_proxy }}
91+
KAYOBE_USER_UID=1001
92+
KAYOBE_USER_GID=1001
8993
push: true
9094
tags: ${{ steps.meta.outputs.tags }}
9195
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Clean up stale CI resources
3+
on:
4+
schedule:
5+
# Every 2 hours at quarter past
6+
- cron: '15 0/2 * * *'
7+
8+
jobs:
9+
ci-cleanup:
10+
name: Clean up stale CI resources
11+
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
12+
runs-on: ubuntu-latest
13+
permissions: {}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
path: src/kayobe-config
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
23+
- name: Generate clouds.yaml
24+
run: |
25+
cat << EOF > clouds.yaml
26+
${{ secrets.CLOUDS_YAML }}
27+
EOF
28+
29+
- name: Determine OpenStack release
30+
id: openstack_release
31+
run: |
32+
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
33+
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
34+
35+
- name: Install OpenStack client
36+
run: |
37+
pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/${{ steps.openstack_release.outputs.openstack_release }}
38+
39+
- name: Clean up aio instances over 3 hours old
40+
run: |
41+
result=0
42+
changes_before=$(date -Imin -d -3hours)
43+
for status in ACTIVE BUILD ERROR SHUTOFF; do
44+
for instance in $(openstack server list --tags skc-ci-aio --os-compute-api-version 2.66 --format value --column ID --changes-before $changes_before --status $status); do
45+
echo "Cleaning up $status instance $instance"
46+
openstack server show $instance
47+
if ! openstack server delete $instance; then
48+
echo "Failed to delete $status instance $instance"
49+
result=1
50+
fi
51+
done
52+
done
53+
exit $result
54+
env:
55+
OS_CLOUD: openstack
56+
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
57+
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}

0 commit comments

Comments
 (0)