Browse Source

Build images with Dockerfile instead of pbrx

Use the opendevorg/python-builder image to build nodepool images
with a Dockerfile and multi-stage builds.

bindep wasn't installing gcc for dpkg. Remove the platform restrictions
for it.

Change-Id: I0282b75ffad3d0ae1b589381010a3d4273fceb07
tags/3.5.0
James E. Blair 5 months ago
parent
commit
f274c0f6bf
No account linked to committer's email address
4 changed files with 97 additions and 11 deletions
  1. 3
    0
      .dockerignore
  2. 60
    10
      .zuul.yaml
  3. 33
    0
      Dockerfile
  4. 1
    1
      bindep.txt

+ 3
- 0
.dockerignore View File

@@ -0,0 +1,3 @@
1
+.mypy_cache
2
+.stestr
3
+.tox

+ 60
- 10
.zuul.yaml View File

@@ -155,6 +155,61 @@
155 155
     required-projects:
156 156
       - openstack-infra/nodepool
157 157
 
158
+- secret:
159
+    name: nodepool-dockerhub
160
+    data:
161
+      username: zuulzuul
162
+      password: !encrypted/pkcs1-oaep
163
+        - VV5m4XbsYvAz0/7T+WoIypvD3ijRsPYrGo4O5JuOHt6TX14s9B1KddeMwnabEEKapPdbb
164
+          cwqbzFKoHRMi8DdXiDKxrgbTSC1jb3BvKq7XE0/xF4Bq2dM+r3yDnXS6a7BuijSqFSiMG
165
+          /9bf0jqEAWXWCvbYUAxKOklJIRLjcKywCP5CulmW6EV8f1Iya8Y7UGpjGyL34FVQuc52Y
166
+          5MLp+Dra95pvBJMgikbu7LtMPCXOMctUFBpwNArCjWKGhz00UZwyAmsbPPHwQWb+884ZP
167
+          v9zi2FuRAL+rn4DRVwyIw28ZdCEr5F5EkZon3lSIhikhdQIyHPtW8VwMJTL4RxBdmgcEt
168
+          +zZBbLlOU+0AHPGLlO/yQNvHeSzwY9pe2oIGuqSu3h6zp6Y0NIE/Q0VpiIXWpOAnLOmno
169
+          uOd3j9tZ1beol2mg4Yk7rOaXu1Fvtfhd1K3LpLzEbiGzCMIEZuFHU2ZInAbUmtm0BtbDa
170
+          /bYvI9dB/uqA2xgse5rVMa++v3AfWJTJhFY/wBU4fHOWlFBUZKFuSoijUcWMfnfMMyU2B
171
+          A5CQKhv4Wmtzbvo/oneYkwFOTYaPNj2DS0BcFJFkR8FZDYmTBPnKoBH5wpwwnrzPOpCMa
172
+          L21z+Vp1Vce1XCsaOduMrmZDvuQcK1YOKIIUeElAQw8GuwTfcXqekoPvp54SeE=
173
+
174
+- job:
175
+    name: nodepool-build-image
176
+    parent: build-docker-image
177
+    description: Build Docker images.
178
+    vars: &nodepool_image_vars
179
+      docker_images:
180
+        - context: .
181
+          repository: zuul/nodepool-base
182
+          target: nodepool-base
183
+        - context: .
184
+          repository: zuul/nodepool
185
+          target: nodepool
186
+        - context: .
187
+          repository: zuul/nodepool-launcher
188
+          target: nodepool-launcher
189
+        - context: .
190
+          repository: zuul/nodepool-builder
191
+          target: nodepool-builder
192
+
193
+- job:
194
+    name: nodepool-upload-image
195
+    parent: upload-docker-image
196
+    description: Build Docker images and upload to Docker Hub.
197
+    vars: *nodepool_image_vars
198
+    secrets:
199
+      - name: docker_credentials
200
+        secret: nodepool-dockerhub
201
+        pass-to-parent: true
202
+
203
+- job:
204
+    name: nodepool-promote-image
205
+    parent: promote-docker-image
206
+    description: Promote previously uploaded Docker images.
207
+    vars: *nodepool_image_vars
208
+    secrets:
209
+      - name: docker_credentials
210
+        secret: nodepool-dockerhub
211
+        pass-to-parent: true
212
+
158 213
 - project:
159 214
     check:
160 215
       jobs:
@@ -171,9 +226,7 @@
171 226
             voting: false
172 227
         - nodepool-functional-k8s
173 228
         - nodepool-functional-openshift
174
-        - pbrx-build-container-images:
175
-            vars:
176
-              pbrx_prefix: zuul
229
+        - nodepool-build-image
177 230
         - zuul-quick-start
178 231
     gate:
179 232
       jobs:
@@ -182,17 +235,14 @@
182 235
         - tox-py35
183 236
         - tox-py36:
184 237
             nodeset: ubuntu-bionic
185
-        - pbrx-build-container-images:
186
-            vars:
187
-              pbrx_prefix: zuul
188 238
         - zuul-quick-start
239
+        - nodepool-upload-image
189 240
     post:
190 241
       jobs:
191 242
         - publish-zuul-docs
192
-        - openstackzuul-pbrx-push-container-images:
193
-            vars:
194
-              pbrx_prefix: zuul
195
-
243
+    promote:
244
+      jobs:
245
+        - nodepool-promote-image
196 246
     experimental:
197 247
       jobs:
198 248
         - nodepool-functional-py35-debian-src

+ 33
- 0
Dockerfile View File

@@ -0,0 +1,33 @@
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 assemble
20
+
21
+FROM opendevorg/python-base as nodepool-base
22
+
23
+COPY --from=builder /output/ /output
24
+RUN /output/install-from-bindep
25
+
26
+FROM nodepool-base as nodepool
27
+CMD ["/usr/local/bin/nodepool"]
28
+
29
+FROM nodepool-base as nodepool-launcher
30
+CMD ["/usr/local/bin/nodepool-launcher"]
31
+
32
+FROM nodepool-base as nodepool-builder
33
+CMD ["/usr/local/bin/nodepool-builder"]

+ 1
- 1
bindep.txt View File

@@ -1,7 +1,7 @@
1 1
 # This is a cross-platform list tracking distribution packages needed by tests;
2 2
 # see http://docs.openstack.org/infra/bindep/ for additional information.
3 3
 
4
-gcc [compile test platform:rpm platform:apk]
4
+gcc [compile test]
5 5
 libffi-devel [platform:rpm]
6 6
 libffi-dev [platform:dpkg]
7 7
 libffi-dev [compile test platform:apk]

Loading…
Cancel
Save