Browse Source

Merge "Build zuul containers with dockerfile not pbrx"

tags/3.6.0
Zuul 5 months ago
parent
commit
a29665f7db
5 changed files with 161 additions and 21 deletions
  1. 104
    11
      .zuul.yaml
  2. 53
    0
      Dockerfile
  3. 2
    0
      playbooks/quick-start/main.yaml
  4. 1
    10
      playbooks/quick-start/run.yaml
  5. 1
    0
      zuul/driver/bubblewrap/__init__.py

+ 104
- 11
.zuul.yaml View File

@@ -65,11 +65,109 @@
65 65
     post-run: playbooks/quick-start/post.yaml
66 66
     roles:
67 67
       - zuul: openstack-infra/zuul-jobs
68
+    vars:
69
+      docker_images:
70
+        - context: .
71
+          repository: zuul/zuul
72
+          target: zuul
73
+        - context: .
74
+          repository: zuul/zuul-executor
75
+          target: zuul-executor
76
+        - context: .
77
+          repository: zuul/zuul-fingergw
78
+          target: zuul-fingergw
79
+        - context: .
80
+          repository: zuul/zuul-merger
81
+          target: zuul-merger
82
+        - context: .
83
+          repository: zuul/zuul-scheduler
84
+          target: zuul-scheduler
85
+        - context: .
86
+          repository: zuul/zuul-web
87
+          target: zuul-web
88
+        - context: ../nodepool
89
+          repository: zuul/nodepool
90
+          target: nodepool
91
+        - context: ../nodepool
92
+          repository: zuul/nodepool-launcher
93
+          target: nodepool-launcher
94
+        - context: ../nodepool
95
+          repository: zuul/nodepool-builder
96
+          target: nodepool-builder
68 97
     required-projects:
69
-      - openstack/pbrx
70 98
       - openstack-infra/nodepool
71 99
       - openstack-infra/zuul
72 100
 
101
+# Image building jobs
102
+- secret:
103
+    name: zuul-dockerhub
104
+    data:
105
+      username: zuulzuul
106
+      password: !encrypted/pkcs1-oaep
107
+        - DFlbrDM5eUMptMGIVMXV1g455xOJLi92UYF08Z2/JlIGu3t6v052o9FKlVyj1ZmpXs5+2
108
+          JTa5jHkLTvTsYs9fCaNcQc2nmViCyWNlbOMzjB17uiZOaYFNs1sMqZcUZbGEz7Y8ds6Qq
109
+          NBXI10jWFPTah4QxUuBvUbT3vmjnUToCzexl5ZGhKgijcnROWfUsnlCdugpgoNIcPsUki
110
+          zty5FotDihnrC8n8vIomVK6EClY38ty97pLrADzFDd+Cos/OUlvi2xooUhzx8Bn020rJA
111
+          lqEU5v8LGXp5QkHx0MSDx6JY6KppJ/4p/yM+4By6l+A20zdcimxmgiNc9rMWPwDj7xsao
112
+          m7NAZWmWqOO0Xkhgt6WOfugwgt9X46sgs2+yDEfbnI5ok8uRbAB/4FWj/KdpyXwhcf+O2
113
+          wEfhxLwDbAoGONQPjb4YcZmCXtmR7Qe5t+n2jyczWXvrbaBDUQP5a+YtVNN/xhmQ7D740
114
+          POlxv7bLxJAixzqaQ3d8Rz9ZEv6zzRuhWph32UQtZ1JxSNww+EvmXm2eEi2Q2z6pT1Cx/
115
+          j2OrFyA2GL/UJOVb15VHKF6bgHPHWJtpjPFhqdcvBhVute4BWB+KPcWH+y+apHN1enK3H
116
+          tNJO9iqm34nKwSuj5ExmFw50LtwR5/9FyRuRPq/vBL+8y82v8FDmeYsBeobn5M=
117
+
118
+- job:
119
+    name: zuul-build-image
120
+    parent: build-docker-image
121
+    description: Build Docker images.
122
+    allowed-projects: openstack-infra/zuul
123
+    vars: &zuul_image_vars
124
+      docker_images:
125
+        - context: .
126
+          repository: zuul/zuul-base
127
+          target: zuul-base
128
+        - context: .
129
+          repository: zuul/zuul
130
+          target: zuul
131
+        - context: .
132
+          repository: zuul/zuul-executor
133
+          target: zuul-executor
134
+        - context: .
135
+          repository: zuul/zuul-fingergw
136
+          target: zuul-fingergw
137
+        - context: .
138
+          repository: zuul/zuul-merger
139
+          target: zuul-merger
140
+        - context: .
141
+          repository: zuul/zuul-scheduler
142
+          target: zuul-scheduler
143
+        - context: .
144
+          repository: zuul/zuul-web
145
+          target: zuul-web
146
+
147
+- job:
148
+    name: zuul-upload-image
149
+    parent: upload-docker-image
150
+    description: Build Docker images and upload to Docker Hub.
151
+    allowed-projects: openstack-infra/zuul
152
+    secrets: 
153
+      name: docker_credentials
154
+      secret: zuul-dockerhub
155
+      pass-to-parent: true
156
+    vars: *zuul_image_vars
157
+
158
+- job:
159
+    name: zuul-promote-image
160
+    parent: promote-docker-image
161
+    description: Promote previously uploaded Docker images.
162
+    allowed-projects: openstack-infra/zuul
163
+    secrets:
164
+      name: docker_credentials
165
+      secret: zuul-dockerhub
166
+      pass-to-parent: true
167
+    nodeset:
168
+      nodes: []
169
+    vars: *zuul_image_vars
170
+
73 171
 - project:
74 172
     check:
75 173
       jobs:
@@ -100,11 +198,9 @@
100 198
         - zuul-stream-functional
101 199
         - zuul-tox-remote
102 200
         - zuul-quick-start
103
-        - pbrx-build-container-images:
104
-            vars:
105
-              pbrx_prefix: zuul
106 201
         - nodepool-zuul-functional:
107 202
             voting: false
203
+        - zuul-build-image
108 204
     gate:
109 205
       jobs:
110 206
         - tox-docs
@@ -133,9 +229,7 @@
133 229
         - zuul-stream-functional
134 230
         - zuul-tox-remote
135 231
         - zuul-quick-start
136
-        - pbrx-build-container-images:
137
-            vars:
138
-              pbrx_prefix: zuul
232
+        - zuul-upload-image
139 233
     post:
140 234
       jobs:
141 235
         - publish-zuul-docs
@@ -145,10 +239,9 @@
145 239
               node_version: 8
146 240
               zuul_work_dir: "{{ zuul.project.src_dir }}/web"
147 241
               create_tarball_directory: build
148
-        - openstackzuul-pbrx-push-container-images:
149
-            vars:
150
-              pbrx_prefix: zuul
151
-
242
+    promote:
243
+      jobs:
244
+        - zuul-promote-image
152 245
     release:
153 246
       jobs:
154 247
         - release-zuul-python

+ 53
- 0
Dockerfile View File

@@ -0,0 +1,53 @@
1
+# Copyright (c) 2019 Red Hat, Inc.
2
+#
3
+# Licensed under the Apache License, Version 2.0 (the "License");
4
+# you may not use this file except in compliance with the License.
5
+# You may obtain a copy of the License at
6
+#
7
+#    http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+# Unless required by applicable law or agreed to in writing, software
10
+# distributed under the License is distributed on an "AS IS" BASIS,
11
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
+# implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+FROM opendevorg/python-builder as builder
17
+
18
+COPY . /tmp/src
19
+RUN /tmp/src/tools/install-js-tools.sh
20
+RUN assemble
21
+
22
+FROM opendevorg/python-base as zuul-base
23
+
24
+COPY --from=builder /output/ /output
25
+RUN echo "deb http://ftp.debian.org/debian stretch-backports main" >> /etc/apt/sources.list \
26
+  && apt-get update \
27
+  && apt-get install -t stretch-backports -y bubblewrap \
28
+  && apt-get clean \
29
+  && rm -rf /var/lib/apt/lists/*
30
+RUN /output/install-from-bindep \
31
+  && pip install --cache-dir=/output/wheels -r /output/zuul_base/requirements.txt \
32
+  && rm -rf /output
33
+
34
+FROM zuul-base as zuul
35
+CMD ["/usr/local/bin/zuul"]
36
+
37
+FROM zuul-base as zuul-executor
38
+COPY --from=builder /output/ /output
39
+RUN pip install --cache-dir=/output/wheels -r /output/zuul_executor/requirements.txt \
40
+  && rm -rf /output
41
+CMD ["/usr/local/bin/zuul-executor"]
42
+
43
+FROM zuul-base as zuul-fingergw
44
+CMD ["/usr/local/bin/zuul-fingergw"]
45
+
46
+FROM zuul-base as zuul-merger
47
+CMD ["/usr/local/bin/zuul-merger"]
48
+
49
+FROM zuul-base as zuul-scheduler
50
+CMD ["/usr/local/bin/zuul-scheduler"]
51
+
52
+FROM zuul-base as zuul-web
53
+CMD ["/usr/local/bin/zuul-web"]

+ 2
- 0
playbooks/quick-start/main.yaml View File

@@ -9,6 +9,8 @@
9 9
   shell:
10 10
     cmd: docker-compose up -d
11 11
     chdir: ../../doc/source/admin/examples
12
+- name: Print list of images
13
+  command: docker image ls
12 14
 - name: Wait for Gerrit to start
13 15
   wait_for:
14 16
     host: localhost

+ 1
- 10
playbooks/quick-start/run.yaml View File

@@ -5,17 +5,8 @@
5 5
   roles:
6 6
     - name: install-docker
7 7
       use_upstream_docker: false
8
+    - build-docker-image
8 9
   tasks:
9
-    - name: Install pbrx software
10
-      command: python3 -m pip install src/git.openstack.org/openstack/pbrx
11
-      become: yes
12
-    - name: Build container images
13
-      command: 'pbrx --debug build-images --prefix=zuul'
14
-      args:
15
-        chdir: '{{ zuul.projects[item].src_dir }}'
16
-      loop:
17
-        - git.openstack.org/openstack-infra/nodepool
18
-        - git.openstack.org/openstack-infra/zuul
19 10
     - name: Install docker-compose and git-review
20 11
       package:
21 12
         name:

+ 1
- 0
zuul/driver/bubblewrap/__init__.py View File

@@ -193,6 +193,7 @@ class BubblewrapDriver(Driver, WrapperInterface):
193 193
             '--ro-bind', '/lib', '/lib',
194 194
             '--ro-bind', '/bin', '/bin',
195 195
             '--ro-bind', '/sbin', '/sbin',
196
+            '--ro-bind', '/etc/ld.so.cache', '/etc/ld.so.cache',
196 197
             '--ro-bind', '/etc/resolv.conf', '/etc/resolv.conf',
197 198
             '--ro-bind', '/etc/hosts', '/etc/hosts',
198 199
             '--ro-bind', '/etc/localtime', '/etc/localtime',

Loading…
Cancel
Save