Commit 0ba90a02 authored by Benjamin Tissoires's avatar Benjamin Tissoires
Browse files

Remove BOOTSTRAP_TAG and QEMU_TAG variables



Convert the bootstrap.yml file to be templated, and we can now drop
these 2 variables. This way, it's even clearer what is run.
Signed-off-by: Benjamin Tissoires's avatarBenjamin Tissoires <benjamin.tissoires@gmail.com>
parent 3a06265c
......@@ -66,10 +66,6 @@ include:
- local: '/templates/ubuntu.yml'
- local: '/.gitlab-ci/ubuntu-ci.yml'
variables:
BOOTSTRAP_TAG: '2020-03-24'
QEMU_TAG: '2020-03-24'
stages:
- sanity check
......
......@@ -28,7 +28,7 @@
extends:
- .fdo.container-build@alpine
- .ci-commons-alpine
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
stage: alpine_container_build
......@@ -36,7 +36,7 @@
extends:
- .fdo.container-build@alpine@arm64v8
- .ci-commons-alpine
image: $CI_REGISTRY_IMAGE/arm64v8/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/arm64v8/buildah:2020-03-24
stage: alpine_container_build
needs:
- bootstrap@arm64v8
......@@ -187,7 +187,7 @@ do not rebuild alpine:latest@container-build:
check labels alpine:latest:
extends:
- alpine:latest@check
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
script:
# FDO_DISTRIBUTION_IMAGE still has indirections
- DISTRO_IMAGE=$(eval echo ${FDO_DISTRIBUTION_IMAGE})
......
......@@ -28,7 +28,7 @@
extends:
- .fdo.container-build@arch
- .ci-commons-arch
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
stage: arch_container_build
......@@ -159,7 +159,7 @@ do not rebuild arch:rolling@container-build:
check labels arch:rolling:
extends:
- arch:rolling@check
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
script:
# FDO_DISTRIBUTION_IMAGE still has indirections
- DISTRO_IMAGE=$(eval echo ${FDO_DISTRIBUTION_IMAGE})
......
......@@ -29,7 +29,7 @@
extends:
- .fdo.container-build@centos
- .ci-commons-centos
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
stage: centos_container_build
......@@ -160,7 +160,7 @@ do not rebuild centos:7@container-build:
check labels centos:7:
extends:
- centos:7@check
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
script:
# FDO_DISTRIBUTION_IMAGE still has indirections
- DISTRO_IMAGE=$(eval echo ${FDO_DISTRIBUTION_IMAGE})
......
......@@ -29,7 +29,7 @@
extends:
- .fdo.container-build@debian
- .ci-commons-debian
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
stage: debian_container_build
......@@ -37,7 +37,7 @@
extends:
- .fdo.container-build@debian@arm64v8
- .ci-commons-debian
image: $CI_REGISTRY_IMAGE/arm64v8/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/arm64v8/buildah:2020-03-24
stage: debian_container_build
needs:
- bootstrap@arm64v8
......@@ -51,7 +51,7 @@
extends:
- .fdo.qemu-build@debian
- .ci-commons-debian
image: $CI_REGISTRY_IMAGE/qemu-mkosi-base:$QEMU_TAG
image: $CI_REGISTRY_IMAGE/qemu-mkosi-base:2020-03-24
stage: debian_container_build
artifacts:
name: logs-$CI_PIPELINE_ID
......@@ -225,7 +225,7 @@ debian:stretch@qemu-build:
variables:
FDO_DISTRIBUTION_TAG: fdo-ci-qemu-$CI_PIPELINE_ID
FDO_DISTRIBUTION_PACKAGES: 'wget curl'
QEMU_BASE_IMAGE: $CI_REGISTRY_IMAGE/qemu-base:$QEMU_TAG
QEMU_BASE_IMAGE: $CI_REGISTRY_IMAGE/qemu-base:2020-03-24
debian:stretch@qemu-check:
......@@ -258,7 +258,7 @@ do not rebuild debian:stretch@container-build:
check labels debian:stretch:
extends:
- debian:stretch@check
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
script:
# FDO_DISTRIBUTION_IMAGE still has indirections
- DISTRO_IMAGE=$(eval echo ${FDO_DISTRIBUTION_IMAGE})
......
......@@ -29,7 +29,7 @@
extends:
- .fdo.container-build@fedora
- .ci-commons-fedora
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
stage: fedora_container_build
......@@ -37,7 +37,7 @@
extends:
- .fdo.container-build@fedora@arm64v8
- .ci-commons-fedora
image: $CI_REGISTRY_IMAGE/arm64v8/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/arm64v8/buildah:2020-03-24
stage: fedora_container_build
needs:
- bootstrap@arm64v8
......@@ -51,7 +51,7 @@
extends:
- .fdo.qemu-build@fedora
- .ci-commons-fedora
image: $CI_REGISTRY_IMAGE/qemu-mkosi-base:$QEMU_TAG
image: $CI_REGISTRY_IMAGE/qemu-mkosi-base:2020-03-24
stage: fedora_container_build
artifacts:
name: logs-$CI_PIPELINE_ID
......@@ -225,7 +225,7 @@ fedora:31@qemu-build:
variables:
FDO_DISTRIBUTION_TAG: fdo-ci-qemu-$CI_PIPELINE_ID
FDO_DISTRIBUTION_PACKAGES: 'wget curl'
QEMU_BASE_IMAGE: $CI_REGISTRY_IMAGE/qemu-base:$QEMU_TAG
QEMU_BASE_IMAGE: $CI_REGISTRY_IMAGE/qemu-base:2020-03-24
fedora:31@qemu-check:
......@@ -258,7 +258,7 @@ do not rebuild fedora:31@container-build:
check labels fedora:31:
extends:
- fedora:31@check
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
script:
# FDO_DISTRIBUTION_IMAGE still has indirections
- DISTRO_IMAGE=$(eval echo ${FDO_DISTRIBUTION_IMAGE})
......
......@@ -29,7 +29,7 @@
extends:
- .fdo.container-build@ubuntu
- .ci-commons-ubuntu
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
stage: ubuntu_container_build
......@@ -37,7 +37,7 @@
extends:
- .fdo.container-build@ubuntu@arm64v8
- .ci-commons-ubuntu
image: $CI_REGISTRY_IMAGE/arm64v8/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/arm64v8/buildah:2020-03-24
stage: ubuntu_container_build
needs:
- bootstrap@arm64v8
......@@ -51,7 +51,7 @@
extends:
- .fdo.qemu-build@ubuntu
- .ci-commons-ubuntu
image: $CI_REGISTRY_IMAGE/qemu-mkosi-base:$QEMU_TAG
image: $CI_REGISTRY_IMAGE/qemu-mkosi-base:2020-03-24
stage: ubuntu_container_build
artifacts:
name: logs-$CI_PIPELINE_ID
......@@ -225,7 +225,7 @@ ubuntu:19.10@qemu-build:
variables:
FDO_DISTRIBUTION_TAG: fdo-ci-qemu-$CI_PIPELINE_ID
FDO_DISTRIBUTION_PACKAGES: 'wget curl'
QEMU_BASE_IMAGE: $CI_REGISTRY_IMAGE/qemu-base:$QEMU_TAG
QEMU_BASE_IMAGE: $CI_REGISTRY_IMAGE/qemu-base:2020-03-24
ubuntu:19.10@qemu-check:
......@@ -258,7 +258,7 @@ do not rebuild ubuntu:19.10@container-build:
check labels ubuntu:19.10:
extends:
- ubuntu:19.10@check
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
script:
# FDO_DISTRIBUTION_IMAGE still has indirections
- DISTRO_IMAGE=$(eval echo ${FDO_DISTRIBUTION_IMAGE})
......
......@@ -19,16 +19,13 @@
variables:
FDO_UPSTREAM_REPO: freedesktop/ci-templates
FDO_DISTRIBUTION_VERSION: '31'
FDO_DISTRIBUTION_TAG: $BOOTSTRAP_TAG
FDO_DISTRIBUTION_TAG: '2020-03-24'
# we need a minimalist image capable of buildah, podman, skopeo, curl,
# jq, date and test. We used to rely on `bootstrap/bootstrap.sh`, but
# a commit in runc prevented it to be compiled against musl. So we just
# end up building a regular container image from arch.
#
# To avoid rebuilding this image at every run, and to give better control,
# BOOTSTRAP_TAG needs to be set by the caller.
.bootstrap:
extends: .bootstrap_skeleton
image: fedora:31
......@@ -50,20 +47,17 @@
# qemu container capable of running a VM to run the test suite
#
# To avoid rebuilding this image at every run, and to give better control,
# QEMU_TAG needs to be set by the caller.
#
# installed required packages (in addition to the bootstrap ones):
# - qemu (of course)
# - genisoimage (to create a cloud-init iso that will help us filling in the custom parameters)
# - usbutils (for being able to call lsusb and redirect part a USB device)
.qemu:
extends: .bootstrap_skeleton
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:2020-03-24
stage: bootstrapping_qemu
dependencies: []
variables:
FDO_DISTRIBUTION_TAG: $QEMU_TAG
FDO_DISTRIBUTION_TAG: '2020-03-24'
FDO_REPO_SUFFIX: qemu-base
FDO_DISTRIBUTION_PACKAGES: 'buildah-1.11.3-2.fc31 podman-2:1.6.2-2.fc31 skopeo jq git qemu genisoimage usbutils'
FDO_DISTRIBUTION_EXEC: 'mkdir -p /app && cp bootstrap/vmctl.sh /app/vmctl'
......@@ -76,4 +70,4 @@
- kvm
variables:
FDO_REPO_SUFFIX: qemu-mkosi-base
FDO_DISTRIBUTION_EXEC: 'mkdir -p /app && cp bootstrap/vmctl.sh /app/vmctl && bootstrap/prep_mkosi.sh'
FDO_DISTRIBUTION_EXEC: 'mkdir -p /app && cp bootstrap/vmctl.sh /app/vmctl && bootstrap/prep_mkosi.sh'
\ No newline at end of file
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
# Note, we need to include fedora.yml for building our qemu initial images
# however, the CI script already includes it, so we can not pull it here.
#
# include:
# - local: '/templates/fedora.yml'
#################################################################
# #
# bootstrapping stage #
# #
#################################################################
.bootstrap_skeleton:
extends: .fdo.container-build@fedora
stage: bootstrapping
variables:
FDO_UPSTREAM_REPO: freedesktop/ci-templates
FDO_DISTRIBUTION_VERSION: '31'
FDO_DISTRIBUTION_TAG: '{{bootstrap_tag}}'
# we need a minimalist image capable of buildah, podman, skopeo, curl,
# jq, date and test. We used to rely on `bootstrap/bootstrap.sh`, but
# a commit in runc prevented it to be compiled against musl. So we just
# end up building a regular container image from arch.
.bootstrap:
extends: .bootstrap_skeleton
image: fedora:31
before_script:
- bash bootstrap/bootstrap.sh
variables:
FDO_REPO_SUFFIX: buildah
FDO_DISTRIBUTION_EXEC: 'bash bootstrap/bootstrap.sh'
.bootstrap@arm64v8:
extends: .bootstrap
image: arm64v8/fedora:latest
tags:
- aarch64
variables:
FDO_REPO_SUFFIX: arm64v8/buildah
# qemu container capable of running a VM to run the test suite
#
# installed required packages (in addition to the bootstrap ones):
# - qemu (of course)
# - genisoimage (to create a cloud-init iso that will help us filling in the custom parameters)
# - usbutils (for being able to call lsusb and redirect part a USB device)
.qemu:
extends: .bootstrap_skeleton
image: $CI_REGISTRY_IMAGE/buildah:{{bootstrap_tag}}
stage: bootstrapping_qemu
dependencies: []
variables:
FDO_DISTRIBUTION_TAG: '{{qemu_tag}}'
FDO_REPO_SUFFIX: qemu-base
FDO_DISTRIBUTION_PACKAGES: 'buildah-1.11.3-2.fc31 podman-2:1.6.2-2.fc31 skopeo jq git qemu genisoimage usbutils'
FDO_DISTRIBUTION_EXEC: 'mkdir -p /app && cp bootstrap/vmctl.sh /app/vmctl'
# qemu container capable of creating an other VM image
#
.qemu-mkosi:
extends: .qemu
tags:
- kvm
variables:
FDO_REPO_SUFFIX: qemu-mkosi-base
FDO_DISTRIBUTION_EXEC: 'mkdir -p /app && cp bootstrap/vmctl.sh /app/vmctl && bootstrap/prep_mkosi.sh'
......@@ -92,6 +92,13 @@ if __name__ == '__main__':
with open(dest_ci, 'w') as out_stream:
template_ci.stream(config).dump(out_stream)
# genereate the bootstrap file
template_bootstrap = env.get_template('bootstrap.tmpl')
dest = f'bootstrap/bootstrap.yml'
print(f'generating {dest}')
with open(dest, 'w') as out_stream:
template_bootstrap.stream(globs).dump(out_stream)
# finally, regenerate the .gitlab-ci.yml
template_general_ci = env.get_template('gitlab-ci.tmpl')
......
......@@ -18,10 +18,6 @@ include:
- local: '/.gitlab-ci/{{distribution}}-ci.yml'
{% endfor %}
variables:
BOOTSTRAP_TAG: '{{bootstrap_tag}}'
QEMU_TAG: '{{qemu_tag}}'
stages:
- sanity check
......
......@@ -31,7 +31,7 @@
extends:
- .fdo.container-build@{{distribution}}
- .ci-commons-{{distribution}}
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:{{bootstrap_tag}}
stage: {{distribution}}_container_build
{% if aarch64 %}
......@@ -40,7 +40,7 @@
extends:
- .fdo.container-build@{{distribution}}@arm64v8
- .ci-commons-{{distribution}}
image: $CI_REGISTRY_IMAGE/arm64v8/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/arm64v8/buildah:{{bootstrap_tag}}
stage: {{distribution}}_container_build
needs:
- bootstrap@arm64v8
......@@ -56,7 +56,7 @@
extends:
- .fdo.qemu-build@{{distribution}}
- .ci-commons-{{distribution}}
image: $CI_REGISTRY_IMAGE/qemu-mkosi-base:$QEMU_TAG
image: $CI_REGISTRY_IMAGE/qemu-mkosi-base:{{qemu_tag}}
stage: {{distribution}}_container_build
artifacts:
name: logs-$CI_PIPELINE_ID
......@@ -238,7 +238,7 @@
variables:
FDO_DISTRIBUTION_TAG: fdo-ci-qemu-$CI_PIPELINE_ID
FDO_DISTRIBUTION_PACKAGES: 'wget curl'
QEMU_BASE_IMAGE: $CI_REGISTRY_IMAGE/qemu-base:$QEMU_TAG
QEMU_BASE_IMAGE: $CI_REGISTRY_IMAGE/qemu-base:{{qemu_tag}}
{{distribution}}:{{versions[0]}}@qemu-check:
......@@ -272,7 +272,7 @@ do not rebuild {{distribution}}:{{versions[0]}}@container-build:
check labels {{distribution}}:{{versions[0]}}:
extends:
- {{distribution}}:{{versions[0]}}@check
image: $CI_REGISTRY_IMAGE/buildah:$BOOTSTRAP_TAG
image: $CI_REGISTRY_IMAGE/buildah:{{bootstrap_tag}}
script:
# FDO_DISTRIBUTION_IMAGE still has indirections
- DISTRO_IMAGE=$(eval echo ${FDO_DISTRIBUTION_IMAGE})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment