From 08a807e188f3437af00cd29517366d9f487ac5f8 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 19 Mar 2020 13:03:22 -0500 Subject: [PATCH] Add a uwsgi-base container image For things using the builder/base pattern providing uwsgi services. Change-Id: Iaf6d31a3d119f6b7e87b54cda1969a9994110dad --- .zuul.yaml | 104 +++++++++++++++++++++++++++++++++++ docker/uwsgi-base/Dockerfile | 29 ++++++++++ docker/uwsgi-base/bindep.txt | 5 ++ 3 files changed, 138 insertions(+) create mode 100644 docker/uwsgi-base/Dockerfile create mode 100644 docker/uwsgi-base/bindep.txt diff --git a/.zuul.yaml b/.zuul.yaml index 6878767a3e..2ca0176cde 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -771,6 +771,104 @@ vars: *python-base-3_8_vars files: *python-base-3_8_files +# uwsgi-base-3.7 jobs +- job: + name: system-config-build-image-uwsgi-base-3.7 + description: Build a uwsgi-base-3.7 image. + parent: system-config-build-image + requires: &uwsgi-base_3_7_requires + - python-base-3.7-container-image + - python-builder-3.7-container-image + provides: uwsgi-base-3.7-container-image + dependencies: + - name: system-config-build-image-python-base-3.7 + soft: true + - name: system-config-build-image-python-builder-3.7 + soft: true + vars: &uwsgi-base_3_7_vars + docker_images: + - context: docker/uwsgi-base + repository: opendevorg/uwsgi-base + tags: + - 3.7 + - latest + build_args: + - PYTHON_VERSION=3.7 + files: &uwsgi-base_3_7_files + - docker/python-base/.* + - docker/python-builder/.* + - docker/uwsgi-base/.* + +- job: + name: system-config-upload-image-uwsgi-base-3.7 + description: Build and upload a uwsgi-base-3.7 image. + parent: system-config-upload-image + provides: uwsgi-base-3.7-container-image + requires: *uwsgi-base_3_7_requires + dependencies: + - name: system-config-upload-image-python-base-3.7 + soft: true + - name: system-config-upload-image-python-builder-3.7 + soft: true + vars: *uwsgi-base_3_7_vars + files: *uwsgi-base_3_7_files + +- job: + name: system-config-promote-image-uwsgi-base-3.7 + description: Promote a previously published uwsgi-base-3.7 image to latest. + parent: system-config-promote-image + vars: *uwsgi-base_3_7_vars + files: *uwsgi-base_3_7_files + +# uwsgi-base-3.8 jobs +- job: + name: system-config-build-image-uwsgi-base-3.8 + description: Build a uwsgi-base-3.8 image. + parent: system-config-build-image + provides: uwsgi-base-3.8-container-image + requires: &uwsgi-base_3_8_requires + - python-base-3.8-container-image + - python-builder-3.8-container-image + dependencies: + - name: system-config-build-image-python-base-3.8 + soft: true + - name: system-config-build-image-python-builder-3.8 + soft: true + vars: &uwsgi-base_3_8_vars + docker_images: + - context: docker/uwsgi-base + repository: opendevorg/uwsgi-base + tags: + - 3.8 + build_args: + - PYTHON_VERSION=3.8 + files: &uwsgi-base_3_8_files + - docker/python-base/.* + - docker/python-builder/.* + - docker/uwsgi-base/.* + +- job: + name: system-config-upload-image-uwsgi-base-3.8 + description: Build and upload a uwsgi-base-3.8 image. + parent: system-config-upload-image + provides: uwsgi-base-3.8-container-image + requires: *uwsgi-base_3_8_requires + dependencies: + - name: system-config-upload-image-python-base-3.8 + soft: true + - name: system-config-upload-image-python-builder-3.8 + soft: true + vars: *uwsgi-base_3_8_vars + files: *uwsgi-base_3_8_files + +- job: + name: system-config-promote-image-uwsgi-base-3.8 + description: Promote a previously published uwsgi-base-3.8 image to latest. + parent: system-config-promote-image + vars: *uwsgi-base_3_8_vars + files: *uwsgi-base_3_8_files + + # gerrit-base jobs - job: name: system-config-build-image-gerrit-base @@ -2535,6 +2633,8 @@ - system-config-build-image-python-base-3.8 - system-config-build-image-python-builder-3.7 - system-config-build-image-python-builder-3.8 + - system-config-build-image-uwsgi-base-3.7 + - system-config-build-image-uwsgi-base-3.8 check-arm64: jobs: - system-config-run-mirror-arm64 @@ -2599,6 +2699,8 @@ - system-config-upload-image-python-base-3.8 - system-config-upload-image-python-builder-3.7 - system-config-upload-image-python-builder-3.8 + - system-config-upload-image-uwsgi-base-3.7 + - system-config-upload-image-uwsgi-base-3.8 promote: jobs: - opendev-promote-docs @@ -2614,6 +2716,8 @@ - system-config-promote-image-python-base-3.8 - system-config-promote-image-python-builder-3.7 - system-config-promote-image-python-builder-3.8 + - system-config-promote-image-uwsgi-base-3.7 + - system-config-promote-image-uwsgi-base-3.8 - infra-prod-install-ansible - infra-prod-base - infra-prod-service-letsencrypt diff --git a/docker/uwsgi-base/Dockerfile b/docker/uwsgi-base/Dockerfile new file mode 100644 index 0000000000..b4de8bf45d --- /dev/null +++ b/docker/uwsgi-base/Dockerfile @@ -0,0 +1,29 @@ +# Copyright (c) 2020 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ARG PYTHON_VERSION=3.7 +FROM docker.io/opendevorg/python-builder:${PYTHON_VERSION} as builder + +COPY . /tmp/src +RUN assemble uWSGI + +FROM docker.io/opendevorg/python-base:${PYTHON_VERSION} + +COPY --from=builder /output/ /output +RUN /output/install-from-bindep + +ENV UWSGI_MASTER=1 UWSGI_UID=nobody UWSGI_GID=nogroup + +CMD ["/usr/local/bin/uwsgi"] diff --git a/docker/uwsgi-base/bindep.txt b/docker/uwsgi-base/bindep.txt new file mode 100644 index 0000000000..670f7d05a7 --- /dev/null +++ b/docker/uwsgi-base/bindep.txt @@ -0,0 +1,5 @@ +gcc [compile] +libc6-dev [compile] +libffi-dev [compile platform:dpkg] +libffi6 [platform:dpkg] +libssl-dev [compile platform:dpkg]