-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstageSpackEnvironments.sh
More file actions
executable file
·31 lines (27 loc) · 1.24 KB
/
stageSpackEnvironments.sh
File metadata and controls
executable file
·31 lines (27 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
#SBATCH --output /shared/home/root/scripts/logs/stageSpackEnvironments-%j.log
#SBATCH --error /shared/home/root/scripts/logs/stageSpackEnvironments-%j.log
# This script iterates through installed OOD apps and looks for a folder in each
# app called "spack-environment". If this folder is found, it copies its
# contents into the target environment directory. The "spack-environment" folder
# is expected to contain 1 or more directories, each containing a "spack.yml"
# file defining the environment named in its parent folder. This script can set
# the stage for the `environmentOrchestration.sh` script when run on the portal
# node. The actual orchestration script needs to be run on the head node or a
# compute node, so that the packages in the environments get configured
# correctly.
# Set OOD apps directory
appdir="/var/www/ood/apps/sys"
envdir="/shared/home/root/environments"
# Ensure target directory exists
mkdir -p /shared/home/root/environments
# iterate through apps
for folder in "$appdir"/*; do
if [ -d "$folder" ]; then
# check if 'spack-environment' subfolder exists
if [ -d "$folder/spack-environment" ]; then
# set up environment
cp -r $folder/spack-environment/* /shared/home/root/environments
fi
fi
done