Merge "Add AArch64 publisher for Debian/source"
This commit is contained in:
commit
0fdf656427
@ -10,11 +10,15 @@
|
|||||||
- kolla-build-debian-source-aarch64
|
- kolla-build-debian-source-aarch64
|
||||||
periodic:
|
periodic:
|
||||||
jobs:
|
jobs:
|
||||||
- kolla-publish-debian-source
|
- kolla-publish-debian-source-multiarch-aarch64
|
||||||
|
- kolla-publish-debian-source-multiarch-x86_64
|
||||||
|
- kolla-publish-debian-source-multiarch
|
||||||
release:
|
release:
|
||||||
jobs:
|
jobs:
|
||||||
- kolla-publish-debian-source
|
|
||||||
- kolla-publish-debian-binary
|
- kolla-publish-debian-binary
|
||||||
|
- kolla-publish-debian-source-multiarch-aarch64
|
||||||
|
- kolla-publish-debian-source-multiarch-x86_64
|
||||||
|
- kolla-publish-debian-source-multiarch
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: kolla-build-debian-source
|
name: kolla-build-debian-source
|
||||||
@ -56,10 +60,27 @@
|
|||||||
- kolla_dockerhub_creds
|
- kolla_dockerhub_creds
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: kolla-publish-debian-source
|
name: kolla-publish-debian-source-multiarch-x86_64
|
||||||
parent: kolla-build-debian-source
|
parent: kolla-build-debian-source
|
||||||
post-run: tests/playbooks/publish.yml
|
post-run: tests/playbooks/publish.yml
|
||||||
vars:
|
vars:
|
||||||
publisher: true
|
publisher: true
|
||||||
secrets:
|
secrets:
|
||||||
- kolla_dockerhub_creds
|
- kolla_dockerhub_creds
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: kolla-publish-debian-source-multiarch-aarch64
|
||||||
|
parent: kolla-publish-debian-source-multiarch-x86_64
|
||||||
|
nodeset: kolla-debian-buster-aarch64
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: kolla-publish-debian-source-multiarch
|
||||||
|
parent: base
|
||||||
|
run: tests/playbooks/publish-multiarch.yml
|
||||||
|
vars:
|
||||||
|
publisher: true
|
||||||
|
secrets:
|
||||||
|
- kolla_dockerhub_creds
|
||||||
|
dependencies:
|
||||||
|
- kolla-publish-debian-source-multiarch-aarch64
|
||||||
|
- kolla-publish-debian-source-multiarch-x86_64
|
||||||
|
24
tests/playbooks/publish-multiarch.yml
Normal file
24
tests/playbooks/publish-multiarch.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
tasks:
|
||||||
|
- name: Login to Dockerhub
|
||||||
|
command: "docker login -u {{ kolla_dockerhub_creds.user }} -p {{ kolla_dockerhub_creds.password }}"
|
||||||
|
no_log: true
|
||||||
|
|
||||||
|
- name: Ensure ~/.docker exists
|
||||||
|
file:
|
||||||
|
path: ~/.docker
|
||||||
|
state: directory
|
||||||
|
mode: 0777
|
||||||
|
|
||||||
|
- name: Enable experimental features in Docker so we can use 'docker manifest'
|
||||||
|
copy:
|
||||||
|
content: '{ "experimental": "enabled" }'
|
||||||
|
dest: ~/.docker/config.json
|
||||||
|
|
||||||
|
- name: Define image tag
|
||||||
|
set_fact:
|
||||||
|
image_tag: zuul.branch | regex_replace('^stable/', '')
|
||||||
|
|
||||||
|
- name: Create multiarch images
|
||||||
|
command: "TAG={{ image_tag }} NAMESPACE=kolla DISTRO={{ base_distro }} TYPE={{ install_type }} tools/create-multiarch-images.sh"
|
@ -23,6 +23,7 @@ import testtools
|
|||||||
|
|
||||||
sys.path.append(
|
sys.path.append(
|
||||||
os.path.abspath(os.path.join(os.path.dirname(__file__), '../tools')))
|
os.path.abspath(os.path.join(os.path.dirname(__file__), '../tools')))
|
||||||
|
from kolla.common import config # noqa
|
||||||
from kolla.image import build # noqa
|
from kolla.image import build # noqa
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
@ -131,5 +132,7 @@ class BuildTestDebianSource(BuildTest, base.BaseTestCase):
|
|||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(BuildTestDebianSource, self).setUp()
|
super(BuildTestDebianSource, self).setUp()
|
||||||
|
tag = '%s-%s' % (config.OPENSTACK_RELEASE['debian'], os.uname()[4])
|
||||||
self.build_args.extend(["--base", "debian",
|
self.build_args.extend(["--base", "debian",
|
||||||
|
"--tag", tag,
|
||||||
"--type", "source"])
|
"--type", "source"])
|
||||||
|
32
tools/create-multiarch-images.sh
Executable file
32
tools/create-multiarch-images.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script takes aarch64 and x86_64 images from our publish jobs and makes
|
||||||
|
# multiarch containers so users of any of those architectures can pull them.
|
||||||
|
|
||||||
|
TARGET=${NAMESPACE}/${DISTRO}-${TYPE}
|
||||||
|
TMP=$(mktemp -d)
|
||||||
|
|
||||||
|
for arch in aarch64 x86_64; do
|
||||||
|
tools/build.py --base ${DISTRO} --type ${TYPE} --base-arch $arch --list-images|sed -e 's/^.* : //g'|sort >${TMP}/images-$arch
|
||||||
|
done
|
||||||
|
|
||||||
|
comm -12 ${TMP}/images-aarch64 ${TMP}/images-x86_64 >${TMP}/list-of-common-images
|
||||||
|
comm -13 ${TMP}/images-aarch64 ${TMP}/images-x86_64 >${TMP}/list-of-x86_64-only-images
|
||||||
|
comm -23 ${TMP}/images-aarch64 ${TMP}/images-x86_64 >${TMP}/list-of-aarch64-only-images
|
||||||
|
|
||||||
|
|
||||||
|
for image_name in $(cat ${TMP}/list-of-common-images); do
|
||||||
|
docker manifest create ${TARGET}-${image_name}:${TAG} ${TARGET}-${image_name}:${TAG}-aarch64 ${TARGET}-${image_name}:${TAG}-x86_64
|
||||||
|
done
|
||||||
|
|
||||||
|
for image_name in $(cat ${TMP}/list-of-x86_64-only-images); do
|
||||||
|
docker manifest create ${TARGET}-${image_name}:${TAG} ${TARGET}-${image_name}:${TAG}-x86_64
|
||||||
|
done
|
||||||
|
|
||||||
|
for image_name in $(cat ${TMP}/list-of-aarch64-only-images); do
|
||||||
|
docker manifest create ${TARGET}-${image_name}:${TAG} ${TARGET}-${image_name}:${TAG}-aarch64
|
||||||
|
done
|
||||||
|
|
||||||
|
for image_name in $(cat ${TMP}/list-of-*); do
|
||||||
|
docker manifest push ${TARGET}-${image_name}:${TAG}
|
||||||
|
done
|
Loading…
x
Reference in New Issue
Block a user