Skip to content

Commit e10c545

Browse files
authored
Merge pull request #147 from ACCESS-NRI/update_setup
Update setup
2 parents d80d3ec + bbb915f commit e10c545

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

container/container.def

+4-7
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,10 @@ Bootstrap: scratch
3838
mkdir -p ${SINGULARITY_ROOTFS}/var/lib/sss
3939
mkdir -p ${SINGULARITY_ROOTFS}/var/run/munge
4040

41-
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-22.07
42-
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-22.10
43-
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-23.01
44-
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-23.04
45-
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-23.07
46-
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-23.10
47-
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-24.01
41+
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-24.12
42+
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/analysis3-25.01
43+
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/access-med-0.12
44+
mkdir -p ${SINGULARITY_ROOTFS}/opt/conda/esmvaltool-0.5
4845

4946
%runscript
5047
/usr/bin/bash -l

scripts/functions.sh

+17-4
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,31 @@ function write_modulerc() {
8080
module_path="${4}"
8181
module_name="${5}"
8282

83-
cat<<EOF > "${module_path}"/.modulerc
83+
modulerc_file="${module_path}/.modulerc"
84+
85+
# Create a new .modulerc file if it doesn't exist
86+
if [ ! -f "${modulerc_file}" ]; then
87+
touch "${modulerc_file}"
88+
fi
89+
90+
# Remove lines containing the specified module_name
91+
temp_file=$(mktemp)
92+
grep -v "module-version ${module_name}/" "${modulerc_file}" > "${temp_file}"
93+
mv "${temp_file}" "${modulerc_file}"
94+
95+
# Append the new module_version lines
96+
cat <<EOF >> "${modulerc_file}"
8497
#%Module1.0
8598
86-
module-version ${module_name}/${stable} access-med ${env_name} default
99+
module-version ${module_name}/${stable} access-med ${env_name}
87100
module-version ${module_name}/${unstable} ${env_name}-unstable
88101
89102
EOF
90103

91-
set_apps_perms "${module_path}/.modulerc"
92-
104+
set_apps_perms "${modulerc_file}"
93105
}
94106

107+
95108
function symlink_atomic_update() {
96109
link_name="${1}"
97110
link_target="${2}"

scripts/initialise.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ function inner() {
1717

1818
mkdir -p "${CONDA_INSTALLATION_PATH}"
1919
pushd "${CONDA_INSTALLATION_PATH}"
20-
#curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
20+
### Romain Dec 2024, revert to latest micromamba
21+
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
2122
### Modified micromamba for compatibility with nb_conda_kernels
22-
curl -Ls https://dsroberts.github.io/mamba/latest | tar -xvj bin/micromamba bin/activate
23+
#curl -Ls https://dsroberts.github.io/mamba/latest | tar -xvj bin/micromamba bin/activate
24+
2325
popd
2426

2527
mkdir -p "${CONDA_SCRIPT_PATH}"/overrides

0 commit comments

Comments
 (0)