Skip to content
Snippets Groups Projects
Commit 94bdd9ec authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

fix: support for gitlab-ci-local

parent d5d874b1
No related branches found
No related tags found
1 merge request!700fix: support for gitlab-ci-local
...@@ -19,4 +19,7 @@ BUILD ...@@ -19,4 +19,7 @@ BUILD
debug debug
DEBUG DEBUG
#gitlab-ci-local
.gitlab-ci-local/
.nfs* .nfs*
PRIVILEGED=1
ULIMIT=8000:16000
VOLUME=certs:/certs/client
VARIABLE="DOCKER_TLS_CERTDIR=/certs"
\ No newline at end of file
image: eicweb.phy.anl.gov:4567/containers/image_recipes/ubuntu_dind:latest image: alpine
variables: variables:
## External images ## External images
DOCKER_IMAGE: docker.io/docker:24.0.5 # FIXME:
#DOCKER_IMAGE: docker.io/docker:24.0.5
DOCKER_IMAGE: eicweb.phy.anl.gov:4567/containers/image_recipes/ubuntu_dind:latest
SINGULARITY_IMAGE: quay.io/singularity/singularity:v3.11.4 SINGULARITY_IMAGE: quay.io/singularity/singularity:v3.11.4
## Application versions used for the main release ## Application versions used for the main release
...@@ -30,15 +32,15 @@ variables: ...@@ -30,15 +32,15 @@ variables:
JOBS: 128 JOBS: 128
## is this nightly or not? ## is this nightly or not?
NIGHTLY: NIGHTLY: ""
## Add to tag ## Add to tag
NIGHTLY_TAG: "nightly" NIGHTLY_TAG: "nightly"
## Additional options for docker build (e.g. --no-cache) ## Additional options for docker build (e.g. --no-cache)
BUILD_OPTIONS: BUILD_OPTIONS: ""
## Version to be set by external trigger ## Version to be set by external trigger
VERSION: VERSION: ""
## Internal tag used for the CI ## Internal tag used for the CI
INTERNAL_TAG: "pipeline-${CI_PIPELINE_ID}" INTERNAL_TAG: "pipeline-${CI_PIPELINE_ID}"
...@@ -53,19 +55,6 @@ stages: ...@@ -53,19 +55,6 @@ stages:
- test - test
- finalize - finalize
default:
before_script:
- ./gitlab-ci/docker_login.sh -u ${DH_REGISTRY_USER} -p ${DH_EICWEB_TOKEN}
-n ${DOCKER_NTRIES} -t ${DOCKER_WAIT_TIME}
- ./gitlab-ci/docker_login.sh -u ${GITHUB_REGISTRY_USER} -p ${GITHUB_REGISTRY_TOKEN}
-n ${DOCKER_NTRIES} -t ${DOCKER_WAIT_TIME}
${GH_REGISTRY}
- ./gitlab-ci/docker_login.sh --ci -n ${DOCKER_NTRIES} -t ${DOCKER_WAIT_TIME}
after_script:
- docker logout
- docker logout ${CI_REGISTRY}
- docker logout ${GH_REGISTRY}
## only run CI for in the following cases: ## only run CI for in the following cases:
## master, stable branch, release tag, MR event and nightly builds ## master, stable branch, release tag, MR event and nightly builds
## nightly builds are now part of the regular master build in order to keep ## nightly builds are now part of the regular master build in order to keep
...@@ -131,7 +120,7 @@ version: ...@@ -131,7 +120,7 @@ version:
VERSION="${CI_COMMIT_REF_NAME}-${CI_PIPELINE_ID}" VERSION="${CI_COMMIT_REF_NAME}-${CI_PIPELINE_ID}"
EXPORT_TAG="" EXPORT_TAG=""
fi fi
echo "INTERNAL_TAG=$INTERNAL_TAG" >> build.env echo "INTERNAL_TAG=$INTERNAL_TAG" > build.env
echo "VERSION=$VERSION" >> build.env echo "VERSION=$VERSION" >> build.env
echo "NIGHTLY_TAG=$NIGHTLY_TAG" >> build.env echo "NIGHTLY_TAG=$NIGHTLY_TAG" >> build.env
echo "EXPORT_TAG=$EXPORT_TAG" >> build.env echo "EXPORT_TAG=$EXPORT_TAG" >> build.env
...@@ -140,22 +129,61 @@ version: ...@@ -140,22 +129,61 @@ version:
reports: reports:
dotenv: build.env dotenv: build.env
## base job settings for all build jobs ## base job settings for all docker interactions
.docker:
image: ${DOCKER_IMAGE}
before_script:
- # Login to registries
if [[ -n "${EXPORT_TAG}" ]] ; then
if [[ -n "${DH_REGISTRY}" ]] ; then
./gitlab-ci/docker_login.sh -u ${DH_REGISTRY_USER} -p ${DH_EICWEB_TOKEN}
-n ${DOCKER_NTRIES} -t ${DOCKER_WAIT_TIME}
${DH_REGISTRY} ;
fi ;
if [[ -n "${GH_REGISTRY}" ]] ; then
./gitlab-ci/docker_login.sh -u ${GITHUB_REGISTRY_USER} -p ${GITHUB_REGISTRY_TOKEN}
-n ${DOCKER_NTRIES} -t ${DOCKER_WAIT_TIME}
${GH_REGISTRY} ;
fi ;
if [[ -n "${CI_REGISTRY}" ]] ; then
./gitlab-ci/docker_login.sh -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}
-n ${DOCKER_NTRIES} -t ${DOCKER_WAIT_TIME}
${CI_REGISTRY} ;
fi ;
fi
after_script:
- # Logout from registries
if [[ -n "${EXPORT_TAG}" ]] ; then
if [[ -n "${DH_REGISTRY}" ]] ; then
docker logout ${DH_REGISTRY}
fi ;
if [[ -n "${GH_REGISTRY}" ]] ; then
docker logout ${GH_REGISTRY}
fi ;
if [[ -n "${CI_REGISTRY}" ]] ; then
docker logout ${CI_REGISTRY}
fi ;
fi
## base job settings for all docker build jobs
.build: .build:
extends: .docker
rules: rules:
- when: on_success - when: on_success
resource_group: ${CI_COMMIT_REF_NAME}-${VERSION} resource_group: ${CI_COMMIT_REF_NAME}-${VERSION}
tags: tags:
- docker-new - docker-new
before_script: before_script:
- !reference [default, before_script] - !reference [.docker, before_script]
- mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc ; - mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc ;
for arch in aarch64 ; do for arch in aarch64 ; do
if ! grep --quiet enabled /proc/sys/fs/binfmt_misc/qemu-$arch ; then if ! grep -q enabled /proc/sys/fs/binfmt_misc/qemu-$arch ; then
docker run --rm --privileged multiarch/qemu-user-static --persistent yes ; docker run --rm --privileged multiarch/qemu-user-static --persistent yes ;
fi ; fi ;
done done
- docker buildx create --name builder --driver docker-container --bootstrap --use - docker context create context
- docker context use context
- docker buildx create --name builder --driver docker-container --bootstrap --use context
## rules for nightly jobs ## rules for nightly jobs
.nightly: .nightly:
...@@ -425,11 +453,9 @@ jug_xl:nightly: ...@@ -425,11 +453,9 @@ jug_xl:nightly:
expire_in: 1 days expire_in: 1 days
paths: paths:
- build/${BUILD_IMAGE}.sif - build/${BUILD_IMAGE}.sif
before_script: ""
script: script:
- mkdir build - mkdir build
- singularity pull build/${BUILD_IMAGE}.sif docker://${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${INTERNAL_TAG}-${BUILD_TYPE} - singularity pull build/${BUILD_IMAGE}.sif docker://${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${INTERNAL_TAG}-${BUILD_TYPE}
after_script: ""
jug_xl:singularity:default: jug_xl:singularity:default:
extends: .singularity extends: .singularity
...@@ -513,6 +539,7 @@ benchmarks:physics:nightly: ...@@ -513,6 +539,7 @@ benchmarks:physics:nightly:
allow_failure: false allow_failure: false
clean: clean:
extends: .docker
stage: finalize stage: finalize
dependencies: dependencies:
- version - version
...@@ -538,6 +565,7 @@ clean: ...@@ -538,6 +565,7 @@ clean:
- ./gitlab-ci/cleanup_registry.sh -i dind -r 93 ${INTERNAL_TAG} - ./gitlab-ci/cleanup_registry.sh -i dind -r 93 ${INTERNAL_TAG}
clean_unstable_mr: clean_unstable_mr:
extends: .docker
stage: finalize stage: finalize
dependencies: dependencies:
- clean - clean
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment