summaryrefslogtreecommitdiff
path: root/lib/mesa/.gitlab-ci/container/gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/.gitlab-ci/container/gitlab-ci.yml')
-rw-r--r--lib/mesa/.gitlab-ci/container/gitlab-ci.yml420
1 files changed, 420 insertions, 0 deletions
diff --git a/lib/mesa/.gitlab-ci/container/gitlab-ci.yml b/lib/mesa/.gitlab-ci/container/gitlab-ci.yml
new file mode 100644
index 000000000..aa4580bb3
--- /dev/null
+++ b/lib/mesa/.gitlab-ci/container/gitlab-ci.yml
@@ -0,0 +1,420 @@
+# Docker image tag helper templates
+
+.incorporate-templates-commit:
+ variables:
+ FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_TEMPLATES_COMMIT}"
+
+.incorporate-base-tag+templates-commit:
+ variables:
+ FDO_BASE_IMAGE: "${CI_REGISTRY_IMAGE}/${MESA_BASE_IMAGE}:${MESA_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
+ FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
+
+.set-image:
+ extends:
+ - .incorporate-templates-commit
+ variables:
+ MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${FDO_DISTRIBUTION_TAG}"
+ image: "$MESA_IMAGE"
+
+.set-image-base-tag:
+ extends:
+ - .set-image
+ - .incorporate-base-tag+templates-commit
+ variables:
+ MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${FDO_DISTRIBUTION_TAG}"
+
+
+# Build the CI docker images.
+#
+# MESA_IMAGE_TAG is the tag of the docker image used by later stage jobs. If the
+# image doesn't exist yet, the container stage job generates it.
+#
+# In order to generate a new image, one should generally change the tag.
+# While removing the image from the registry would also work, that's not
+# recommended except for ephemeral images during development: Replacing
+# an image after a significant amount of time might pull in newer
+# versions of gcc/clang or other packages, which might break the build
+# with older commits using the same tag.
+#
+# After merging a change resulting in generating a new image to the
+# main repository, it's recommended to remove the image from the source
+# repository's container registry, so that the image from the main
+# repository's registry will be used there as well.
+
+.container:
+ stage: container
+ extends:
+ - .container-rules
+ - .incorporate-templates-commit
+ variables:
+ FDO_DISTRIBUTION_VERSION: bullseye-slim
+ FDO_REPO_SUFFIX: $CI_JOB_NAME
+ FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
+ # no need to pull the whole repo to build the container image
+ GIT_STRATEGY: none
+
+.use-base-image:
+ extends:
+ - .container
+ - .incorporate-base-tag+templates-commit
+ # Don't want the .container rules
+ - .ci-run-policy
+
+# Debian 11 based x86 build image base
+debian/x86_build-base:
+ extends:
+ - .fdo.container-build@debian
+ - .container
+ variables:
+ MESA_IMAGE_TAG: &debian-x86_build-base ${DEBIAN_BASE_TAG}
+
+.use-debian/x86_build-base:
+ extends:
+ - .fdo.container-build@debian
+ - .use-base-image
+ variables:
+ MESA_BASE_IMAGE: ${DEBIAN_X86_BUILD_BASE_IMAGE}
+ MESA_BASE_TAG: *debian-x86_build-base
+ MESA_ARTIFACTS_BASE_TAG: *debian-x86_build-base
+ needs:
+ - debian/x86_build-base
+
+# Debian 11 based x86 main build image
+debian/x86_build:
+ extends:
+ - .use-debian/x86_build-base
+ variables:
+ MESA_IMAGE_TAG: &debian-x86_build ${DEBIAN_BUILD_TAG}
+
+.use-debian/x86_build:
+ extends:
+ - .set-image-base-tag
+ variables:
+ MESA_BASE_TAG: *debian-x86_build-base
+ MESA_IMAGE_PATH: ${DEBIAN_X86_BUILD_IMAGE_PATH}
+ MESA_IMAGE_TAG: *debian-x86_build
+ needs:
+ - debian/x86_build
+
+# Debian 11 based i386 cross-build image
+debian/i386_build:
+ extends:
+ - .use-debian/x86_build-base
+ variables:
+ MESA_IMAGE_TAG: &debian-i386_build ${DEBIAN_BUILD_TAG}
+
+.use-debian/i386_build:
+ extends:
+ - .set-image-base-tag
+ variables:
+ MESA_BASE_TAG: *debian-x86_build-base
+ MESA_IMAGE_PATH: "debian/i386_build"
+ MESA_IMAGE_TAG: *debian-i386_build
+ needs:
+ - debian/i386_build
+
+# Debian 11 based ppc64el cross-build image
+debian/ppc64el_build:
+ extends:
+ - .use-debian/x86_build-base
+ variables:
+ MESA_IMAGE_TAG: &debian-ppc64el_build ${DEBIAN_BUILD_TAG}
+
+.use-debian/ppc64el_build:
+ extends:
+ - .set-image-base-tag
+ variables:
+ MESA_BASE_TAG: *debian-x86_build-base
+ MESA_IMAGE_PATH: "debian/ppc64el_build"
+ MESA_IMAGE_TAG: *debian-ppc64el_build
+ needs:
+ - debian/ppc64el_build
+
+# Debian 11 based s390x cross-build image
+debian/s390x_build:
+ extends:
+ - .use-debian/x86_build-base
+ variables:
+ MESA_IMAGE_TAG: &debian-s390x_build ${DEBIAN_BUILD_TAG}
+
+.use-debian/s390x_build:
+ extends:
+ - .set-image-base-tag
+ variables:
+ MESA_BASE_TAG: *debian-x86_build-base
+ MESA_IMAGE_PATH: "debian/s390x_build"
+ MESA_IMAGE_TAG: *debian-s390x_build
+ needs:
+ - debian/s390x_build
+
+# Android NDK cross-build image
+debian/android_build:
+ extends:
+ - .use-debian/x86_build-base
+ variables:
+ MESA_IMAGE_TAG: &debian-android_build ${DEBIAN_BUILD_TAG}
+
+.use-debian/android_build:
+ extends:
+ - .set-image-base-tag
+ variables:
+ MESA_BASE_TAG: *debian-x86_build-base
+ MESA_IMAGE_PATH: "debian/android_build"
+ MESA_IMAGE_TAG: *debian-android_build
+ needs:
+ - debian/android_build
+
+# Debian 11 based x86 test image base
+debian/x86_test-base:
+ extends: debian/x86_build-base
+ variables:
+ MESA_IMAGE_TAG: &debian-x86_test-base ${DEBIAN_BASE_TAG}
+
+.use-debian/x86_test-base:
+ extends:
+ - .fdo.container-build@debian
+ - .use-base-image
+ variables:
+ MESA_BASE_IMAGE: ${DEBIAN_X86_TEST_BASE_IMAGE}
+ MESA_BASE_TAG: *debian-x86_test-base
+ needs:
+ - debian/x86_test-base
+
+# Debian 11 based x86 test image for GL
+debian/x86_test-gl:
+ extends: .use-debian/x86_test-base
+ variables:
+ FDO_DISTRIBUTION_EXEC: 'env KERNEL_URL=${KERNEL_URL} FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
+ KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v5.16-for-mesa-ci-991fec6622591/linux-v5.16-for-mesa-ci-991fec6622591.tar.bz2"
+ MESA_IMAGE_TAG: &debian-x86_test-gl ${DEBIAN_X86_TEST_GL_TAG}
+
+.use-debian/x86_test-gl:
+ extends:
+ - .set-image-base-tag
+ variables:
+ MESA_BASE_TAG: *debian-x86_test-base
+ MESA_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_PATH}
+ MESA_IMAGE_TAG: *debian-x86_test-gl
+ needs:
+ - debian/x86_test-gl
+
+# Debian 11 based x86 test image for VK
+debian/x86_test-vk:
+ extends: .use-debian/x86_test-base
+ variables:
+ MESA_IMAGE_TAG: &debian-x86_test-vk ${DEBIAN_X86_TEST_VK_TAG}
+
+.use-debian/x86_test-vk:
+ extends:
+ - .set-image-base-tag
+ variables:
+ MESA_BASE_TAG: *debian-x86_test-base
+ MESA_IMAGE_PATH: "debian/x86_test-vk"
+ MESA_IMAGE_TAG: *debian-x86_test-vk
+ needs:
+ - debian/x86_test-vk
+
+# Debian 11 based ARM build image
+debian/arm_build:
+ extends:
+ - .fdo.container-build@debian
+ - .container
+ tags:
+ - aarch64
+ variables:
+ MESA_IMAGE_TAG: &debian-arm_build ${DEBIAN_BASE_TAG}
+
+.use-debian/arm_build:
+ extends:
+ - .set-image
+ variables:
+ MESA_IMAGE_PATH: "debian/arm_build"
+ MESA_IMAGE_TAG: *debian-arm_build
+ MESA_ARTIFACTS_TAG: *debian-arm_build
+ needs:
+ - debian/arm_build
+
+
+# Fedora 34 based x86 build image
+fedora/x86_build:
+ extends:
+ - .fdo.container-build@fedora
+ - .container
+ variables:
+ FDO_DISTRIBUTION_VERSION: 34
+ MESA_IMAGE_TAG: &fedora-x86_build ${FEDORA_X86_BUILD_TAG}
+
+.use-fedora/x86_build:
+ extends:
+ - .set-image
+ variables:
+ MESA_IMAGE_PATH: "fedora/x86_build"
+ MESA_IMAGE_TAG: *fedora-x86_build
+ needs:
+ - fedora/x86_build
+
+
+.kernel+rootfs:
+ extends:
+ - .ci-run-policy
+ stage: container
+ variables:
+ GIT_STRATEGY: fetch
+ KERNEL_URL: *kernel-rootfs-url
+ MESA_ROOTFS_TAG: &kernel-rootfs ${KERNEL_ROOTFS_TAG}
+ DISTRIBUTION_TAG: &distribution-tag-arm "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}"
+ script:
+ - .gitlab-ci/container/lava_build.sh
+
+kernel+rootfs_amd64:
+ extends:
+ - .use-debian/x86_build-base
+ - .kernel+rootfs
+ image: "$FDO_BASE_IMAGE"
+ variables:
+ DEBIAN_ARCH: "amd64"
+ DISTRIBUTION_TAG: &distribution-tag-amd64 "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
+
+kernel+rootfs_arm64:
+ extends:
+ - .use-debian/arm_build
+ - .kernel+rootfs
+ tags:
+ - aarch64
+ variables:
+ DEBIAN_ARCH: "arm64"
+
+kernel+rootfs_armhf:
+ extends:
+ - kernel+rootfs_arm64
+ variables:
+ DEBIAN_ARCH: "armhf"
+
+# Cannot use anchors defined here from included files, so use extends: instead
+.use-kernel+rootfs-arm:
+ variables:
+ DISTRIBUTION_TAG: *distribution-tag-arm
+ MESA_ROOTFS_TAG: *kernel-rootfs
+
+.use-kernel+rootfs-amd64:
+ variables:
+ DISTRIBUTION_TAG: *distribution-tag-amd64
+ MESA_ROOTFS_TAG: *kernel-rootfs
+
+# x86 image with ARM64 & armhf kernel & rootfs for baremetal testing
+debian/arm_test:
+ extends:
+ - .fdo.container-build@debian
+ - .container
+ # Don't want the .container rules
+ - .ci-run-policy
+ needs:
+ - kernel+rootfs_arm64
+ - kernel+rootfs_armhf
+ variables:
+ FDO_DISTRIBUTION_EXEC: 'env ARTIFACTS_PREFIX=https://${MINIO_HOST}/mesa-lava ARTIFACTS_SUFFIX=${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT} CI_PROJECT_PATH=${CI_PROJECT_PATH} FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} FDO_UPSTREAM_REPO=${FDO_UPSTREAM_REPO} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
+ FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
+ MESA_ARM_BUILD_TAG: *debian-arm_build
+ MESA_IMAGE_TAG: &debian-arm_test ${DEBIAN_BASE_TAG}
+ MESA_ROOTFS_TAG: *kernel-rootfs
+
+.use-debian/arm_test:
+ image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
+ variables:
+ MESA_ARM_BUILD_TAG: *debian-arm_build
+ MESA_IMAGE_PATH: "debian/arm_test"
+ MESA_IMAGE_TAG: *debian-arm_test
+ MESA_ROOTFS_TAG: *kernel-rootfs
+ needs:
+ - debian/arm_test
+
+# Native Windows docker builds
+#
+# Unlike the above Linux-based builds - including MinGW builds which
+# cross-compile for Windows - which use the freedesktop ci-templates, we
+# cannot use the same scheme here. As Windows lacks support for
+# Docker-in-Docker, and Podman does not run natively on Windows, we have
+# to open-code much of the same ourselves.
+#
+# This is achieved by first running in a native Windows shell instance
+# (host PowerShell) in the container stage to build and push the image,
+# then in the build stage by executing inside Docker.
+
+.windows-docker-vs2019:
+ variables:
+ MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}"
+ MESA_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MESA_IMAGE_PATH:${MESA_IMAGE_TAG}"
+
+.windows_container_build:
+ inherit:
+ default: false
+ extends:
+ - .container
+ - .windows-docker-vs2019
+ rules:
+ - if: '$MICROSOFT_FARM == "offline"'
+ when: never
+ - !reference [.container-rules, rules]
+ variables:
+ GIT_STRATEGY: fetch # we do actually need the full repository though
+ MESA_BASE_IMAGE: None
+ tags:
+ - windows
+ - shell
+ - "1809"
+ - mesa
+ script:
+ - .\.gitlab-ci\windows\mesa_container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $MESA_IMAGE $MESA_UPSTREAM_IMAGE ${DOCKERFILE} ${MESA_BASE_IMAGE}
+
+windows_build_vs2019:
+ inherit:
+ default: false
+ extends:
+ - .windows_container_build
+ variables:
+ MESA_IMAGE_PATH: &windows_build_image_path ${WINDOWS_X64_BUILD_PATH}
+ MESA_IMAGE_TAG: &windows_build_image_tag ${WINDOWS_X64_BUILD_TAG}
+ DOCKERFILE: Dockerfile_build
+ timeout: 2h 30m # LLVM takes ages
+
+windows_test_vs2019:
+ inherit:
+ default: false
+ extends:
+ - .windows_container_build
+ rules:
+ - if: '$MICROSOFT_FARM == "offline"'
+ when: never
+ - !reference [.ci-run-policy, rules]
+ variables:
+ MESA_IMAGE_PATH: &windows_test_image_path ${WINDOWS_X64_TEST_PATH}
+ MESA_IMAGE_TAG: &windows_test_image_tag ${WINDOWS_X64_BUILD_TAG}--${WINDOWS_X64_TEST_TAG}
+ DOCKERFILE: Dockerfile_test
+ # Right now this only needs the VS install to get DXIL.dll. Maybe see about decoupling this at some point
+ MESA_BASE_IMAGE_PATH: *windows_build_image_path
+ MESA_BASE_IMAGE_TAG: *windows_build_image_tag
+ MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${MESA_BASE_IMAGE_TAG}"
+ script:
+ - .\.gitlab-ci\windows\mesa_container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $MESA_IMAGE $MESA_UPSTREAM_IMAGE Dockerfile_test ${MESA_BASE_IMAGE}
+ needs:
+ - windows_build_vs2019
+
+.use-windows_build_vs2019:
+ inherit:
+ default: false
+ extends: .windows-docker-vs2019
+ image: "$MESA_IMAGE"
+ variables:
+ MESA_IMAGE_PATH: *windows_build_image_path
+ MESA_IMAGE_TAG: *windows_build_image_tag
+ needs:
+ - windows_build_vs2019
+
+.use-windows_test_vs2019:
+ inherit:
+ default: false
+ extends: .windows-docker-vs2019
+ image: "$MESA_IMAGE"
+ variables:
+ MESA_IMAGE_PATH: *windows_test_image_path
+ MESA_IMAGE_TAG: *windows_test_image_tag