-
Notifications
You must be signed in to change notification settings - Fork 23
Automatically build and promote overcloud host images #1898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stackhpc/2025.1
Are you sure you want to change the base?
Changes from all commits
1f5c95a
0736f91
18ec7f6
58b77f2
87ab663
e0ce8ef
eb57551
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This file is a list of path filters for the overcloud host image build workflow in .github/workflows/trigger-overcloud-host-image-build.yml. | ||
pulp-repo-versions: &pulp-repo-versions | ||
- 'etc/kayobe/pulp-repo-versions.yml' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ jobs: | |
runs-on: ${{ needs.runner-selection.outputs.runner_name_image_build }} | ||
needs: | ||
- runner-selection | ||
permissions: {} | ||
permissions: write-all | ||
steps: | ||
- name: Validate inputs | ||
run: | | ||
|
@@ -56,7 +56,7 @@ jobs: | |
- name: Install Package | ||
uses: ConorMacBride/install-package@main | ||
with: | ||
apt: git unzip nodejs python3-pip python3-venv openssh-server openssh-client jq | ||
apt: git unzip nodejs python3-pip python3-venv openssh-server openssh-client jq gh | ||
|
||
- name: Start the SSH service | ||
run: | | ||
|
@@ -390,3 +390,41 @@ jobs: | |
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} | ||
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} | ||
if: always() | ||
|
||
- name: Trigger update overcloud host image tags | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want this to trigger every time? We can keep it on by default, but it'd be nice to have an option to skip the tag update since sometimes we just want to test that images do in fact build with a new configuration |
||
run: | | ||
gh workflow run \ | ||
update-overcloud-host-image-tags.yml \ | ||
--repo stackhpc/stackhpc-kayobe-config \ | ||
--ref $BRANCH_NAME \ | ||
$(if [[ "${{ inputs.rocky9 }}" == "true" ]]; then echo "-f rocky9_tag=${{ steps.host_image_tag.outputs.host_image_tag }}"; fi) \ | ||
$(if [[ "${{ inputs.ubuntu-noble }}" == "true" ]]; then echo "-f ubuntu_noble_tag=${{ steps.host_image_tag.outputs.host_image_tag }}"; fi) | ||
Comment on lines
+400
to
+401
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See review at .github/workflows/update-overcloud-host-image-tags.yml:46 |
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
|
||
- name: Display link to update overcloud host image tags workflows | ||
run: | | ||
echo "::notice Overcloud host image promote workflow: https://github.com/stackhpc/stackhpc-kayobe-config/actions/workflows/update-overcloud-host-image-tags.yml" | ||
|
||
- name: Send message to Slack via Workflow Builder | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"channel-id": "${{ env.SLACK_CHANNEL_ID }}", | ||
"inputs": "${{ env.INPUTS }}", | ||
"message": "${{ env.MESSAGE }}", | ||
"results-url": "${{ env.RESULTS_URL }}", | ||
"workflow-url": "${{ env.WORKFLOW_URL }}" | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
# #release-train-alerts | ||
SLACK_CHANNEL_ID: C03B28HRP53 | ||
INPUTS: >- | ||
branch: ${{ github.ref_name }} | ||
MESSAGE: "SKC overcloud host image build failed :sob:" | ||
RESULTS_URL: "N/A" | ||
WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
if: failure() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,6 @@ on: | |
description: Promote Ubuntu 24.04 Noble | ||
type: boolean | ||
default: true | ||
image_tag: | ||
description: Tag to promote | ||
type: string | ||
required: true | ||
env: | ||
ANSIBLE_FORCE_COLOR: True | ||
jobs: | ||
|
@@ -81,7 +77,7 @@ jobs: | |
-e os_distribution='rocky' \ | ||
-e os_release='9' | ||
env: | ||
ARTIFACT_TAG: ${{ inputs.image_tag }} | ||
ARTIFACT_TAG: "{{ stackhpc_rocky_9_overcloud_host_image_version }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm just trying to understand what's going on here So, are you setting this env var to a jinja template of the |
||
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} | ||
if: inputs.rocky9 | ||
|
||
|
@@ -95,6 +91,6 @@ jobs: | |
-e os_distribution='ubuntu' \ | ||
-e os_release='noble' | ||
env: | ||
ARTIFACT_TAG: ${{ inputs.image_tag }} | ||
ARTIFACT_TAG: "{{ stackhpc_ubuntu_noble_overcloud_host_image_version }}" | ||
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} | ||
if: inputs.ubuntu-noble |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,20 @@ jobs: | |
run: | | ||
echo "::notice Container image promote workflow: https://github.com/stackhpc/stackhpc-release-train/actions/workflows/container-promote.yml" | ||
|
||
- name: Trigger overcloud host image promotion | ||
run: | | ||
gh workflow run \ | ||
overcloud-host-image-promote.yml \ | ||
--repo stackhpc/stackhpc-kayobe-config \ | ||
--ref $BRANCH_NAME | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.STACKHPC_RELEASE_TRAIN_TOKEN }} | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
|
||
- name: Display link to overcloud host image promotion workflows | ||
run: | | ||
echo "::notice Overcloud host image promote workflow: https://github.com/stackhpc/stackhpc-kayobe-config/actions/workflows/overcloud-host-image-promote.yml" | ||
|
||
- name: Send message to Slack via Workflow Builder | ||
uses: slackapi/[email protected] | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Trigger overcloud host image build | ||
on: | ||
push: | ||
branches: | ||
- stackhpc/2025.1 | ||
|
||
jobs: | ||
check-changes: | ||
runs-on: ubuntu-24.04 | ||
name: Check changed files | ||
if: github.repository == 'stackhpc/stackhpc-kayobe-config' | ||
outputs: | ||
pulp-repo-versions: ${{ steps.changes.outputs.pulp-repo-versions }} | ||
steps: | ||
- name: GitHub Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check changed files | ||
uses: dorny/paths-filter@v3 | ||
id: changes | ||
with: | ||
filters: .github/overcloud-host-image-build-path-filters.yml | ||
|
||
trigger-overcloud-host-image-build: | ||
runs-on: ubuntu-24.04 | ||
name: Trigger overcloud host image build | ||
needs: | ||
- check-changes | ||
if: ${{ needs.check-changes.outputs.pulp-repo-versions == 'true' }} | ||
steps: | ||
- name: Trigger overcloud host image build | ||
run: | | ||
gh workflow run \ | ||
overcloud-host-image-build.yml \ | ||
--repo stackhpc/stackhpc-kayobe-config \ | ||
--ref $BRANCH_NAME | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
|
||
- name: Display link to overcloud host image build workflows | ||
run: | | ||
echo "::notice Overcloud host image build workflows: https://github.com/stackhpc/stackhpc-kayobe-config/actions/workflows/overcloud-host-image-build.yml" |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,56 @@ | ||||||
--- | ||||||
name: Update overcloud host image tags | ||||||
|
||||||
on: | ||||||
workflow_dispatch: | ||||||
inputs: | ||||||
rocky9_tag: | ||||||
description: Overcloud host image tag for Rocky 9 | ||||||
type: string | ||||||
ubuntu_noble_tag: | ||||||
description: Overcloud host image tag for Ubuntu | ||||||
type: string | ||||||
|
||||||
jobs: | ||||||
propose_overcloud_host_image_tag_updates: | ||||||
if: github.repository == 'stackhpc/stackhpc-kayobe-config' | ||||||
runs-on: ubuntu-22.04 | ||||||
permissions: | ||||||
contents: write | ||||||
pull-requests: write | ||||||
name: Update overcloud host image tags | ||||||
steps: | ||||||
- name: Checkout | ||||||
uses: actions/checkout@v4 | ||||||
with: | ||||||
ref: stackhpc/2025.1 | ||||||
path: ${{ github.workspace }}/src/kayobe-config | ||||||
|
||||||
- name: Update Rocky 9 overcloud host image tag | ||||||
run: | | ||||||
sed -i "/stackhpc_rocky_9_overcloud_host_image_version/s/.*/stackhpc_rocky_9_overcloud_host_image_version: ${{ inputs.rocky9_tag }}/" ${{ github.workspace }}/src/kayobe-config/etc/kayobe/pulp-host-image-versions.yml | ||||||
if: "${{ inputs.rocky9_tag != '' }}" | ||||||
|
||||||
- name: Update Ubuntu Noble overcloud host image tag | ||||||
run: | | ||||||
sed -i "/stackhpc_ubuntu_noble_overcloud_host_image_version/s/.*/stackhpc_ubuntu_noble_overcloud_host_image_version: ${{ inputs.ubuntu_noble_tag }}/" ${{ github.workspace }}/src/kayobe-config/etc/kayobe/pulp-host-image-versions.yml | ||||||
if: "${{ inputs.ubuntu_noble_tag != '' }}" | ||||||
|
||||||
- name: Propose changes via PR if required | ||||||
uses: peter-evans/create-pull-request@v7 | ||||||
with: | ||||||
path: ${{ github.workspace }}/src/kayobe-config | ||||||
commit-message: >- | ||||||
Bump overcloud host image tags | ||||||
author: stackhpc-ci <[email protected]> | ||||||
branch: bump-overcloud-host-images-${{ inputs.rocky9_tag }}-${{ inputs.ubuntu_noble_tag }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get why both tags are templated here but if both rocky and ubuntu are built, same tag will repeat twice.
|
||||||
delete-branch: true | ||||||
title: >- | ||||||
DNM test PR: Bump overcloud host image tags | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be a real PR right?
Suggested change
|
||||||
body: | | ||||||
This PR was created automatically to update the overcloud host image | ||||||
tags. | ||||||
Rocky 9: ${{ inputs.rocky9_tag }} | ||||||
Ubuntu Noble: ${{ inputs.ubuntu_noble_tag }} | ||||||
labels: | | ||||||
automated |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
features: | ||
- | | ||
Overcloud host images will now automatically be built when changes to | ||
``pulp-repo-versions.yml`` are pushed to ``stackhpc/2025.1``. Once these | ||
are built successfully, a PR will be automatically proposed back to SKC to | ||
MoteHue marked this conversation as resolved.
Show resolved
Hide resolved
|
||
bump the image tags. These images will then be automatically promoted when | ||
new host image tags are merged. If the overcloud host image build fails, an | ||
alert will be sent to #release-train-alerts on Slack. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this is too specific to us and can be removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need all writes for this workflow?