-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add a job to check whether all expected images are in Test Pulp
- Loading branch information
1 parent
2de3ed6
commit 66c8335
Showing
5 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
# This workflow queries the Test Pulp server to check that all image tags | ||
# specified in kolla_image_tags are present. | ||
|
||
name: Check container image tags | ||
on: | ||
workflow_call: | ||
inputs: | ||
kayobe_image: | ||
description: Kayobe container image | ||
type: string | ||
required: true | ||
secrets: | ||
KAYOBE_VAULT_PASSWORD: | ||
required: true | ||
|
||
env: | ||
ANSIBLE_FORCE_COLOR: True | ||
jobs: | ||
check-tags: | ||
name: Check container image tags | ||
if: github.repository == 'stackhpc/stackhpc-kayobe-config' | ||
runs-on: [self-hosted, stackhpc-kayobe-config-aio] | ||
permissions: {} | ||
env: | ||
KAYOBE_ENVIRONMENT: ci-aio | ||
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} | ||
KAYOBE_IMAGE: ${{ inputs.kayobe_image }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
# The same tag may be reused (e.g. pr-123), so ensure we have the latest image. | ||
- name: Pull latest Kayobe image | ||
run: | | ||
sudo docker image pull $KAYOBE_IMAGE | ||
- name: Check container image tags | ||
run: | | ||
sudo -E docker run -t --rm \ | ||
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \ | ||
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \ | ||
$KAYOBE_IMAGE \ | ||
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh \ | ||
'$KAYOBE_CONFIG_PATH/ansible/check-tags.yml' | ||
#env: | ||
#KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
# This playbook queries the Pulp server to check that all image tags specified | ||
# in kolla_image_tags are present. | ||
|
||
- name: Check whether tags exist in Pulp container registry | ||
hosts: localhost | ||
tasks: | ||
- name: Query images and tags | ||
command: | ||
cmd: >- | ||
{{ kayobe_config_path }}/../../tools/kolla-images.py list-tags | ||
register: kolla_images_result | ||
changed_when: false | ||
|
||
- name: Set a fact about images and tags | ||
set_fact: | ||
kolla_images: "{{ kolla_images_result.stdout | from_yaml }}" | ||
|
||
- name: Set a fact about the Pulp URL | ||
set_fact: | ||
pulp_url: "{{ stackhpc_repo_mirror_url }}" | ||
|
||
# Use state=read and allow_missing=false to check for missing tags in test pulp. | ||
- import_role: | ||
name: stackhpc.pulp.pulp_container_content | ||
vars: | ||
pulp_container_content: >- | ||
{%- set contents = [] -%} | ||
{%- for image, tags in kolla_images.items() -%} | ||
{%- set repository = kolla_docker_namespace ~ "/" ~ image -%} | ||
{%- set content = { | ||
"allow_missing": False, | ||
"repository": repository, | ||
"state": "read", | ||
"tags": tags, | ||
} -%} | ||
{%- set _ = contents.append(content) -%} | ||
{%- endfor -%} | ||
{{ contents }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters