Publish LOCI images

Currently the OpenStack images are not published on dockerhub in
openstackhelm namespace.

This makes use of the standard openstack infra roles as much as
we can, to build and promote images.

The only thing that differs is the creation of the requirements
image, which needs to be available before building
the other images. For this, we:
1) Build the requirements container using infra role.
2) Build and run our own docker webserver container, extracting
   the wheels from the requirements container.

Depends-On: https://review.openstack.org/640711/

Change-Id: I16fc6e989f1c412d458270195c6aff8343524c48
This commit is contained in:
Jean-Philippe Evrard 2019-03-11 12:17:07 +01:00
parent cbb56663eb
commit ef258c97fb
8 changed files with 501 additions and 196 deletions

View File

@ -16,89 +16,477 @@
- project:
check:
jobs:
- openstack-helm-images-openstack-loci-newton-ubuntu_xenial:
voting: false
- openstack-helm-images-openstack-loci-ocata-ubuntu_xenial
- openstack-helm-images-openstack-loci-pike-ubuntu_xenial
- openstack-helm-images-openstack-loci-queens-suse_15
- openstack-helm-images-openstack-loci-queens-ubuntu_xenial
- openstack-helm-images-build-openstack-loci-master-ubuntu_xenial
- openstack-helm-images-build-openstack-loci-newton-ubuntu_xenial
- openstack-helm-images-build-openstack-loci-ocata-ubuntu_xenial
- openstack-helm-images-build-openstack-loci-pike-ubuntu_xenial
- openstack-helm-images-build-openstack-loci-queens-ubuntu_xenial
- openstack-helm-images-build-openstack-loci-rocky-ubuntu_xenial
gate:
jobs:
- openstack-helm-images-openstack-loci-ocata-ubuntu_xenial
- openstack-helm-images-openstack-loci-pike-ubuntu_xenial
- openstack-helm-images-openstack-loci-queens-suse_15
- openstack-helm-images-openstack-loci-queens-ubuntu_xenial
periodic:
- openstack-helm-images-upload-openstack-loci-master-ubuntu_xenial
- openstack-helm-images-upload-openstack-loci-newton-ubuntu_xenial
- openstack-helm-images-upload-openstack-loci-ocata-ubuntu_xenial
- openstack-helm-images-upload-openstack-loci-pike-ubuntu_xenial
- openstack-helm-images-upload-openstack-loci-queens-ubuntu_xenial
- openstack-helm-images-upload-openstack-loci-rocky-ubuntu_xenial
promote:
jobs:
- openstack-helm-images-openstack-loci-ocata-ubuntu_xenial
- openstack-helm-images-openstack-loci-pike-ubuntu_xenial
- openstack-helm-images-openstack-loci-queens-suse_15
- openstack-helm-images-openstack-loci-queens-ubuntu_xenial
- openstack-helm-images-promote-openstack-loci-master-ubuntu_xenial
- openstack-helm-images-promote-openstack-loci-newton-ubuntu_xenial
- openstack-helm-images-promote-openstack-loci-ocata-ubuntu_xenial
- openstack-helm-images-promote-openstack-loci-pike-ubuntu_xenial
- openstack-helm-images-promote-openstack-loci-queens-ubuntu_xenial
- openstack-helm-images-promote-openstack-loci-rocky-ubuntu_xenial
- job:
name: openstack-helm-images-openstack-loci
parent: base
abstract: true
vars:
use_tmpfs: False
name: openstack-helm-images-build-openstack-loci-master-ubuntu_xenial
# Inherits secrets and vars
parent: openstack-helm-images-build
description: Build master LOCI images for xenial
# Increase timeout due to many images to build
timeout: 5400
# This enables depends-on to work by using local repos
required-projects:
- name: openstack/loci
pre-run:
- zuul.d/playbooks/pre-run.yml
- zuul.d/playbooks/pre-loci-build.yml
run: zuul.d/playbooks/loci-build.yml
timeout: 3600
- openstack/loci
# Fork of standard playbook to build prep images first (reusing
# role) with a different zuul_role_dir, publish wheels on http server.
# zuul_work_dir: "src/git.openstack.org/openstack/loci"
run: zuul.d/playbooks/build-loci.yml
vars: &build_master_xenial_images
branchname: "master"
shortbranchname: "master"
distroname: "ubuntu_xenial"
from: "gcr.io/google_containers/ubuntu-slim:0.14"
python3: "no"
#172.17.0.1 is default docker0 ip.
wheels_location: "http://172.17.0.1:8080/wheels.tar.gz"
prep_docker_images: &prep_images
- context: "."
repository: openstackhelm/requirements
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='requirements'"
- "PROJECT_REF={{ branchname }}"
docker_images: &project_images
- context: "."
repository: openstackhelm/keystone
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='keystone'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent apache ldap {{ shortbranchname }}'"
- "PIP_PACKAGES='python-openstackclient'"
- "WHEELS='{{ wheels_location }}'"
tags: &imagetag
- "{{ shortbranchname }}-{{ distroname }}"
- context: "."
repository: openstackhelm/heat
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='heat'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent apache'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/barbican
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='barbican'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/glance
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='glance'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent ceph'"
- "PIP_PACKAGES='python-swiftclient'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/cinder
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='cinder'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent lvm ceph qemu'"
- "PIP_PACKAGES='python-swiftclient'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/neutron
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='neutron'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent linuxbridge openvswitch'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/neutron
build_args:
- "FROM=docker.io/ubuntu:18.04"
- "PYTHON3={{ python3 }}"
- "PROJECT='neutron'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent neutron linuxbridge openvswitch'"
- "DIST_PACKAGES='ethtool lshw'"
- "WHEELS='{{ wheels_location }}'"
tags:
- "{{ shortbranchname }}-18.04-sriov"
- context: "."
repository: openstackhelm/nova
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='nova'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent ceph linuxbridge openvswitch configdrive qemu apache'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/horizon
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='horizon'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent apache'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/senlin
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='senlin'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/congress
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='congress'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent'"
- "PIP_PACKAGES='python-congressclient'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/magnum
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='magnum'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/ironic
build_args:
- "FROM='{{ from }}'"
- "PYTHON3={{ python3 }}"
- "PROJECT='ironic'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='fluent ipxe ipmi qemu tftp'"
- "DIST_PACKAGES='ethtool lshw iproute2'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
files: &loci-files
- ^openstack/loci/.*
- zuul.d/openstack-loci.yaml
# The upload in openstack-helm-images-upload happens as post-run,
# so we can inherit from this. The post run is not caring about context,
# only repository, and tags.
- job:
name: openstack-helm-images-openstack-loci-newton
parent: openstack-helm-images-openstack-loci
abstract: true
vars:
build_command: './build-newton.sh'
name: openstack-helm-images-upload-openstack-loci-master-ubuntu_xenial
description: Build and upload master LOCI images for xenial
# Inherits secrets and vars
parent: openstack-helm-images-upload
# Increase timeout due to many images to build
timeout: 5400
# This enables depends-on to work by using local repos
required-projects:
- openstack/loci
run: zuul.d/playbooks/build-loci.yml
vars: *build_master_xenial_images
files: *loci-files
# Promote is a run job. Let's not change it.
- job:
name: openstack-helm-images-promote-openstack-loci-master-ubuntu_xenial
parent: openstack-helm-images-promote
description: Promote previously published loci xenial master images
vars: *build_master_xenial_images
files: *loci-files
- job:
name: openstack-helm-images-openstack-loci-ocata
parent: openstack-helm-images-openstack-loci
abstract: true
vars:
build_command: './build-ocata.sh'
name: openstack-helm-images-build-openstack-loci-rocky-ubuntu_xenial
parent: openstack-helm-images-build-openstack-loci-master-ubuntu_xenial
description: Build rocky LOCI images for xenial
vars: &build_rocky_xenial_images
<<: *build_master_xenial_images
branchname: "stable/rocky"
shortbranchname: "rocky"
- job:
name: openstack-helm-images-openstack-loci-pike
parent: openstack-helm-images-openstack-loci
abstract: true
vars:
build_command: './build-pike.sh'
name: openstack-helm-images-upload-openstack-loci-rocky-ubuntu_xenial
parent: openstack-helm-images-upload-openstack-loci-master-ubuntu_xenial
description: Build and upload rocky LOCI images for xenial
vars: *build_rocky_xenial_images
- job:
name: openstack-helm-images-openstack-loci-queens
parent: openstack-helm-images-openstack-loci
abstract: true
vars:
build_command: './build-queens.sh'
name: openstack-helm-images-promote-openstack-loci-rocky-ubuntu_xenial
parent: openstack-helm-images-promote-openstack-loci-master-ubuntu_xenial
description: Promote previously published loci xenial rocky images
vars: *build_rocky_xenial_images
# Queens
- job:
name: openstack-helm-images-build-openstack-loci-queens-ubuntu_xenial
parent: openstack-helm-images-build-openstack-loci-master-ubuntu_xenial
description: Build queens LOCI images for xenial
vars: &build_queens_xenial_images
<<: *build_master_xenial_images
branchname: "stable/queens"
shortbranchname: "queens"
- job:
name: openstack-helm-images-openstack-loci-newton-ubuntu_xenial
parent: openstack-helm-images-openstack-loci-newton
name: openstack-helm-images-upload-openstack-loci-queens-ubuntu_xenial
parent: openstack-helm-images-upload-openstack-loci-master-ubuntu_xenial
description: Build and upload queens LOCI images for xenial
vars: *build_queens_xenial_images
- job:
name: openstack-helm-images-openstack-loci-ocata-ubuntu_xenial
parent: openstack-helm-images-openstack-loci-ocata
name: openstack-helm-images-promote-openstack-loci-queens-ubuntu_xenial
parent: openstack-helm-images-promote-openstack-loci-master-ubuntu_xenial
description: Promote a previously published loci xenial queens images
vars: *build_queens_xenial_images
# Pike
- job:
name: openstack-helm-images-build-openstack-loci-pike-ubuntu_xenial
parent: openstack-helm-images-build-openstack-loci-master-ubuntu_xenial
description: Build pike LOCI images for xenial
vars: &build_pike_xenial_images
<<: *build_master_xenial_images
branchname: "stable/pike"
shortbranchname: "pike"
- job:
name: openstack-helm-images-openstack-loci-pike-ubuntu_xenial
parent: openstack-helm-images-openstack-loci-pike
name: openstack-helm-images-upload-openstack-loci-pike-ubuntu_xenial
parent: openstack-helm-images-upload-openstack-loci-master-ubuntu_xenial
description: Build and upload pike LOCI images for xenial
vars: *build_pike_xenial_images
- job:
name: openstack-helm-images-openstack-loci-queens-suse_15
parent: openstack-helm-images-openstack-loci-queens
vars:
build_environment:
BASE_IMAGE: leap15
name: openstack-helm-images-promote-openstack-loci-pike-ubuntu_xenial
parent: openstack-helm-images-promote-openstack-loci-master-ubuntu_xenial
description: Promote a previously published loci xenial pike images
vars: *build_pike_xenial_images
# Ocata
- job:
name: openstack-helm-images-build-openstack-loci-ocata-ubuntu_xenial
parent: openstack-helm-images-build-openstack-loci-master-ubuntu_xenial
description: Build ocata LOCI images for xenial
vars: &build_ocata_xenial_images
<<: *build_master_xenial_images
branchname: "stable/ocata"
shortbranchname: "ocata"
- job:
name: openstack-helm-images-openstack-loci-queens-ubuntu_xenial
parent: openstack-helm-images-openstack-loci-queens
name: openstack-helm-images-upload-openstack-loci-ocata-ubuntu_xenial
parent: openstack-helm-images-upload-openstack-loci-master-ubuntu_xenial
description: Build and upload ocata LOCI images for xenial
vars: *build_ocata_xenial_images
- job:
name: openstack-helm-images-promote-openstack-loci-ocata-ubuntu_xenial
parent: openstack-helm-images-promote-openstack-loci-master-ubuntu_xenial
description: Promote a previously published loci xenial ocata images
vars: *build_ocata_xenial_images
# Newton
- job:
name: openstack-helm-images-build-openstack-loci-newton-ubuntu_xenial
parent: openstack-helm-images-build-openstack-loci-master-ubuntu_xenial
description: Build newton LOCI images for xenial
vars: &build_newton_xenial_images
branchname: "newton-eol"
shortbranchname: "newton"
distroname: "ubuntu_xenial"
wheels_location: "http://172.17.0.1:8080/wheels.tar.gz"
from: "gcr.io/google_containers/ubuntu-slim:0.14"
prep_docker_images:
- context: "."
repository: openstackhelm/requirements
build_args:
- "FROM='{{ from }}'"
- "PROJECT='requirements'"
- "PROJECT_REF='stable/newton'"
docker_images:
- context: "."
repository: openstackhelm/keystone
build_args:
- "FROM='{{ from }}'"
- "PROJECT='keystone'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='apache ldap'"
- "PIP_PACKAGES='pycrypto python-openstackclient'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/heat
build_args:
- "FROM='{{ from }}'"
- "PROJECT='heat'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='apache'"
- "PIP_PACKAGES='pycrypto'"
- "DIST_PACKAGES='curl'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/barbican
build_args:
- "FROM='{{ from }}'"
- "PROJECT='barbican'"
- "PROJECT_REF={{ branchname }}"
- "PIP_PACKAGES='pycrypto'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/glance
build_args:
- "FROM='{{ from }}'"
- "PROJECT='glance'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='glance ceph'"
- "PIP_PACKAGES='pycrypto python-swiftclient'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/cinder
build_args:
- "FROM='{{ from }}'"
- "PROJECT='cinder'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='cinder lvm ceph qemu'"
- "PIP_PACKAGES='pycrypto python-swiftclient'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/neutron
build_args:
- "FROM='{{ from }}'"
- "PROJECT='neutron'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='neutron linuxbridge openvswitch'"
- "PIP_PACKAGES='pycrypto'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/neutron
build_args:
- "FROM=docker.io/ubuntu:18.04"
- "PROJECT='neutron'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='neutron linuxbridge openvswitch'"
- "PIP_PACKAGES='pycrypto'"
- "DIST_PACKAGES='ethtool lshw'"
- "WHEELS='{{ wheels_location }}'"
tags:
- "{{ shortbranchname }}-18.04-sriov"
- context: "."
repository: openstackhelm/nova
build_args:
- "FROM='{{ from }}'"
- "PROJECT='nova'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='nova ceph linuxbridge openvswitch configdrive qemu apache'"
- "PIP_PACKAGES='pycrypto'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/horizon
build_args:
- "FROM='{{ from }}'"
- "PROJECT='horizon'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='horizon apache'"
- "PIP_PACKAGES='pycrypto'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/senlin
build_args:
- "FROM='{{ from }}'"
- "PROJECT='senlin'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='senlin'"
- "PIP_PACKAGES='pycrypto'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/congress
build_args:
- "FROM='{{ from }}'"
- "PROJECT='congress'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='congress'"
- "PIP_PACKAGES='pycrypto python-congressclient'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/magnum
build_args:
- "FROM='{{ from }}'"
- "PROJECT='magnum'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='magnum'"
- "PIP_PACKAGES='pycrypto'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
- context: "."
repository: openstackhelm/ironic
build_args:
- "FROM='{{ from }}'"
- "PROJECT='ironic'"
- "PROJECT_REF={{ branchname }}"
- "PROFILES='ironic ipxe ipmi qemu tftp'"
- "PIP_PACKAGES='pycrypto'"
- "DIST_PACKAGES='iproute2'"
- "WHEELS='{{ wheels_location }}'"
tags: *imagetag
files: *loci-files
- job:
name: openstack-helm-images-upload-openstack-loci-newton-ubuntu_xenial
parent: openstack-helm-images-upload-openstack-loci-master-ubuntu_xenial
description: Build and upload newton LOCI images for xenial
vars: *build_newton_xenial_images
- job:
name: openstack-helm-images-promote-openstack-loci-newton-ubuntu_xenial
parent: openstack-helm-images-promote-openstack-loci-master-ubuntu_xenial
description: Promote a previously published loci xenial newton images
vars: *build_newton_xenial_images

