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

Merge branch 'staging' into 'master'

Bugfix: more consistent treatment of environment variables throughout container.

See merge request !7
parents 1ca34f96 ff13f781
Branches
No related tags found
1 merge request!7Bugfix: more consistent treatment of environment variables throughout container.
...@@ -48,6 +48,7 @@ config_stable: ...@@ -48,6 +48,7 @@ config_stable:
- bash containers/release/configure_release.sh - bash containers/release/configure_release.sh
artifacts: artifacts:
paths: paths:
- config/spack-env.sh
- config/eic-env.sh - config/eic-env.sh
- config/Dockerfile - config/Dockerfile
config_unstable: config_unstable:
...@@ -63,6 +64,7 @@ config_unstable: ...@@ -63,6 +64,7 @@ config_unstable:
- bash containers/release/configure_release.sh - bash containers/release/configure_release.sh
artifacts: artifacts:
paths: paths:
- config/spack-env.sh
- config/eic-env.sh - config/eic-env.sh
- config/Dockerfile - config/Dockerfile
...@@ -76,6 +78,7 @@ release_stable: ...@@ -76,6 +78,7 @@ release_stable:
- staging - staging
script: script:
- cp config/Dockerfile containers/release/Dockerfile - cp config/Dockerfile containers/release/Dockerfile
- cp config/eic-env.sh containers/release/eic-env.sh
- cd containers/release - cd containers/release
- make login - make login
- make release-cached - make release-cached
...@@ -89,6 +92,7 @@ release_unstable: ...@@ -89,6 +92,7 @@ release_unstable:
- staging - staging
script: script:
- cp config/Dockerfile containers/release/Dockerfile - cp config/Dockerfile containers/release/Dockerfile
- cp config/eic-env.sh containers/release/eic-env.sh
- cd containers/release - cd containers/release
- make login - make login
- make develop-cached - make develop-cached
......
...@@ -30,10 +30,6 @@ ENV DOCKERFILE_DISTRO=ubuntu \ ...@@ -30,10 +30,6 @@ ENV DOCKERFILE_DISTRO=ubuntu \
COPY --from=builder /opt/spack-environment /opt/spack-environment COPY --from=builder /opt/spack-environment /opt/spack-environment
COPY --from=builder /opt/software /opt/software COPY --from=builder /opt/software /opt/software
COPY --from=builder /opt/view /opt/view COPY --from=builder /opt/view /opt/view
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh
## Setup fresh bashrc, useful for singularity
COPY bashrc /etc/bash.bashrc
COPY bashrc /root/.bashrc
## Symlink /opt/view to /usr/local ## Symlink /opt/view to /usr/local
## Maybe in a future release we should install the view directly to /usr/local ## Maybe in a future release we should install the view directly to /usr/local
...@@ -46,7 +42,12 @@ RUN rm -rf /usr/local && ln -s /opt/view /usr/local ...@@ -46,7 +42,12 @@ RUN rm -rf /usr/local && ln -s /opt/view /usr/local
## eic-shell and environment scripts. Not strictly needed anymore now we auto-load ## eic-shell and environment scripts. Not strictly needed anymore now we auto-load
## the environment but still provided for backward compatibility (and documentation). ## the environment but still provided for backward compatibility (and documentation).
COPY eic-shell /usr/local/bin/eic-shell COPY eic-shell /usr/local/bin/eic-shell
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/eic-env.sh COPY eic-env.sh /etc/eic-env.sh
COPY eic-env.sh /etc/profile.d/z10_eic-env.sh
## Setup fresh bashrc, useful for singularity
COPY bashrc /etc/bash.bashrc
COPY bashrc /root/.bashrc
## make sure we have the entrypoints setup correctly ## make sure we have the entrypoints setup correctly
ENTRYPOINT [] ENTRYPOINT []
......
...@@ -7,18 +7,20 @@ ...@@ -7,18 +7,20 @@
mkdir -p config mkdir -p config
## Extract the desired environment variables as defined by spack cp /etc/profile.d/z10_spack_environment.sh config/spack-env.sh
grep export /etc/profile.d/z10_spack_environment.sh | \
sed 's/export / /' | \
sed 's/;$/ \\/' > config/eic-env.sh
## ensure we also have /lib/x86_64-linux-gnu in our library path ## ensure we also have /lib/x86_64-linux-gnu in our library path
## as it contains important ubuntu system libraries ## as it contains important ubuntu system libraries
sed -i "s?LD_LIBRARY_PATH=?&/lib/x86_64-linux-gnu:?" config/eic-env.sh sed -i "s?LD_LIBRARY_PATH=?&/lib/x86_64-linux-gnu:?" config/spack-env.sh
## 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/eic-env.sh sed -i '/MANPATH/ s/;$/:;/' config/spack-env.sh
## Extract the desired environment variables as defined by spack
grep export config/spack-env.sh | \
sed 's/export / /' | \
sed 's/;$/ \\/' > config/eic-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 | \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment