Skip to content

Commit cc310a5

Browse files
committed
[CI] Publish images to quay.io on a daily basis
Based on the discussions from the past 3 Kolla meetings [1][2][3], we established that, to avoid the DockerHub pull limit issues in our CI, we will try using quay.io. We still publish weekly to the DockerHub. Cherry-picks in Victoria and below include the switch to Docker module for Ansible. [1] http://eavesdrop.openstack.org/meetings/kolla/2021/kolla.2021-03-17-15.00.log.html#l-102 [2] http://eavesdrop.openstack.org/meetings/kolla/2021/kolla.2021-03-24-15.00.log.html#l-137 [3] http://eavesdrop.openstack.org/meetings/kolla/2021/kolla.2021-03-31-15.01.log.html#l-50 Change-Id: I7c1f0c5fc643678b29f963b6769d8f900a03b726
1 parent 302f4a9 commit cc310a5

File tree

6 files changed

+196
-27
lines changed

6 files changed

+196
-27
lines changed

.zuul.d/base.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,32 @@
2525
Oz6nUZlML6sEyT0vilbDpo1RRweinE5J8mU+8joxeDpCHXBUYekFmgXDlpg58XmSp96fM
2626
C/rWcxTKlGJjjlVFZfhRHHy6gWBYH/SoozkbpkWbk0g43SLSxAuITy7nqLggOU=
2727

28+
- secret:
29+
name: kolla_quay_io_creds
30+
data:
31+
username: !encrypted/pkcs1-oaep
32+
- VsvMvV5wOUfl5B2HJboWfN8mta/Tuk7PXcJf5RfKk4uXP6qYGM4dcMB9EdoJNhMCi7FeA
33+
NrTZaxf/AjLAkgKlRhz7sPKhmR95+jrFRgEzedpcCamdPkCa+wNQEMNMd0rTwioYUEWm4
34+
Y+Oa2mIswy5LcUViz38MPQhf0725U5sYtH2qkuhMbU8u8vzYhSk749xtAN6I1T8ziTKKB
35+
3FBowFc2rSRJUQPsLLZjTxBHbrk+00p/DPoHLOz9/9Jf5U//jkqx4ziE2w1a4+x/kWlYT
36+
BPXuRL9wWN9ci2uKuoDRRd6QHJzPIJerKG07YU4PAcS3M245rbjjUQC3n3SQJs3u4kKI8
37+
rZrxfbmtbfjkzRQXnhnhPk47Pebp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53+
2854
- nodeset:
2955
name: kolla-centos8
3056
nodes:

.zuul.d/centos.yaml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@
1616
- kolla-build-centos8-source
1717
- kolla-ansible-centos8-source
1818
- kolla-ansible-centos8-source-upgrade
19+
periodic:
20+
jobs:
21+
- kolla-publish-centos8-source-quay
22+
- kolla-publish-centos8-binary-quay
1923
periodic-weekly:
2024
jobs:
21-
- kolla-publish-centos8-source
22-
- kolla-publish-centos8-binary
25+
- kolla-publish-centos8-source-dockerhub
26+
- kolla-publish-centos8-binary-dockerhub
2327
release:
2428
jobs:
25-
- kolla-publish-centos8-source
26-
- kolla-publish-centos8-binary
29+
- kolla-publish-centos8-source-dockerhub
30+
- kolla-publish-centos8-binary-dockerhub
2731
experimental:
2832
jobs:
2933
- kolla-build-no-infra-wheels-centos8-source
@@ -63,14 +67,27 @@
6367
install_type: binary
6468

6569
- job:
66-
name: kolla-publish-centos8-binary
70+
name: kolla-publish-centos8-binary-dockerhub
6771
parent: kolla-build-centos8-binary
6872
post-run: tests/playbooks/publish.yml
6973
vars:
7074
publisher: true
75+
kolla_registry: dockerhub
76+
kolla_namespace: kolla
7177
secrets:
7278
- kolla_dockerhub_creds
7379

80+
- job:
81+
name: kolla-publish-centos8-binary-quay
82+
parent: kolla-build-centos8-binary
83+
post-run: tests/playbooks/publish.yml
84+
vars:
85+
publisher: true
86+
kolla_registry: quay.io
87+
kolla_namespace: openstack.kolla
88+
secrets:
89+
- kolla_quay_io_creds
90+
7491
- job:
7592
name: kolla-build-centos8-source
7693
parent: kolla-base
@@ -86,14 +103,27 @@
86103
voting: false
87104

88105
- job:
89-
name: kolla-publish-centos8-source
106+
name: kolla-publish-centos8-source-dockerhub
90107
parent: kolla-build-centos8-source
91108
post-run: tests/playbooks/publish.yml
92109
vars:
93110
publisher: true
111+
kolla_registry: dockerhub
112+
kolla_namespace: kolla
94113
secrets:
95114
- kolla_dockerhub_creds
96115

