Skip to content
Permalink
Browse files
Merge remote-tracking branch 'origin/tc-scripts-1' into main
  • Loading branch information
tmiddelkoop committed May 11, 2021
2 parents d0b9cc2 + 5fd6b52 commit 11489a7a271e7eb76f84843eeb56a11c5aebb351
Showing 3 changed files with 70 additions and 7 deletions.
@@ -1,7 +1,12 @@
# CLASS-HPC-GCP
Internet2 CLASS Capstone Project, HPC-GCP Team

It is convenient to deploy an HPC cluster on the GCP cloud using terraform scripts. The scripts are inside the directory slurm-gcp. You need to edit the scripts - basic.tfvars and main.tf. For a basic deployment, it is sufficient to redefine a few variables such as project name, cluster name, etc. Of course, you can fine tune the variables and scripts to fit your needs.
It is convenient to deploy an HPC cluster on the GCP cloud using
terraform scripts. The scripts are inside the directory slurm-gcp. You
need to edit the scripts - basic.tfvars and main.tf. For a basic
deployment, it is sufficient to redefine a few variables such as
project name, cluster name, etc. Of course, you can fine tune the
variables and scripts to fit your needs.

* Create a GCP Project (for example, class-capstone)
* Go to API services and enable the API for compute engines and deployment manager
@@ -19,5 +24,3 @@ It is convenient to deploy an HPC cluster on the GCP cloud using terraform scrip
Note that the minimal disk-size is 20 GB to accommodate the size of the VM. If you wan’t more than 20 GB, that’s okay.

The above steps are explained in the document page: https://cloud.google.com/architecture/deploying-slurm-cluster-compute-engine


@@ -1,10 +1,24 @@
.PHONY: plan apply destroy
#
#
# I2 Capstone Project
# Allissa Dillman, Ananya Ravipati, Bala Desinghu, Tony Cricell, John Hicks, Timothy Middelkoop
#
.PHONY: init plan apply destroy

init:
terraform init

validate:
terraform validate

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

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

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

show:
terraform show
@@ -0,0 +1,46 @@
#!/bin/sh
#
# CLASS-HCP-GCP
#
#
#

GCLOUDUSER=""
PROJECT_ID=""
SAUSER=""
ZONE=""
FOLDER_ID=""

gcloud config set account $GCLOUDUSER
gcloud projects create $PROJECT_ID --folder=$FOLDER_ID
sleep 30
gcloud config set project $PROJECT_ID
gcloud services enable compute.googleapis.com iam.googleapis.com kubernetes.googleapis.com file.googleapis.com
gcloud iam service-accounts create $SAUSER --display-name "Tony Terraform"
gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:$SAUSER@$PROJECT_ID.iam.gserviceaccount.com --role='roles/editor'
gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:$SAUSER@$PROJECT_ID.iam.gserviceaccount.com --role='roles/iam.securityAdmin'
gcloud iam service-accounts keys create $SAUSER-credentials.json --iam-account=$SAUSER@$PROJECT_ID.iam.gserviceaccount.com
echo "$SAUSER-credentials.json" >>.gitignore
echo "local*" >>.gitignore
echo " Initialize Terraform"
make init
sleep 30
echo " Validating Terraform input files "
make validate
sleep 30
echo " Running Terraform plan"
make plan
sleep 30
echo " Applying Terraform plan"
make apply

#
#
# commands to run after the cluster is made.
#
# gcloud compute instances list
# gcloud beta compute ssh --zone "$ZONE" "class-login0" --project "$PROJECT_ID"
# sinfo
# srun hostname
# sinfo
# make destroy

0 comments on commit 11489a7

Please sign in to comment.