Maas images build and publish updates
- Add support for Ubuntu Jammy and Focal in Docker image builds - Update Makefile to handle image processing - Enhance Docker image build playbook with debug information - git-mirror job fixes Change-Id: Iec507da43c0354318bbed56c0e3fa34a0cd6b883 Signed-off-by: Sergiy Markin <smarkin@mirantis.com>
This commit is contained in:
27
.zuul.yaml
27
.zuul.yaml
@@ -17,14 +17,16 @@
|
||||
- airship-maas-lint-ws
|
||||
- airship-maas-chart-build-gate
|
||||
- airship-maas-chart-build-latest-htk
|
||||
- airship-maas-docker-build-gate
|
||||
- airship-maas-docker-build-gate-ubuntu-focal
|
||||
- airship-maas-docker-build-gate-ubuntu-jammy
|
||||
- airship-maas-lint-yaml
|
||||
- airship-maas-deploy-kubeadm
|
||||
gate:
|
||||
jobs:
|
||||
- airship-maas-lint-ws
|
||||
- airship-maas-chart-build-gate
|
||||
- airship-maas-docker-build-gate
|
||||
- airship-maas-docker-build-gate-ubuntu-focal
|
||||
- airship-maas-docker-build-gate-ubuntu-jammy
|
||||
- airship-maas-lint-yaml
|
||||
- airship-maas-deploy-kubeadm
|
||||
post:
|
||||
@@ -72,7 +74,7 @@
|
||||
HTK_COMMIT: master
|
||||
|
||||
- job:
|
||||
name: airship-maas-docker-build-gate
|
||||
name: airship-maas-docker-build-gate-ubuntu-jammy
|
||||
timeout: 3600
|
||||
run: tools/gate/playbooks/docker-image-build.yaml
|
||||
nodeset: airship-maas-single-node-jammy
|
||||
@@ -80,10 +82,26 @@
|
||||
- "^images/.*"
|
||||
vars:
|
||||
publish: false
|
||||
distro: ubuntu_jammy
|
||||
tags:
|
||||
dynamic:
|
||||
patch_set: true
|
||||
|
||||
- job:
|
||||
name: airship-maas-docker-build-gate-ubuntu-focal
|
||||
timeout: 3600
|
||||
run: tools/gate/playbooks/docker-image-build.yaml
|
||||
nodeset: airship-maas-single-node-jammy
|
||||
files:
|
||||
- "^images/.*"
|
||||
vars:
|
||||
publish: false
|
||||
distro: ubuntu_focal
|
||||
tags:
|
||||
dynamic:
|
||||
patch_set: true
|
||||
|
||||
|
||||
- job:
|
||||
name: airship-maas-lint-yaml
|
||||
voting: true
|
||||
@@ -104,6 +122,7 @@
|
||||
- "^images/.*"
|
||||
vars:
|
||||
publish: true
|
||||
distro: ubuntu_focal
|
||||
tags:
|
||||
dynamic:
|
||||
branch: true
|
||||
@@ -111,6 +130,7 @@
|
||||
static:
|
||||
- latest
|
||||
|
||||
|
||||
- job:
|
||||
name: airship-maas-deploy-base
|
||||
description: |
|
||||
@@ -185,6 +205,7 @@
|
||||
- job:
|
||||
name: maas-upload-git-mirror
|
||||
parent: upload-git-mirror
|
||||
nodeset: treasuremap-airskiff-1node-ubuntu_jammy
|
||||
description: Mirrors airship/maas to airshipit/maas
|
||||
vars:
|
||||
git_mirror_repository: airshipit/maas
|
||||
|
38
Makefile
38
Makefile
@@ -26,29 +26,31 @@ PUSH_IMAGE ?= false
|
||||
# use this variable for image labels added in internal build process
|
||||
LABEL ?= org.airshipit.build=community
|
||||
COMMIT ?= $(shell git rev-parse HEAD)
|
||||
IMAGE_NAME := maas-rack-controller-jammy maas-region-controller-jammy sstream-cache-jammy
|
||||
DISTRO ?= ubuntu_jammy
|
||||
STRIPPED_DISTRO := $(shell echo $(DISTRO) | sed 's/^ubuntu_//')
|
||||
IMAGE_NAME := maas-rack-controller-$(STRIPPED_DISTRO) maas-region-controller-$(STRIPPED_DISTRO) sstream-cache-$(STRIPPED_DISTRO)
|
||||
BUILD_DIR := $(shell mktemp -d)
|
||||
HELM := $(BUILD_DIR)/helm
|
||||
SSTREAM_IMAGE := "https://images.maas.io/ephemeral-v3/stable/"
|
||||
SSTREAM_RELEASE := "jammy"
|
||||
UBUNTU_BASE_IMAGE ?= quay.io/airshipit/ubuntu:jammy
|
||||
SSTREAM_RELEASE := $(STRIPPED_DISTRO)
|
||||
UBUNTU_BASE_IMAGE ?= quay.io/airshipit/ubuntu:$(STRIPPED_DISTRO)
|
||||
USE_CACHED_IMG ?= false
|
||||
DOCKER_EXTRA_ARGS ?=
|
||||
|
||||
ifeq ($(USE_CACHED_IMG), true)
|
||||
DOCKER_EXTRA_ARGS += --build-arg BUILDKIT_INLINE_CACHE=1
|
||||
DOCKER_EXTRA_ARGS += --build-arg BUILDKIT_INLINE_CACHE=1
|
||||
else
|
||||
DOCKER_EXTRA_ARGS += --pull --no-cache --build-arg BUILDKIT_INLINE_CACHE=0
|
||||
DOCKER_EXTRA_ARGS += --pull --no-cache --build-arg BUILDKIT_INLINE_CACHE=0
|
||||
endif
|
||||
|
||||
ifeq ($(USE_PROXY), true)
|
||||
DOCKER_EXTRA_ARGS += --build-arg "http_proxy=$(PROXY)" --build-arg "https_proxy=$(PROXY)"
|
||||
DOCKER_EXTRA_ARGS += --build-arg "HTTP_PROXY=$(PROXY)" --build-arg "HTTPS_PROXY=$(PROXY)"
|
||||
DOCKER_EXTRA_ARGS += --build-arg "no_proxy=$(NO_PROXY)" --build-arg "NO_PROXY=$(NO_PROXY)"
|
||||
DOCKER_EXTRA_ARGS += --build-arg "http_proxy=$(PROXY)" --build-arg "https_proxy=$(PROXY)"
|
||||
DOCKER_EXTRA_ARGS += --build-arg "HTTP_PROXY=$(PROXY)" --build-arg "HTTPS_PROXY=$(PROXY)"
|
||||
DOCKER_EXTRA_ARGS += --build-arg "no_proxy=$(NO_PROXY)" --build-arg "NO_PROXY=$(NO_PROXY)"
|
||||
endif
|
||||
|
||||
.PHONY: images
|
||||
#Build all images in the list
|
||||
# Build all images in the list
|
||||
images: $(IMAGE_NAME)
|
||||
|
||||
$(IMAGE_NAME):
|
||||
@@ -81,15 +83,15 @@ helm-install:
|
||||
.PHONY: build
|
||||
build:
|
||||
docker build -t $(IMAGE) --label $(LABEL) --network=host \
|
||||
--label "org.opencontainers.image.revision=$(COMMIT)" \
|
||||
--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
|
||||
--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
|
||||
-f $(IMAGE_DIR)/Dockerfile \
|
||||
$(DOCKER_EXTRA_ARGS) \
|
||||
--build-arg FROM=$(UBUNTU_BASE_IMAGE) \
|
||||
--build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) \
|
||||
--build-arg SSTREAM_RELEASE=$(SSTREAM_RELEASE) \
|
||||
$(IMAGE_DIR)
|
||||
--label "org.opencontainers.image.revision=$(COMMIT)" \
|
||||
--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
|
||||
--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
|
||||
-f $(IMAGE_DIR)/Dockerfile \
|
||||
$(DOCKER_EXTRA_ARGS) \
|
||||
--build-arg FROM=$(UBUNTU_BASE_IMAGE) \
|
||||
--build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) \
|
||||
--build-arg SSTREAM_RELEASE=$(SSTREAM_RELEASE) \
|
||||
$(IMAGE_DIR)
|
||||
ifeq ($(PUSH_IMAGE), true)
|
||||
docker push $(IMAGE)
|
||||
endif
|
||||
|
@@ -46,7 +46,8 @@ RUN apt-get -qq update \
|
||||
&& add-apt-repository -yu ppa:maas/3.0 \
|
||||
&& apt-get install -y \
|
||||
maas-rack-controller=$MAAS_VERSION \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf /var/lib/apt/lists/*\
|
||||
&& rm -f /etc/ssl/private/snakeoil.*
|
||||
|
||||
# Preserve the directory structure, permissions, and contents of /var/lib/maas
|
||||
RUN mkdir -p /opt/maas/ && tar -cvzf /opt/maas/var-lib-maas.tgz /var/lib/maas
|
||||
|
@@ -47,7 +47,8 @@ RUN apt-get -qq update \
|
||||
&& add-apt-repository -yu ppa:maas/$MAAS_VERSION \
|
||||
&& apt-get install -y \
|
||||
maas-rack-controller \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf /var/lib/apt/lists/*\
|
||||
&& rm -f /etc/ssl/private/snakeoil.*
|
||||
|
||||
# Preserve the directory structure, permissions, and contents of /var/lib/maas
|
||||
RUN mkdir -p /opt/maas/ && tar -cvzf /opt/maas/var-lib-maas.tgz /var/lib/maas
|
||||
|
@@ -46,7 +46,8 @@ RUN apt-get -qq update \
|
||||
maas-region-api=$MAAS_VERSION \
|
||||
# tcpdump is required by /usr/lib/maas/beacon-monitor
|
||||
tcpdump \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -f /etc/ssl/private/snakeoil.*
|
||||
|
||||
# Preserve the directory structure, permissions, and contents of /var/lib/maas
|
||||
RUN mkdir -p /opt/maas/ && tar -cvzf /opt/maas/var-lib-maas.tgz /var/lib/maas
|
||||
|
@@ -48,7 +48,8 @@ RUN apt-get -qq update \
|
||||
maas-region-api \
|
||||
# tcpdump is required by /usr/lib/maas/beacon-monitor
|
||||
tcpdump \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf /var/lib/apt/lists/*\
|
||||
&& rm -f /etc/ssl/private/snakeoil.*
|
||||
|
||||
# Preserve the directory structure, permissions, and contents of /var/lib/maas
|
||||
RUN mkdir -p /opt/maas/ && tar -cvzf /opt/maas/var-lib-maas.tgz /var/lib/maas
|
||||
|
49
images/sstream-cache-focal/Dockerfile
Normal file
49
images/sstream-cache-focal/Dockerfile
Normal file
@@ -0,0 +1,49 @@
|
||||
ARG FROM=quay.io/airshipit/ubuntu:focal
|
||||
FROM ${FROM}
|
||||
|
||||
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode'
|
||||
LABEL org.opencontainers.image.url='https://airshipit.org'
|
||||
LABEL org.opencontainers.image.documentation='https://github.com/openstack/airship-maas'
|
||||
LABEL org.opencontainers.image.source='https://git.openstack.org/openstack/airship-maas'
|
||||
LABEL org.opencontainers.image.vendor='The Airship Authors'
|
||||
LABEL org.opencontainers.image.licenses='Apache-2.0'
|
||||
|
||||
ARG HTTP_PROXY
|
||||
ARG HTTPS_PROXY
|
||||
ARG NO_PROXY
|
||||
ARG http_proxy
|
||||
ARG https_proxy
|
||||
ARG no_proxy
|
||||
|
||||
ARG SSTREAM_IMAGE=https://images.maas.io/ephemeral-v3/stable/
|
||||
ARG SSTREAM_RELEASE=bionic
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get -qq update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
apache2 \
|
||||
file \
|
||||
gpgv \
|
||||
python3-certifi \
|
||||
simplestreams \
|
||||
ubuntu-cloudimage-keyring
|
||||
|
||||
RUN sstream-mirror --keyring=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg ${SSTREAM_IMAGE} \
|
||||
/var/www/html/maas/images/ephemeral-v3/daily 'arch=amd64' "release~${SSTREAM_RELEASE}" --max=1 --progress
|
||||
|
||||
RUN sstream-mirror --keyring=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg ${SSTREAM_IMAGE} \
|
||||
/var/www/html/maas/images/ephemeral-v3/daily 'os~(grub*|pxelinux)' --max=1 --progress
|
||||
|
||||
RUN sh -c 'echo "" > /etc/apache2/ports.conf'
|
||||
|
||||
ENV APACHE_RUN_USER=www-data
|
||||
ENV APACHE_RUN_GROUP=www-data
|
||||
ENV APACHE_PID_FILE=/var/run/apache2.pid
|
||||
ENV APACHE_RUN_DIR=/var/run/
|
||||
ENV APACHE_LOCK_DIR=/var/lock
|
||||
ENV APACHE_LOG_DIR=/var/log/
|
||||
ENV LANG=C
|
||||
|
||||
ENTRYPOINT ["/usr/sbin/apache2"]
|
||||
CMD ["-E", "/dev/stderr","-c","ErrorLog /dev/stderr","-c","Listen 8888","-c","ServerRoot /etc/apache2","-c","DocumentRoot /var/www/html","-D","FOREGROUND"]
|
@@ -1,4 +1,4 @@
|
||||
ARG FROM=public.ecr.aws/docker/library/ubuntu:bionic
|
||||
ARG FROM=ubuntu:bionic
|
||||
FROM ${FROM}
|
||||
|
||||
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode'
|
||||
|
@@ -26,6 +26,8 @@
|
||||
block:
|
||||
- debug:
|
||||
var: publish
|
||||
- debug:
|
||||
var: distro
|
||||
- debug:
|
||||
var: tags
|
||||
- debug:
|
||||
@@ -68,6 +70,7 @@
|
||||
target: images
|
||||
params:
|
||||
IMAGE_TAG: "{{ item }}"
|
||||
DISTRO: "{{ distro }}"
|
||||
with_items: "{{ image_tags.stdout_lines }}"
|
||||
|
||||
- shell: "docker images"
|
||||
@@ -81,8 +84,8 @@
|
||||
- name: Publish images
|
||||
block:
|
||||
- docker_login:
|
||||
username: "{{ airship_armada_quay_creds.username }}"
|
||||
password: "{{ airship_armada_quay_creds.password }}"
|
||||
username: "{{ airship_maas_quay_creds.username }}"
|
||||
password: "{{ airship_maas_quay_creds.password }}"
|
||||
registry_url: "https://quay.io/api/v1/"
|
||||
api_version: "1.43"
|
||||
|
||||
@@ -93,6 +96,7 @@
|
||||
DOCKER_REGISTRY: "quay.io"
|
||||
IMAGE_PREFIX: "airshipit"
|
||||
IMAGE_TAG: "{{ item }}"
|
||||
DISTRO: "{{ distro }}"
|
||||
COMMIT: "{{ zuul.newrev | default('') }}"
|
||||
PUSH_IMAGE: "true"
|
||||
with_items: "{{ image_tags.stdout_lines }}"
|
||||
|
Reference in New Issue
Block a user