116+
- job:
117+
name: kolla-publish-centos8-source-quay
118+
parent: kolla-build-centos8-source
119+
post-run: tests/playbooks/publish.yml
120+
vars:
121+
publisher: true
122+
kolla_registry: quay.io
123+
kolla_namespace: openstack.kolla
124+
secrets:
125+
- kolla_quay_io_creds
126+
97127
- job:
98128
name: kolla-build-no-infra-wheels-centos8-source
99129
parent: kolla-build-no-infra-wheels-base

.zuul.d/debian.yaml

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@
99
jobs:
1010
- kolla-build-debian-source-aarch64
1111
- kolla-ansible-debian-source-aarch64
12+
periodic:
13+
jobs:
14+
- kolla-publish-debian-source-quay
15+
- kolla-publish-debian-source-aarch64-quay
1216
periodic-weekly:
1317
jobs:
14-
- kolla-publish-debian-source
15-
- kolla-publish-debian-source-aarch64
18+
- kolla-publish-debian-source-dockerhub
19+
- kolla-publish-debian-source-aarch64-dockerhub
1620
release:
1721
jobs:
18-
- kolla-publish-debian-source
19-
- kolla-publish-debian-source-aarch64
20-
- kolla-publish-debian-binary
22+
- kolla-publish-debian-source-dockerhub
23+
- kolla-publish-debian-source-aarch64-dockerhub
24+
- kolla-publish-debian-binary-dockerhub
2125
experimental:
2226
jobs:
2327
- kolla-build-no-infra-wheels-debian-source
@@ -46,27 +50,70 @@
4650
install_type: binary
4751

4852
- job:
49-
name: kolla-publish-debian-binary
53+
name: kolla-publish-debian-binary-dockerhub
5054
parent: kolla-build-debian-binary
5155
post-run: tests/playbooks/publish.yml
5256
vars:
5357
publisher: true
58+
kolla_registry: dockerhub
59+
kolla_namespace: kolla
5460
secrets:
5561
- kolla_dockerhub_creds
5662

5763
- job:
58-
name: kolla-publish-debian-source
64+
name: kolla-publish-debian-binary-quay
65+
parent: kolla-build-debian-binary
66+
post-run: tests/playbooks/publish.yml
67+
vars:
68+
publisher: true
69+
kolla_registry: quay.io
70+
kolla_namespace: openstack.kolla
71+
secrets:
72+
- kolla_quay_io_creds
73+
74+
- job:
75+
name: kolla-publish-debian-source-dockerhub
5976
parent: kolla-build-debian-source
6077
post-run: tests/playbooks/publish.yml
6178
vars:
6279
publisher: true
80+
kolla_registry: dockerhub
81+
kolla_namespace: kolla
6382
secrets:
6483
- kolla_dockerhub_creds
6584

6685
- job:
67-
name: kolla-publish-debian-source-aarch64
68-
parent: kolla-publish-debian-source
69-
nodeset: kolla-debian-buster-aarch64
86+
name: kolla-publish-debian-source-quay
87+
parent: kolla-build-debian-source
88+
post-run: tests/playbooks/publish.yml
89+
vars:
90+
publisher: true
91+
kolla_registry: quay.io
92+
kolla_namespace: openstack.kolla
93+
secrets:
94+
- kolla_quay_io_creds
95+
96+
- job:
97+
name: kolla-publish-debian-source-aarch64-dockerhub
98+
parent: kolla-build-debian-source-aarch64
99+
post-run: tests/playbooks/publish.yml
100+
vars:
101+
publisher: true
102+
kolla_registry: dockerhub
103+
kolla_namespace: kolla
104+
secrets:
105+
- kolla_dockerhub_creds
106+
107+
- job:
108+
name: kolla-publish-debian-source-aarch64-quay
109+
parent: kolla-build-debian-source-aarch64
110+
post-run: tests/playbooks/publish.yml
111+
vars:
112+
publisher: true
113+
kolla_registry: quay.io
114+
kolla_namespace: openstack.kolla
115+
secrets:
116+
- kolla_quay_io_creds
70117

71118
- job:
72119
name: kolla-build-no-infra-wheels-debian-source

.zuul.d/ubuntu.yaml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@
2626
- kolla-ansible-ubuntu-source-upgrade:
2727
vars:
2828
kolla_python_version: 3.8
29+
periodic:
30+
jobs:
31+
- kolla-publish-ubuntu-source-quay
32+
- kolla-publish-ubuntu-binary-quay
2933
periodic-weekly:
3034
jobs:
31-
- kolla-publish-ubuntu-source
32-
- kolla-publish-ubuntu-binary
35+
- kolla-publish-ubuntu-source-dockerhub
36+
- kolla-publish-ubuntu-binary-dockerhub
3337
release:
3438
jobs:
35-
- kolla-publish-ubuntu-source
36-
- kolla-publish-ubuntu-binary
39+
- kolla-publish-ubuntu-source-dockerhub
40+
- kolla-publish-ubuntu-binary-dockerhub
3741
experimental:
3842
jobs:
3943
- kolla-build-no-infra-wheels-ubuntu-source
@@ -93,14 +97,27 @@
9397
install_type: binary
9498

