Skip to content
Snippets Groups Projects
Commit ed3aea6c authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Split CI build into separate develop(unstable)/staging(testing)/release(latest)

parent bb13ebd3
Branches
Tags
1 merge request!11Optimize CI setup, add libpoppler, and some minor polish
...@@ -13,12 +13,22 @@ builder:stable: ...@@ -13,12 +13,22 @@ builder:stable:
only: only:
- tags - tags
- master - master
- staging
script: script:
- cd containers/builder - cd containers/builder
- head Dockerfile - head Dockerfile
- make login - make login
- make release-cached - make release-cached
builder:testing:
stage: builder
tags:
- silicon
only:
- staging
script:
- cd containers/builder
- head Dockerfile
- make login
- make staging-cached
builder:unstable: builder:unstable:
stage: builder stage: builder
tags: tags:
...@@ -43,10 +53,24 @@ config:stable: ...@@ -43,10 +53,24 @@ config:stable:
only: only:
- tags - tags
- master - master
- staging
needs: ["builder:stable"] needs: ["builder:stable"]
script: script:
- bash containers/release/configure_release.sh - bash containers/release/configure_release.sh latest
artifacts:
paths:
- config/spack-env.sh
- config/eic-env.sh
- config/Dockerfile
config:testing:
image: eicweb.phy.anl.gov:4567/containers/eic_container/eic_builder:testing
stage: config
tags:
- silicon
only:
- staging
needs: ["builder:testing"]
script:
- bash containers/release/configure_release.sh testing
artifacts: artifacts:
paths: paths:
- config/spack-env.sh - config/spack-env.sh
...@@ -63,7 +87,7 @@ config:unstable: ...@@ -63,7 +87,7 @@ config:unstable:
- staging - staging
needs: ["builder:unstable"] needs: ["builder:unstable"]
script: script:
- bash containers/release/configure_release.sh - bash containers/release/configure_release.sh unstable
artifacts: artifacts:
paths: paths:
- config/spack-env.sh - config/spack-env.sh
...@@ -77,7 +101,6 @@ release:stable: ...@@ -77,7 +101,6 @@ release:stable:
only: only:
- tags - tags
- master - master
- staging
needs: ["config:stable"] needs: ["config:stable"]
script: script:
- cp config/Dockerfile containers/release/Dockerfile - cp config/Dockerfile containers/release/Dockerfile
...@@ -85,6 +108,19 @@ release:stable: ...@@ -85,6 +108,19 @@ release:stable:
- cd containers/release - cd containers/release
- make login - make login
- make release-cached - make release-cached
release:testing:
stage: main
tags:
- silicon
only:
- staging
needs: ["config:testing"]
script:
- cp config/Dockerfile containers/release/Dockerfile
- cp config/eic-env.sh containers/release/eic-env.sh
- cd containers/release
- make login
- make staging-cached
release:unstable: release:unstable:
stage: main stage: main
tags: tags:
...@@ -106,7 +142,6 @@ builder:singularity: ...@@ -106,7 +142,6 @@ builder:singularity:
tags: tags:
- singularity - singularity
only: only:
- staging
- tags - tags
needs: ["builder:stable"] needs: ["builder:stable"]
when: manual when: manual
...@@ -127,7 +162,6 @@ release:singularity: ...@@ -127,7 +162,6 @@ release:singularity:
tags: tags:
- singularity - singularity
only: only:
- staging
- tags - tags
needs: ["release:stable"] needs: ["release:stable"]
script: script:
......
...@@ -85,8 +85,13 @@ develop: build-nc publish-dev ## Develop build, do not publish latest ...@@ -85,8 +85,13 @@ develop: build-nc publish-dev ## Develop build, do not publish latest
@echo "Cleaning up" @echo "Cleaning up"
#docker rmi $(APP_NAME):latest #docker rmi $(APP_NAME):latest
staging: build-nc publish-staging ## Develop build, do not publish latest
@echo "Cleaning up"
#docker rmi $(APP_NAME):latest
release-cached: build publish ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR release-cached: build publish ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR
develop-cached: build login publish-dev ## develop release develop-cached: build login publish-dev ## develop release
staging-cached: build login publish-staging ## develop release
publish: login publish-latest publish-version #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR publish: login publish-latest publish-version #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR
@echo "Publishing done" @echo "Publishing done"
...@@ -98,6 +103,11 @@ publish-latest: ## Publish the `latest` taged container to ECR ...@@ -98,6 +103,11 @@ publish-latest: ## Publish the `latest` taged container to ECR
docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest
#docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest #docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest
publish-staging: ## Publish the `unstable` taged container to ECR
@echo 'publish unstable to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)'
docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):testing
docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):testing
publish-dev: ## Publish the `unstable` taged container to ECR publish-dev: ## Publish the `unstable` taged container to ECR
@echo 'publish unstable to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' @echo 'publish unstable to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)'
docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):unstable docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):unstable
......
# Release container for Argonne EIC software # Release container for Argonne EIC software
# Copy over relevant files from builder # Copy over relevant files from builder
# #
FROM eicweb.phy.anl.gov:4567/containers/eic_container/eic_builder:latest as builder FROM eicweb.phy.anl.gov:4567/containers/eic_container/eic_builder:@TAG@ as builder
RUN cd /opt/spack-environment && spack env activate . && spack gc -y RUN cd /opt/spack-environment && spack env activate . && spack gc -y
# Strip all the binaries # Strip all the binaries
......
...@@ -9,6 +9,8 @@ mkdir -p config ...@@ -9,6 +9,8 @@ mkdir -p config
cp /etc/profile.d/z10_spack_environment.sh config/spack-env.sh cp /etc/profile.d/z10_spack_environment.sh config/spack-env.sh
export TAG=$1
## Spack sets the man-path, which stops bash from using the default man-path ## Spack sets the man-path, which stops bash from using the default man-path
## We can fix this by appending a trailing colon to MANPATH ## We can fix this by appending a trailing colon to MANPATH
sed -i '/MANPATH/ s/;$/:;/' config/spack-env.sh sed -i '/MANPATH/ s/;$/:;/' config/spack-env.sh
...@@ -20,4 +22,5 @@ grep export config/spack-env.sh | \ ...@@ -20,4 +22,5 @@ grep export config/spack-env.sh | \
## create our release Dockerfile ## create our release Dockerfile
sed '/^@ENV@/r config/eic-env.sh' containers/release/Dockerfile.in | \ sed '/^@ENV@/r config/eic-env.sh' containers/release/Dockerfile.in | \
sed '/^@ENV@/d' > config/Dockerfile sed '/^@ENV@/d' | \
sed "s/@TAG@/$TAG/" > config/Dockerfile
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment