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

Fix environment in singularity

parent 2751d50f
No related branches found
No related tags found
1 merge request!80Fix environment in singularity
......@@ -30,6 +30,7 @@ stages:
- build:dev ## naked dev container image
- build:release ## dressed release container image
- deploy ## build/deploy singularity images
- test
- finalize
default:
......@@ -96,7 +97,7 @@ version:
NIGHTLY_TAG=${NIGHTLY}
if [ "x${CI_PIPELINE_SOURCE}" == "xmerge_request_event" ]; then
INTERNAL_TAG="unstable-mr-${CI_MERGE_REQUEST_ID}"
NIGHTLY_TAG=
NIGHTLY_TAG="${INTERNAL_TAG}-nightly"
EXPORT_TAG=$UNSTABLE
EXPORT_TAG2=
elif [ "$CI_COMMIT_TAG" = "v${VERSION}" ]; then
......@@ -208,6 +209,8 @@ jug_xl:nightly:
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_success
- when: never
needs:
- version
......@@ -220,9 +223,14 @@ jug_xl:nightly:
--build-arg INTERNAL_TAG=${INTERNAL_TAG}
--build-arg JUG_VERSION=nightly-$(date +%Y-%m-%d_%H-%M-%S)-$(git rev-parse HEAD)
containers/jug
- |
PUSH_FLAG=""
if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]; then
PUSH_FLAG="--eicweb"
fi
- ./gitlab-ci/docker_push.sh -i ${BUILD_IMAGE} -l ${NIGHTLY_TAG}
-n $DOCKER_NTRIES -t $DOCKER_WAIT_TIME
${NIGHTLY_TAG}
${NIGHTLY_TAG} ${PUSH_FLAG}
.singularity:
stage: deploy
......@@ -262,6 +270,8 @@ jug_xl:singularity:nightly:
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_success
- when: never
artifacts:
expire_in: 1 days
......@@ -289,6 +299,9 @@ juggler:master:
project: EIC/juggler
allow_failure: true
include:
- local: 'tests/tutorial/config.yml'
cleanup:
stage: finalize
dependencies:
......@@ -299,3 +312,7 @@ cleanup:
- ./gitlab-ci/cleanup_registry.sh -i debian_base -r 66 ${INTERNAL_TAG}
- ./gitlab-ci/cleanup_registry.sh -i jug_dev -r 68 ${INTERNAL_TAG}
- ./gitlab-ci/cleanup_registry.sh -i jug_xl -r 69 ${INTERNAL_TAG}
- |
if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]; then
./gitlab-ci/cleanup_registry.sh -i jug_xl -r 69 ${NIGHTLY_TAG}
fi
......@@ -130,9 +130,8 @@ RUN cd /opt/spack-environment \
&& echo -n "" \
&& echo "Grabbing environment info" \
&& spack env activate --sh -d . \
> /etc/profile.d/z10_spack_environment.sh \
&& sed -i "s?LD_LIBRARY_PATH=?&/lib/x86_64-linux-gnu:?" \
/etc/profile.d/z10_spack_environment.sh \
| sed "s?LD_LIBRARY_PATH=?&/lib/x86_64-linux-gnu:?" \
> /etc/profile.d/z10_spack_environment.sh \
&& cd /opt/spack-environment \
&& echo -n "" \
&& echo "Add extra environment variables for Jug, Podio and Gaudi" \
......@@ -220,12 +219,12 @@ RUN --mount=from=staging,target=/staging \
rm -rf /usr/local \
&& cp -r /staging/opt/software /opt/software \
&& cp -r /staging/usr/local /usr/local \
&& cp /staging/etc/profile.d/z10_spack_environment.sh /etc/eic-env.sh \
&& sed -i '/MANPATH/ s/;$/:;/' /etc/eic-env.sh \
&& cp /staging/etc/profile.d/z11_jug_env.sh \
/etc/profile.d/z11_jug_env.sh \
&& cat /etc/profile.d/z11_jug_env.sh >> /etc/eic-env.sh \
&& cp /etc/eic-env.sh /etc/profile.d/z10_eic-env.sh \
&& cat /staging/etc/profile.d/z10_spack_environment.sh \
| sed '/MANPATH/ s/;$/:;/' \
> /etc/profile.d/z10_spack_env.sh \
&& cat /etc/profile.d/z1*.sh > /etc/eic-env.sh \
&& cp /staging/etc/jug_info /etc/jug_info
ARG JUG_VERSION=1
......
#!/usr/bin/env bash
source /etc/profile
## Force environment to be clean
export LD_LIBRARY_PATH="/lib/x86_64-linux-gnu:/usr/local/lib64:/usr/local/lib"
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[ ! -z "$CC" ] && unset CC
[ ! -z "$CXX" ] && unset CXX
[ ! -z "$JUPYTER_CONFIG_DIR" ] && unset JUPYTER_CONFIG_DIR
[ ! -z "$JUPYTER_PATH" ] && unset JUPYTER_PATH
[ ! -z "$CLING_STANDARD_PCH" ] && unset CLING_STANDARD_PCH
[ ! -z "$USER_PATH" ] && unset USER_PATH
[ ! -z "$SHLIB_PATH ] && unset SHLIB_PATH
[ ! -z "$LIBPATH ] && unset $LIBPATH
[ ! -z "$CMAKE_PREFIX_PATH" ] && unset CMAKE_PREFIX_PATH
[ ! -z "$SOFTWARE_HOME" ] && unset SOFTWARE_HOME
[ ! -z "$ROOTSYS" ] && unset ROOTSYS
## Properly setup environment
source /etc/eic-env.sh
piped_args=()
......@@ -15,9 +29,9 @@ fi
### Fire off bash
if [ "${#piped_args[@]}" != "0" ]; then
echo "${#piped_args[@]}"
printf "%s\n" "${piped_args[@]}" | bash
printf "%s\n" "${piped_args[@]}" | bash -s -- --norc
elif [ $# -gt 0 ]; then
exec bash -c "$@"
exec bash --norc -c "$@"
else
exec bash
exec bash --norc
fi
......@@ -124,6 +124,9 @@ else
ln -sf /cvmfs/eic.opensciencegrid.org/singularity/athena/${CONTAINER}_v${VERSION}.sif ${SIF}
elif [ -f /gpfs02/cvmfst0/eic.opensciencegrid.org/singularity/athena/${CONTAINER}_v${VERSION}.sif ]; then
ln -sf /gpfs02/cvmfst0/eic.opensciencegrid.org/singularity/athena/${CONTAINER}_v${VERSION}.sif ${SIF}
## check if we have an internal CI image we will use for testing purposes
elif [ -f $PWD/.gitlab-ci/${CONTAINER}-${VERSION}.sif ]; then
ln -sf $PWD/.gitlab-ci/${CONTAINER}-${VERSION}.sif ${SIF}
## if not, download the container to the system
else
## get the python installer and run the old-style install
......
## Ensure the container still works for the new container
## even with a strange environment setup
test:tutorial:
stage: test
needs:
- version
- jug_xl:singularity:nightly
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_success
- when: never
script:
- mkdir eic && cd eic
- mkdir -p .gitlab-ci && mv ../build/jug_xl.sif .gitlab-ci/jug_xl-ci-test.sif
# setup our environment to be weird
- |
echo ROOTSYS=/invalid-path >> ~/.bashrc
echo CC=`which gfortran` >> ~/.bashrc
echo CXX=`which gfortran` >> ~/.bashrc
# setup tutorial starting position
- bash ../install.sh -v ci-test
# now attempt the tutorial
- ./eic-shell tests/tutorial/quick-start.sh
- ./eic-shell tests/tutorial/part1.sh
#!/bin/bash
source /opt/detector/setup.sh
git clone https://eicweb.phy.anl.gov/EIC/tutorials/ip6_tutorial_1.git part1
pushd part1
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$ATHENA_PREFIX -DCMAKE_CXX_STANDARD=17
cmake --build build -j4 -- install
dd_web_display --export gem_tracker.xml
checkOverlaps -t 0.0001 -c gem_tracker.xml
npdet_info dump gem_tracker.xml
npsim --runType run --enableG4GPS \
--macroFile gps.mac \
--compactFile ./gem_tracker.xml \
--outputFile gem_tracker_sim.root
root -b -q scripts/tutorial1_hit_position.cxx+
root -b -q scripts/tutorial2_cell_size.cxx+
popd
#!/bin/bash
git clone https://eicweb.phy.anl.gov/EIC/detectors/athena.git
git clone https://eicweb.phy.anl.gov/EIC/detectors/ip6.git
ln -s ../ip6/ip6 athena/ip6
echo "PART 1: QUICK START"
pushd athena
source /opt/detector/setup.sh
dd_web_display --export athena.xml
popd
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