9599
- job:
96-
name: kolla-publish-ubuntu-binary
100+
name: kolla-publish-ubuntu-binary-dockerhub
97101
parent: kolla-build-ubuntu-binary
98102
post-run: tests/playbooks/publish.yml
99103
vars:
100104
publisher: true
105+
kolla_registry: dockerhub
106+
kolla_namespace: kolla
101107
secrets:
102108
- kolla_dockerhub_creds
103109

110+
- job:
111+
name: kolla-publish-ubuntu-binary-quay
112+
parent: kolla-build-ubuntu-binary
113+
post-run: tests/playbooks/publish.yml
114+
vars:
115+
publisher: true
116+
kolla_registry: quay.io
117+
kolla_namespace: openstack.kolla
118+
secrets:
119+
- kolla_quay_io_creds
120+
104121
- job:
105122
name: kolla-build-ubuntu-source
106123
parent: kolla-base
@@ -116,14 +133,27 @@
116133
voting: false
117134

118135
- job:
119-
name: kolla-publish-ubuntu-source
136+
name: kolla-publish-ubuntu-source-dockerhub
120137
parent: kolla-build-ubuntu-source
121138
post-run: tests/playbooks/publish.yml
122139
vars:
123140
publisher: true
141+
kolla_registry: dockerhub
142+
kolla_namespace: kolla
124143
secrets:
125144
- kolla_dockerhub_creds
126145

146+
- job:
147+
name: kolla-publish-ubuntu-source-quay
148+
parent: kolla-build-ubuntu-source
149+
post-run: tests/playbooks/publish.yml
150+
vars:
151+
publisher: true
152+
kolla_registry: quay.io
153+
kolla_namespace: openstack.kolla
154+
secrets:
155+
- kolla_quay_io_creds
156+
127157
- job:
128158
name: kolla-build-no-infra-wheels-ubuntu-source
129159
parent: kolla-build-no-infra-wheels-base

tests/playbooks/publish.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,44 @@
11
---
22
- hosts: all
33
tasks:
4-
- name: Login to Dockerhub
5-
command: "docker login -u {{ kolla_dockerhub_creds.user }} -p {{ kolla_dockerhub_creds.password }}"
6-
no_log: true
4+
- name: Ensure docker python SDK is installed
5+
become: true
6+
pip:
7+
name: "docker"
8+
state: present
79

8-
- shell: "for img in $(docker images --format '{% raw %}{{ .Repository }}:{{ .Tag }}{% endraw %}' | grep kolla ); do docker push $img; done"
10+
- name: List all containers
11+
docker_host_info:
12+
images: yes
13+
images_filters:
14+
reference: "{{ kolla_namespace }}/*"
15+
register: docker_host_info
16+
17+
- block:
18+
- name: Login to Dockerhub
19+
docker_login:
20+
username: "{{ kolla_dockerhub_creds.user | trim }}"
21+
password: "{{ kolla_dockerhub_creds.password | trim }}"
22+
23+
- name: Push built container images
24+
docker_image:
25+
name: "{{ item.RepoTags.0 }}"
26+
push: yes
27+
loop: "{{ docker_host_info.images }}"
28+
when: kolla_registry == 'dockerhub'
29+
30+
- block:
31+
- name: Login to quay.io
32+
docker_login:
33+
registry: quay.io
34+
username: "{{ kolla_quay_io_creds.username | trim }}"
35+
password: "{{ kolla_quay_io_creds.password | trim }}"
36+
37+
- name: Push built container images
38+
docker_image:
39+
name: "{{ item.RepoTags.0 }}"
40+
push: yes
41+
repository: "quay.io/{{ item.RepoTags.0 }}"
42+
source: local
43+
loop: "{{ docker_host_info.images }}"
44+
when: kolla_registry == 'quay.io'

tests/playbooks/run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
vars:
2727
kolla_publisher_config:
2828
DEFAULT:
29-
namespace: kolla
29+
namespace: "{{ kolla_namespace }}"
3030
tag: "{{ (zuul.tag if zuul.pipeline == 'release' else zuul.branch | basename) ~ tag_suffix }}"
3131
set_fact:
3232
kolla_build_config: "{{ kolla_build_config | combine(kolla_publisher_config, recursive=True) }}"

0 commit comments

Comments
 (0)