How to create HPC Cluster with Slurm scheduler on Google Cloud Platform: Difference between revisions

From PUBLIC-WIKI
Jump to navigation Jump to search
No edit summary
No edit summary
Line 42: Line 42:
* Select a GCP project from the list
* Select a GCP project from the list
* Select a default Compute region and zone
* Select a default Compute region and zone
== Common Google Cloud SDK CLI Commands ==
* Login to Google Cloud Platform:
: '''gcloud auth application-default login --no-launch-browser'''
: Note: The command prompt will show you a link – copy the link to a new browser, login with your GCP project credentials and copy the verification code from the browser to the command prompt
* List all active GCP accounts:
: '''gcloud auth list'''
* Change the active account:
: '''gcloud config set account <Account_Name>'''
: Note: Replace '''<Account_Name>''' with the target GCP account
* Lists all available GCP projects:
: '''gcloud projects list'''
* Change the GCP project:
: '''gcloud config set project "<Project_ID>"'''
: Note: Replace '''<Project_ID>''' with the target GCP project ID
== Git installation phase on Linux (Debian / Ubuntu) ==
* Login to the Linux machine using privileged account
* Run the commands below:
: '''sudo apt-get update'''
: '''sudo apt-get install git-core'''
* Run the command below to view the Git version:
: '''git --version'''
== Git installation phase on Linux (Centos / RedHat) ==
* Login to the Linux machine using privileged account
* Run the commands below:
: '''sudo yum install git'''
* Run the command below to view the Git version:
: '''git --version'''
== Git installation phase on Windows ==
* Login to the Windows machine using privileged account
* Download and install Git from the link below:
: https://gitforwindows.org/

Revision as of 15:52, 7 July 2019

Generating SSH keys for specific accounts (from Linux machine)

  • Login to the Linux machine console.
  • Run the following command to generate the SSH key pair:
ssh-keygen -t rsa -f ~/.ssh/[KEY_FILENAME] -C [USERNAME]
Note 1: Replace KEY_FILENAME with the actual private key file name
Note 2: Replace USERNAME with the user who will use this SSH key to login
  • Change the permissions of the SSH private key using the command below:
chmod 400 ~/.ssh/[KEY_FILENAME]
Note: Replace KEY_FILENAME with the actual private key file name

Generating SSH keys for specific accounts (from Windows machine)

  • Download puttygen.exe from:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
  • Run the puttygen.exe
  • Click Generate and follow the on-screen instructions to generate a new key.
Note: Make sure you create keys with at least 2048 bits
  • In the Key comment section, replace the existing text with the username who will use this key to login to the VM instance.
  • Click Save private key to write your private key to a file with a .ppk extension.
  • Click Save public key to write your public key to a file for later use.

Configure Metadata settings for the VM instances

  • From the upper left pane, click on “Compute Engine”
  • From the left pane, click on “Metadata”
  • From the main pane, under “Metadata” click on Edit -> add new key:
  • Key: enable-oslogin
  • Value: false
  • Click on Save
  • Open the previously created public key (usually it has no file extension) using a text editor and copy its entire content into memory.
  • From the main pane, under “SSH Keys” -> click on Edit -> click on Add item -> paste the content of the public key previously created into the free text field labeled “Enter entire key data” -> click on Save

Google Cloud SDK installation phase

  • Login to a machine using privileged account
  • Install Google Cloud SDK tools.
  • Linux (Debian / Ubuntu):
https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu
  • Linux (CentOS / RedHat):
https://cloud.google.com/sdk/docs/quickstart-redhat-centos
  • Windows:
https://cloud.google.com/sdk/docs/quickstart-windows
  • Run the following from command prompt to initialize the Cloud SDK:
gcloud init --console-only
  • Select a GCP project from the list
  • Select a default Compute region and zone

Common Google Cloud SDK CLI Commands

  • Login to Google Cloud Platform:
gcloud auth application-default login --no-launch-browser
Note: The command prompt will show you a link – copy the link to a new browser, login with your GCP project credentials and copy the verification code from the browser to the command prompt
  • List all active GCP accounts:
gcloud auth list
  • Change the active account:
gcloud config set account <Account_Name>
Note: Replace <Account_Name> with the target GCP account
  • Lists all available GCP projects:
gcloud projects list
  • Change the GCP project:
gcloud config set project "<Project_ID>"
Note: Replace <Project_ID> with the target GCP project ID

Git installation phase on Linux (Debian / Ubuntu)

  • Login to the Linux machine using privileged account
  • Run the commands below:
sudo apt-get update
sudo apt-get install git-core
  • Run the command below to view the Git version:
git --version

Git installation phase on Linux (Centos / RedHat)

  • Login to the Linux machine using privileged account
  • Run the commands below:
sudo yum install git
  • Run the command below to view the Git version:
git --version

Git installation phase on Windows

  • Login to the Windows machine using privileged account
  • Download and install Git from the link below:
https://gitforwindows.org/