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

feat: allow specifying org/repo for spack and eic-spack

parent 56df32de
No related branches found
No related tags found
1 merge request!412feat: allow specifying org/repo for spack and eic-spack
......@@ -5,6 +5,8 @@ variables:
## note: nightly builds will always use the master/main branch
JUGGLER_VERSION: "v9.0.0"
## Spack organization and repository, e.g. spack/spack
SPACK_ORGREPO: "spack/spack"
## Spack github version, e.g. v0.18.1 or commit hash
SPACK_VERSION: "v0.19.0"
## Space-separated list of spack cherry-picks
......@@ -12,10 +14,14 @@ variables:
## Ref: https://github.com/spack/spack/commit/[hash]
## [hash]: [description]
## Spack github version, e.g. v0.18 branch, v0.18.1 tag, or commit hash
## EIC spack organization and repository, e.g. eic/eic-spack
EICSPACK_ORGREPO: "eic/eic-spack"
## EIC spack github version, e.g. v0.18 branch, v0.18.1 tag, or commit hash
EICSPACK_VERSION: "v0.19"
## Space-separated list of eic-spack cherry-picks
EICSPACK_CHERRYPICKS: ""
## Ref: https://github.com/eic/eic-spack/commit/[hash]
## [hash]: [description]
## We need to enable Docker Buildkit to use cache mounts and better
## build performance overall
......@@ -240,8 +246,10 @@ jug_dev:default:
--target=builder
-f containers/jug/dev.Dockerfile
--build-arg BASE_IMAGE="${BASE_IMAGE}"
--build-arg SPACK_ORGREPO="${SPACK_ORGREPO}"
--build-arg SPACK_VERSION="${SPACK_VERSION}"
--build-arg SPACK_CHERRYPICKS="${SPACK_CHERRYPICKS}"
--build-arg EICSPACK_ORGREPO="${EICSPACK_ORGREPO}"
--build-arg EICSPACK_VERSION="${EICSPACK_VERSION}"
--build-arg EICSPACK_CHERRYPICKS="${EICSPACK_CHERRYPICKS}"
--build-arg CACHE_BUST=${PACKAGE_HASH}
......@@ -252,8 +260,10 @@ jug_dev:default:
- docker build -t ${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${INTERNAL_TAG} ${CACHE_FLAG}
-f containers/jug/dev.Dockerfile
--build-arg BASE_IMAGE="${BASE_IMAGE}"
--build-arg SPACK_ORGREPO="${SPACK_ORGREPO}"
--build-arg SPACK_VERSION="${SPACK_VERSION}"
--build-arg SPACK_CHERRYPICKS="${SPACK_CHERRYPICKS}"
--build-arg EICSPACK_ORGREPO="${EICSPACK_ORGREPO}"
--build-arg EICSPACK_VERSION="${EICSPACK_VERSION}"
--build-arg EICSPACK_CHERRYPICKS="${EICSPACK_CHERRYPICKS}"
--build-arg CACHE_BUST=${PACKAGE_HASH}
......
......@@ -23,25 +23,16 @@ RUN --mount=type=cache,target=/var/cache/apt \
## Setup spack
## parts:
ENV SPACK_ROOT=/opt/spack
ARG SPACK_ORGREPO="spack/spack"
ARG SPACK_VERSION="develop"
ARG SPACK_CHERRYPICKS=""
ADD https://api.github.com/repos/spack/spack/commits/$SPACK_VERSION /tmp/spack.json
ADD https://api.github.com/repos/${SPACK_ORGREPO}/commits/${SPACK_VERSION} /tmp/spack.json
RUN echo "Part 1: regular spack install (as in containerize)" \
&& git clone https://github.com/spack/spack.git /tmp/spack-staging \
&& cd /tmp/spack-staging \
&& git checkout $SPACK_VERSION \
&& git clone https://github.com/${SPACK_ORGREPO}.git ${SPACK_ROOT} \
&& git -C ${SPACK_ROOT} checkout ${SPACK_VERSION} \
&& if [ -n "$SPACK_CHERRYPICKS" ] ; then \
git cherry-pick -n $SPACK_CHERRYPICKS ; \
git -C ${SPACK_ROOT} cherry-pick -n $SPACK_CHERRYPICKS ; \
fi \
&& cd - \
&& mkdir -p $SPACK_ROOT \
&& cp -r /tmp/spack-staging/bin $SPACK_ROOT/bin \
&& cp -r /tmp/spack-staging/etc $SPACK_ROOT/etc \
&& cp -r /tmp/spack-staging/lib $SPACK_ROOT/lib \
&& cp -r /tmp/spack-staging/share $SPACK_ROOT/share \
&& cp -r /tmp/spack-staging/var $SPACK_ROOT/var \
&& cp -r /tmp/spack-staging/.git $SPACK_ROOT/.git \
&& rm -rf /tmp/spack-staging \
&& echo 'export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH'\
>> $SPACK_ROOT/share/setup-env.sh \
&& ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
......@@ -81,10 +72,12 @@ ARG CACHE_BUST="hash"
ARG CACHE_NUKE=""
## Setup our custom package overrides
ENV EICSPACK_ROOT=$SPACK_ROOT/var/spack/repos/eic-spack
ENV EICSPACK_ROOT=${SPACK_ROOT}/var/spack/repos/eic-spack
ARG EICSPACK_ORGREPO="eic/eic-spack"
ARG EICSPACK_VERSION="$SPACK_VERSION"
ADD https://api.github.com/repos/eic/eic-spack/commits/$EICSPACK_VERSION /tmp/eic-spack.json
RUN git clone https://github.com/eic/eic-spack.git ${EICSPACK_ROOT} \
ARG EICSPACK_CHERRYPICKS=""
ADD https://api.github.com/repos/${EICSPACK_ORGREPO}/commits/${EICSPACK_VERSION} /tmp/eic-spack.json
RUN git clone https://github.com/${EICSPACK_ORGREPO}.git ${EICSPACK_ROOT} \
&& git -C ${EICSPACK_ROOT} checkout ${EICSPACK_VERSION} \
&& if [ -n "${EICSPACK_CHERRYPICKS}" ] ; then \
git -C ${EICSPACK_ROOT} cherry-pick -n ${EICSPACK_CHERRYPICKS} ; \
......
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