Skip to content

Instantly share code, notes, and snippets.

@seandavi
Last active July 8, 2020 14:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seandavi/5da4a73d94bc24236cf204196feddc85 to your computer and use it in GitHub Desktop.
Save seandavi/5da4a73d94bc24236cf204196feddc85 to your computer and use it in GitHub Desktop.
Run a Bioconductor Workshop docker image on Google Cloud Platform

Run a Bioconductor Workshop on a Google Cloud Instance

To run one of the workshops for Bioc2020, follow these steps after determining which workshop you'd like to run and finding the docker image name. Substitute the docker image name below for tidytranscriptomics if desired.

Prereqs

  • A google cloud platform account (which you can create with $300 free credit if you don't have one)
  • Installed google cloud sdk (the gcloud command)

Steps

The steps below will start a new virtual machine on google's cloud and then run the bioc workshop docker image associated with tidytranscriptomics. See https://stemangiola.github.io/bioc_2020_tidytranscriptomics/ and https://bioc2020.bioconductor.org/workshops for details and other options, respectively.

A few details of the command below:

  1. specify disk size. The 30G below will give you 20G of working space. Go as large as you like. Do not go below 10G.
  2. Specify machine type. https://cloud.google.com/compute/docs/machine-types. I'd recommend starting with n1-standard-2 or n1-highmem-2.
  3. Specify an Rstudio password of your choosing.
  4. If you are just playing around, consider adding --preemptible below to save some money.
export IMAGE_TO_RUN='stemangiola/bioc_2020_tidytranscriptomics'
gcloud compute instances create-with-container test-bioc \
    --machine-type n1-standard-2 \
    --container-image ${IMAGE_TO_RUN} \
    --scopes=cloud-platform \
    --boot-disk-size 30G \
    --container-env PASSWORD='MYPASSWORD'

Give the step above about 10 minutes.

Then run the following to allow you to connect to your running machine.

gcloud compute ssh test-bioc -- -L 8089:localhost:8787

Then, navigate to http://localhost:8089/ and login with rstudio:MYPASSWORD at the rstudio login screen.

Congratulations! You now have a fully-capable Rstudio instance running on a dedicated machine with all software installed for the workshop.

Costs

The cost is about $0.18/hour with an n1-highmem-2 instance or about $0.04 per hour is you chose to use the --preemptible flag above.

Clean up--very important!!!

Finally, to delete your instance (be sure to do so, or you'll run up charges):

gcloud compute instances delete test-bioc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment