Google Cloud - ncbi/fcs GitHub Wiki

Setting up an instance on Google Cloud Platform (GCP)

Google Cloud Platform (GCP) is where all of Google’s cloud services are located and available via the Google Cloud console page. To create your virtual machine (VM) instance, you first need to access the Compute Engine service on GCP.

Overview

This guide will help you create a basic VM instance you can use to become familiar with GCP’s Compute Engine process, including helpful tips on creating your sample instance. NCBI's FCS tools vary in requirements: FCS-adaptor can run in Google Cloud Shell, whereas FCS-GX needs a bigger VM. Therefore, this document will primarily focus on setting up a VM for FCS-GX.

Signing in and entering the GCP console

Sign in using your GCP Console account.

Creating a GCP instance

Click on the Create Instance button on the top header of your account page and this will direct you to the instance configuration page. Now create a Name for your instance.
Tip: include your login name as an easy way to track your VM.

Settings

Under the respective drop-down menus, select your geographical Region and time Zone to create the instance.

Machine configuration

Under the respective drop-down menus for Series and Machine type, select "n2" and "n2-highmem-64."
Note: this is where you can change the CPU and RAM requirements for your instance.
Tip: the right side of the page also includes a link to view Google's most recent Compute Engine pricing.

Boot disk

Change the boot disk to 470GB to ensure enough space to store the test-only and the all DBs.
Note: this is where you can change the amount of disk space to which you have access.

Save and create

Click on the Create button at the bottom of the page.

Connecting to an instance

To connect to your instance, follow Google's guide on connecting to instances using Google tools.
Next, run the following command from your Unix terminal:

gcloud compute ssh --zone "us-central1-a" "<instance name>"  --project "<project name>"

Once connected, you can work in a Unix-like command-line environment.

Installing Docker

You can now install Docker to run FCS-GX.

  • To install Docker, follow the Docker guide to installing Docker on Debian.
  • The steps required are as follows:
    sudo apt-get remove docker docker-engine docker.io containerd runc
    
    sudo apt-get update
    sudo apt-get install \
        ca-certificates \
        curl \
        gnupg \
        lsb-release
    
    sudo mkdir -p /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    
    echo \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
      $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    
    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
    
    sudo docker run hello-world
    
    sudo groupadd docker
    sudo usermod -aG docker $USER
    
  • Log out and log back in so Docker can re-evaluate your membership.
  • Next, verify that you can run Docker commands without sudo commands by running:
    docker run hello-world
    

Running FCS tools

To run FCS tools on your VM, please follow the instructions under FCS-adaptor or FCS-GX. Once you are done, please copy your files to your GCPbucket or to your local directory.

Copying files to and from a VM

Save your output files to your GCP bucket, and then to a local directory prior to deleting a VM.

  • You can do this using gsutil.
  • To save to a bucket, run the following script from the VM:
    gsutil cp *.txt gs://my-bucket
    
  • To save to a local directory, run the following script from your local terminal:
    gsutil cp gs://my-bucket/*.txt .
    
  • Similary, you can copy from your local directory to the bucket, and then to the VM.
  • You can also transfer files without the bucket. To do this, you can copy files to the VM from your local terminal, or from the VM to a local directory by running the following scripts, respectively:
    gcloud compute scp test.txt username@instance_name:test.txt --zone=<zone>
    gcloud compute scp username@instance_name:test.txt ./testfromVM.txt --zone=<zone> 
    

Stopping your instance

To stop your instance, you must click on Stop once you finish your work.

Useful resources

Here are some links you may find useful for more information on the Google Cloud Platform and creating VM instances:

⚠️ **GitHub.com Fallback** ⚠️