Skip to content

Commit 02a1cdc

Browse files
committed
Publish containers in Ark after merging relevant changes to main
This should speed up the container promotion process by avoiding container repository & distribution setup tasks.
1 parent 2332b01 commit 02a1cdc

File tree

3 files changed

+81
-17
lines changed

3 files changed

+81
-17
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: Publish container repositories
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- '.github/workflows/container-publish.yml'
8+
- 'ansible/dev-pulp-container-publish.yml'
9+
- 'ansible/inventory/group_vars/all/dev-pulp-containers'
10+
- 'ansible/inventory/group_vars/all/kolla'
11+
workflow_dispatch:
12+
inputs:
13+
filter:
14+
description: Space-separated list of regular expressions matching images to publish
15+
type: string
16+
required: false
17+
default: ""
18+
distros:
19+
description: Space-separated list of base distributions to publish
20+
type: string
21+
required: false
22+
default: ""
23+
24+
env:
25+
ANSIBLE_FORCE_COLOR: True
26+
ANSIBLE_VAULT_PASSWORD_FILE: ${{ github.workspace }}/vault-pass
27+
jobs:
28+
container-publish:
29+
name: Publish container repositories
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- name: Preparing Vault password file
35+
run: |
36+
echo "$ANSIBLE_VAULT_PASSWORD" > "$ANSIBLE_VAULT_PASSWORD_FILE"
37+
env:
38+
ANSIBLE_VAULT_PASSWORD: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
39+
40+
- name: Installing dependencies
41+
run: |
42+
sudo apt update &&
43+
sudo apt install -y python3-venv &&
44+
python3 -m venv venv &&
45+
source venv/bin/activate &&
46+
pip install -U pip &&
47+
pip install -r requirements.txt &&
48+
ansible-galaxy collection install -r requirements.yml -p ansible/collections
49+
50+
- name: Publish container repositories
51+
run: |
52+
source venv/bin/activate &&
53+
ansible-playbook -i ansible/inventory \
54+
ansible/dev-pulp-container-publish.yml \
55+
-e kolla_container_image_filter="'$FILTER'" \
56+
-e kolla_base_distros_override="'$DISTROS'"
57+
env:
58+
FILTER: ${{ github.event.inputs.filter }}
59+
DISTROS: ${{ github.event.inputs.distros }}

ansible/dev-pulp-container-promote.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,6 @@
1818
- debug:
1919
msg: "Promoting tag {{ dev_pulp_repository_container_promotion_tag }}"
2020

21-
- import_role:
22-
name: stackhpc.pulp.pulp_repository
23-
vars:
24-
pulp_url: "{{ dev_pulp_url }}"
25-
pulp_username: "{{ dev_pulp_username }}"
26-
pulp_password: "{{ dev_pulp_password }}"
27-
pulp_repository_container_repos: "{{ dev_pulp_repository_container_repos_release }}"
28-
29-
- import_role:
30-
name: stackhpc.pulp.pulp_distribution
31-
vars:
32-
pulp_url: "{{ dev_pulp_url }}"
33-
pulp_username: "{{ dev_pulp_username }}"
34-
pulp_password: "{{ dev_pulp_password }}"
35-
pulp_distribution_container: "{{ dev_pulp_distribution_container_release }}"
36-
3721
# Copy tags from stackhpc-dev to stackhpc repositories.
3822
- import_role:
3923
name: stackhpc.pulp.pulp_container_content

ansible/dev-pulp-container-publish.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# Repositories in the stackhpc-dev namespace are container push repositories,
33
# and are therefore automatically published following a push. This playbook
44
# configures the associated distributions, in particular setting the private
5-
# flag and applying a content guard.
5+
# flag and applying a content guard. It also creates Pulp repositories and
6+
# distributions for the stackhpc namespace.
67

78
- name: Configure development Pulp container distributions
89
hosts: localhost
@@ -15,3 +16,23 @@
1516
pulp_username: "{{ dev_pulp_username }}"
1617
pulp_password: "{{ dev_pulp_password }}"
1718
pulp_distribution_container: "{{ dev_pulp_distribution_container_development }}"
19+
20+
- name: Configure release Pulp container repositories and distributions
21+
hosts: localhost
22+
gather_facts: false
23+
tasks:
24+
- import_role:
25+
name: stackhpc.pulp.pulp_repository
26+
vars:
27+
pulp_url: "{{ dev_pulp_url }}"
28+
pulp_username: "{{ dev_pulp_username }}"
29+
pulp_password: "{{ dev_pulp_password }}"
30+
pulp_repository_container_repos: "{{ dev_pulp_repository_container_repos_release }}"
31+
32+
- import_role:
33+
name: stackhpc.pulp.pulp_distribution
34+
vars:
35+
pulp_url: "{{ dev_pulp_url }}"
36+
pulp_username: "{{ dev_pulp_username }}"
37+
pulp_password: "{{ dev_pulp_password }}"
38+
pulp_distribution_container: "{{ dev_pulp_distribution_container_release }}"

0 commit comments

Comments
 (0)