From 79f64a0bcd48f75766505a458a29524fba95928c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 27 Apr 2024 08:40:50 -0400 Subject: [PATCH 1/3] Containerfile: Make generic It's already used with `--from` in places, and this way we have a default. --- Containerfile.fedora-40 => Containerfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Containerfile.fedora-40 => Containerfile (100%) diff --git a/Containerfile.fedora-40 b/Containerfile similarity index 100% rename from Containerfile.fedora-40 rename to Containerfile From 4d53aca22ec8f504e3583fc8446affab8fb14744 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 27 Apr 2024 08:39:59 -0400 Subject: [PATCH 2/3] ci: Copy from base-images-experimental Let's see if this works. --- .gitlab-ci.yml | 139 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..20c7876 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,139 @@ +--- +default: + interruptible: true + +variables: + LATEST_VERSION: "40" + # Default this one + RUNNER: saas-linux-medium-amd64 + ARM_RUNNER: tmp-gcp-bifrost-aarch64 + ARCHES: "amd64 arm64" + BUILDAH_IMAGE: quay.io/buildah/stable:v1.34.0 + BUILDAH_ARGS: "--security-opt=label=disable --cap-add=all" + +stages: + - build + +# Code for merge requests + +.build-image-mr: + image: $BUILDAH_IMAGE + parallel: + matrix: + - VARIANT: + - full + VERSION: + - "40" + script: + - buildah bud ${BUILDAH_ARGS} --no-cache -t localhost/test ${EXTRA_ARGS} ${CONTEXT} + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH != $CI_PROJECT_PATH && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH' + stage: build + +ci-build-image-arm64: + variables: + ARCH: arm64 + extends: .build-image-mr + tags: + - $ARM_RUNNER + +ci-build-image-amd64: + variables: + ARCH: amd64 + extends: .build-image-mr + tags: + - $RUNNER + +# Code executed to build and push to registry + +.build-push-image-arch: + image: $BUILDAH_IMAGE + variables: + IMAGE: $CI_REGISTRY_IMAGE/fedora-bootc-$VARIANT:$VERSION-$ARCH + EXTRA_ARGS: --from=quay.io/fedora/fedora:$VERSION --build-arg=VARIANT=$VARIANT --format oci --arch $ARCH --security-opt=label=disable --cap-add=all + before_script: + - buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + script: + - buildah bud ${BUILDAH_ARGS} --no-cache -t ${IMAGE} ${EXTRA_ARGS} ${CONTEXT} + - buildah push $IMAGE + rules: + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - when: never + stage: build + +build-push-amd64: + variables: + ARCH: amd64 + parallel: + matrix: + - VARIANT: + - minimal + - full + VERSION: + - "40" + - rawhide + extends: .build-push-image-arch + rules: + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - when: never + stage: build + +build-push-arm64: + tags: + - tmp-gcp-bifrost-aarch64 + parallel: + matrix: + - VARIANT: + - minimal + - full + VERSION: + - "40" + - rawhide + variables: + ARCH: arm64 + extends: .build-push-image-arch + rules: + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - when: never + stage: build + +# And stitch things together into a manifest list + +manifests_list: + parallel: + matrix: + - VARIANT: + - minimal + - full + VERSION: + - "40" + - rawhide + needs: + - build-push-amd64 + - build-push-arm64 + image: $BUILDAH_IMAGE + variables: + IMAGE_BASE: $CI_REGISTRY_IMAGE/fedora-bootc-$VARIANT + IMAGE: $IMAGE_BASE:$VERSION + before_script: + - buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - for arch in ${ARCHES}; do buildah pull $IMAGE-${arch}; done + script: + - | + set -xeuo pipefail + buildah manifest create $IMAGE $IMAGE-amd64 $IMAGE-arm64 + for arch in ${ARCHES}; do + buildah manifest annotate $IMAGE $IMAGE-${arch} --os linux --arch ${arch} + buildah manifest annotate $IMAGE $IMAGE-${arch} --os linux --arch ${arch} + done + buildah manifest push --all $IMAGE docker://$IMAGE + if test $VERSION == $LATEST_VERSION; then + buildah manifest push --all $IMAGE docker://$IMAGE_BASE:latest + fi + if test $VARIANT == full; then + buildah push $IMAGE $CI_REGISTRY_IMAGE/fedora-bootc:$VERSION + fi + rules: + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - when: never + stage: build From 7634b34e2de3f98a1cab2367640294ea470fea36 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 30 Apr 2024 17:20:13 -0400 Subject: [PATCH 3/3] ci: Disable arm64 for now --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20c7876..36ab2c1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,8 @@ variables: # Default this one RUNNER: saas-linux-medium-amd64 ARM_RUNNER: tmp-gcp-bifrost-aarch64 - ARCHES: "amd64 arm64" + # TODO add arm64 once we have a runner + ARCHES: "amd64" BUILDAH_IMAGE: quay.io/buildah/stable:v1.34.0 BUILDAH_ARGS: "--security-opt=label=disable --cap-add=all" @@ -36,6 +37,9 @@ ci-build-image-arm64: extends: .build-image-mr tags: - $ARM_RUNNER + # See above re runner + rules: + - when: never ci-build-image-amd64: variables: