-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure controller for K8S and Spack. Increse machine size
- Loading branch information
1 parent
1e9304d
commit df89cc2
Showing
3 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Run on class-controller node. | ||
| # gcloud compute ssh class-controller -- < setup.sh | ||
|
|
||
| echo "=== setup.sh $(hostname) $(date)" | ||
|
|
||
| # TODO: wait for slurm to configure | ||
| # MOTD displays: | ||
| # *** Slurm is currently being configured in the background. *** | ||
|
|
||
| echo "+++ configure" | ||
|
|
||
| CONTROLLER=$(hostname) | ||
| K8S=class-container-cluster | ||
|
|
||
| export ZONE=$(gcloud compute instances list --filter="name=('$CONTROLLER')" --format='value(zone)') | ||
|
|
||
| sudo yum install -y kubectl | ||
| gcloud container clusters get-credentials --zone=$ZONE $K8S | ||
|
|
||
| kubectl get nodes | ||
|
|
||
| echo "+++ spack" | ||
| sudo yum install -y epel-release | ||
| sudo yum install -y git python3 ca-certificates procps curl unzip jq | ||
| sudo yum install -y gcc gcc-c++ make patch file bzip2 xz | ||
|
|
||
| sudo install -dv /apps/spack | ||
| sudo chown $USER /apps/spack | ||
| git clone --depth=1 https://github.com/spack/spack.git /apps/spack | ||
|
|
||
|
|
||
| NODES=$(sinfo -p debug -h -Onodes) | ||
| CPUS=$(sinfo -p debug -h -Ocpus) | ||
|
|
||
| cat > build-spack.sh <<EOF | ||
| #!/bin/bash | ||
| echo "+++ \$(hostname) \$(date) \$SLURM_JOB_ID CPUS:\$SLURM_CPU_PER_TASK" | ||
| . /apps/spack/share/spack/setup-env.sh | ||
| srun -n $NODES --exclusive spack install lmod python py-pip miniconda3 | ||
| EOF | ||
| sbatch -N $NODES --exclusive ./build-spack.sh | ||
|
|
||
| # for I in class-compute-0-{0..7} ; do echo $I ; ssh -o stricthostkeychecking=no $I ps -fe \| grep spack ; done | ||
|
|
||
| echo "=== setup.sh $(hostname) $(date) done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| gcloud compute ssh class-controller -- < scripts/controller.sh |