Skip to content

Commit

Permalink
Merge pull request #1 from MiddelkoopT/tm-spack-profile
Browse files Browse the repository at this point in the history
Add build customization scripts for spack
  • Loading branch information
tmiddelkoop authored and GitHub committed May 13, 2021
2 parents bdd8c9f + 3114378 commit 02ba02d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 6 deletions.
25 changes: 19 additions & 6 deletions slurm-gcp/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
#
#
# I2 Capstone Project
# Allissa Dillman, Ananya Ravipati, Bala Desinghu, Tony Cricell, John Hicks, Timothy Middelkoop
#
.PHONY: init plan apply destroy

init:
# Location of https://github.com/SchedMD/slurm-gcp scripts folder
SCRIPTS=../../slurm-gcp/scripts

.PHONY: scripts init validate plan apply destroy

scripts: ${SCRIPTS}/custom-controller-install ${SCRIPTS}/custom-compute-install

# Customizations of the build scripts.
${SCRIPTS}/custom-controller-install: scripts/custom-controller-install.sh
ln -sfn $$PWD/scripts/custom-controller-install.sh ${SCRIPTS}/custom-controller-install

# Login node uses the custom-compute-install script
${SCRIPTS}/custom-compute-install: scripts/custom-compute-install.sh
ln -sfn $$PWD/scripts/custom-compute-install.sh ${SCRIPTS}/custom-compute-install

init: scripts
terraform init

validate:
validate: scripts
terraform validate

plan:
plan: scripts
terraform plan -var-file=basic.tfvars -var-file=local.tfvars -out terraform.tfplan

apply:
apply: scripts
terraform apply -var-file=basic.tfvars -var-file=local.tfvars -auto-approve

destroy:
Expand Down
14 changes: 14 additions & 0 deletions slurm-gcp/scripts/custom-compute-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

## Run on the CLASS Slurm Compute node on build.

echo "=== custom-compute-install.sh $(hostname) $(date)"

echo "+++ spack"
cat >> /etc/profile.d/spack.sh <<EOF
if [ -d /apps/spack ] ; then
source /apps/spack/share/spack/setup-env.sh
fi
EOF

echo "=== custom-compute-install.sh $(hostname) $(date) Done"
15 changes: 15 additions & 0 deletions slurm-gcp/scripts/custom-controller-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

## Run on the CLASS Slurm Controller node on build.
# Lightweight and hard-to-do in the ssh based configuration scripts.

echo "=== custom-controller-install.sh $(hostname) $(date)"

echo "+++ spack"
cat >> /etc/profile.d/spack.sh <<EOF
if [ -d /apps/spack ] ; then
source /apps/spack/share/spack/setup-env.sh
fi
EOF

echo "=== custom-controller-install.sh $(hostname) $(date) Done"

0 comments on commit 02ba02d

Please sign in to comment.