View File

@ -0,0 +1,5 @@
FROM nginx:alpine
# Previously built requirements image
COPY --from=openstackhelm/requirements:latest / /usr/share/nginx/html
RUN cd /usr/share/nginx/html; tar c -f wheels.tar.gz -z *.whl *.txt; rm -f *.whl

View File

@ -0,0 +1,49 @@
---
# Copyright 2018, SUSE LINUX GmbH.
#
# 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.
- hosts: all[0]
gather_facts: true
tasks:
- name: Build base and requirements images
include_role:
name: build-docker-image
vars:
zuul_work_dir: "src/git.openstack.org/openstack/loci"
docker_images: "{{ prep_docker_images }}"
- name: Build webserver serving wheels
include_role:
name: build-docker-image
vars:
zuul_work_dir: "{{ zuul.project.src_dir }}"
docker_images:
- context: zuul.d/playbooks/
repository: openstackhelm/loci_wheels
- name: Allow access to wheels server
iptables:
action: insert
chain: INPUT
in_interface: docker0
jump: ACCEPT
become: yes
- name: Run http server containing wheels
command: docker run -d -p 0.0.0.0:8080:80 openstackhelm/loci_wheels:latest
- name: Build project images
include_role:
name: build-docker-image
vars:
zuul_work_dir: "src/git.openstack.org/openstack/loci"

View File

@ -1,16 +0,0 @@
---
# This play will only get consumed in osh-images.
# For depends-on to osh-images and osh changes triggering a rebuild of
# osh-infra or osh, this play won't be used, as we won't know what to build, and
# therefore will build everything for a 'standard' distribution.
# No need to change zuul.project.src_dir to static paths then.
- hosts: all[0]
tasks:
- name: Build image
docker_image:
buildargs: "{{ buildargs | default(omit) }}"
state: present
path: "{{ zuul.project.src_dir }}/{{ image_path }}"
dockerfile: "Dockerfile.{{ distro }}"
name: "openstackhelm/{{ image_path }}"
tag: "{{ version | default('latest') }}-{{ distro }}"

View File

@ -1,17 +0,0 @@
---
# This play will only get consumed in osh-images.
# For depends-on to osh-images and osh changes triggering a rebuild of
# osh-infra or osh, this play won't be used, as we won't know what to build, and
# therefore will build everything for a 'standard' distribution.
# No need to change zuul.project.src_dir to static paths then.
- hosts: all[0]
vars:
default_environment:
LOCI_SRC_DIR: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/loci"
tasks:
- name: Build image
shell: "{{ build_command | default('./build.sh') }}"
args:
chdir: "{{ zuul.project.src_dir }}/openstack/loci/"
executable: /bin/bash
environment: "{{ (build_environment | default({})) | combine(default_environment) }}"

