Skip to content

Commit

Permalink
update imi base image to explicitly install gcc in env, use a tagged …
Browse files Browse the repository at this point in the history
…version of spack, and mamba for python dependencies
  • Loading branch information
laestrada committed Dec 7, 2023
1 parent 276a4c0 commit 9b8bc39
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion resources/containers/base-image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Dockerfiles contain a list of instructions to build an image with the necessary
[Docker](https://www.docker.com/) must be installed to run or build IMI docker containers.

## Building the Docker image
To build the docker image, cd into the benchmarks/environments/ directory and run
To build the docker image, cd into the resources/containers/base-image directory and run
`$ docker build -t imi-base-image . --platform=linux/amd64`
The `--platform=linux/amd64` flag specifies the architecture to mimic while building and ensures consistent builds regardless of whether the build is done on an arm system (apple silicon) or amd system (intel).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ spack:
- spec: [email protected]
prefix: /usr
specs:
- cmake@3.22.1
- cmake%[email protected]
- [email protected]%[email protected]
- [email protected]%[email protected]
- [email protected]%[email protected]
- [email protected]%[email protected]
# - [email protected]%[email protected] +lustre +gpfs fabrics=auto
# - [email protected] fabrics=sockets,tcp,udp,efa,mlx,shm
# - [email protected]%[email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ set -e
source /etc/bashrc
spack env activate compute_env

# install mamba for faster installs
conda install -c conda-forge mamba

# install the environment
conda env create -f install-scripts/imi_env.yml
mamba env create -f install-scripts/imi_env.yml
conda activate imi_env
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@ source /etc/bashrc
# name: InstallSpackEnvironment
echo "Downloading spack environment file"
umask 022
# curl $SpackEnvironmentFile -o /spack-manifest.yaml
# . /opt/spack/share/spack/setup-env.sh
cat /home/al2/install-scripts/$SpackEnvironmentFile
spack compiler list

spack env create $SpackEnvironmentName /home/al2/install-scripts/$SpackEnvironmentFile
spack load $SpackCompiler
spack env activate $SpackEnvironmentName
spack install
spack install --fail-fast --show-log-on-error
spack clean --all

# AutomaticallyLoadEnvironmentOnLogin
echo spack load $SpackCompiler >> /etc/bashrc
echo spack env activate $SpackEnvironmentName >> /etc/bashrc
chmod -R +r /opt/spack
10 changes: 8 additions & 2 deletions resources/containers/base-image/install-scripts/install-spack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
set -x
set -e # exit 1 if error

# Spack version to install
SpackVersion="v0.21.0"
# Spack install spec for desired compiler
SpackCompiler="[email protected]"
# Name of spack env
Expand All @@ -12,15 +14,19 @@ SpackEnvironmentName="compute_env"
SpackEnvironmentFile="geoschem_deps-gnu-openmpi-102.yaml"
# InstallSpack
source /etc/bashrc
yum install -y git curl texinfo

yum install -y git curl curl-devel texinfo
yum groupinstall -y "Development tools"
umask 022
# Use spack v0.21.0
git clone https://github.com/spack/spack /opt/spack
(cd /opt/spack && git checkout $SpackVersion)

SPACK_ROOT=/opt/spack
. /opt/spack/share/spack/setup-env.sh
spack compiler find --scope system
spack external find --scope system
spack install $SpackCompiler
spack install --fail-fast $SpackCompiler
spack load $SpackCompiler
spack compiler find --scope system

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

set -e # exit 1 if error

yum install -y emacs wget time jq less glibc which sudo
yum update
yum install -y emacs wget time jq less glibc which sudo curl

# install aws-cli
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Expand Down

0 comments on commit 9b8bc39

Please sign in to comment.