diff --git a/README.md b/README.md index e348ecc..d9dc6d0 100644 --- a/README.md +++ b/README.md @@ -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 - - diff --git a/slurm-gcp/Makefile b/slurm-gcp/Makefile index 9394a38..d8da6a3 100644 --- a/slurm-gcp/Makefile +++ b/slurm-gcp/Makefile @@ -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 diff --git a/slurm-gcp/scripts/z2KS.sh b/slurm-gcp/scripts/z2KS.sh new file mode 100644 index 0000000..41f20df --- /dev/null +++ b/slurm-gcp/scripts/z2KS.sh @@ -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