View File

@ -1,47 +0,0 @@
---
- hosts: all[0]
vars:
dockerconf_path: "/etc/docker/daemon.json"
dockerconf_extra_config:
debug: True
insecure-registries:
- 172.17.0.1:5000
become: true
tasks:
# LOCI needs a local registry -- Add docker insecure mode
# First two tasks can be removed when the feature is added
# in upstream role: https://review.openstack.org/#/c/624484/3
- name: Get docker configuration
slurp:
src: "{{ dockerconf_path }}"
register: dockerconf
- name: Add insecure registries into dockerconf
copy:
content: "{{ ( ((dockerconf.content | b64decode) | from_json) | combine(dockerconf_extra_config) )| to_json }}"
dest: "{{ dockerconf_path }}"
- name: Ensure docker service is restarted
service:
name: docker.service
state: restarted
- name: Run docker registry
docker_container:
name: registry
image: registry:2
state: started
published_ports:
- 5000:5000
- name: Allow connections from containers to registry
iptables:
action: insert
chain: INPUT
in_interface: docker0
jump: ACCEPT
- name: Ensure parallel is installed
package:
name: parallel
state: present

View File

@ -1,32 +0,0 @@
---
- hosts: all[0]
pre_tasks:
- name: Create docker folder
file:
path: /var/lib/docker
state: directory
become: True
- name: Mount tmpfs to build faster
mount:
path: /var/lib/docker/
src: tmpfs
fstype: tmpfs
opts: size=25g
state: mounted
become: True
when: (use_tmpfs | default(True)) | bool
roles:
- role: install-docker
post_tasks:
- name: Install extra docker libraries for ansible
become: True
package:
name:
- python3-docker
- python-docker
state: present
- name: Ensure docker service is started
become: true
service:
name: docker.service
state: started

