From 3114378a6f4bbfb5c605a707aa81d543bf7d4c7a Mon Sep 17 00:00:00 2001 From: Timothy Middelkoop Date: Thu, 13 May 2021 10:10:34 -0500 Subject: [PATCH] Add build customization scripts for spack --- slurm-gcp/Makefile | 25 ++++++++++++++----- slurm-gcp/scripts/custom-compute-install.sh | 14 +++++++++++ .../scripts/custom-controller-install.sh | 15 +++++++++++ 3 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 slurm-gcp/scripts/custom-compute-install.sh create mode 100644 slurm-gcp/scripts/custom-controller-install.sh diff --git a/slurm-gcp/Makefile b/slurm-gcp/Makefile index 085c39a..4210f20 100644 --- a/slurm-gcp/Makefile +++ b/slurm-gcp/Makefile @@ -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: diff --git a/slurm-gcp/scripts/custom-compute-install.sh b/slurm-gcp/scripts/custom-compute-install.sh new file mode 100644 index 0000000..da094f5 --- /dev/null +++ b/slurm-gcp/scripts/custom-compute-install.sh @@ -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 <> /etc/profile.d/spack.sh <