View File

@ -1,25 +0,0 @@
---
- hosts: all[0]
tasks:
#TODO(evrardjp): Add quay.io support when we have the appropriate credentials.
#See also: https://review.openstack.org/#/c/624713/7/zuul.d/playbooks/publish.yml
- name: Login to Docker Hub
command: docker login -u {{ openstack_helm_images_publish_credentials.dockerhub_user }} -p {{ openstack_helm_images_publish_credentials.dockerhub_password }}
no_log: True
- name: List unique images of this build, in the format "registry:tag id"
shell: docker images | awk '/openstackhelm/ {print $1 ":" $2 " " $3}' | uniq -f 1
changed_when: false
register: detailed_image_list
- name: Show found images
debug:
var: detailed_image_list.stdout_lines
- name: Tag all images for publication to DockerHub
shell: "docker tag {{ item.split(' ')[1] }} {{ item.split(' ')[0] | regex_replace('^.*openstackhelm/(.*)$', 'openstackhelm/\\1') }}"
loop: "{{ detailed_image_list.stdout_lines }}"
- name: Push images to Docker Hub
command: "docker push {{ item.split(' ')[0] | regex_replace('^.*openstackhelm/(.*)$', 'openstackhelm/\\1') }}"
loop: "{{ detailed_image_list.stdout_lines }}"