Skip to content

Google Cloud Image

Eric Carmichael edited this page Oct 31, 2017 · 3 revisions

This page explains how to run an Ubuntu virtual machine on Google Cloud already fully pre-configured with Codalab on it. Once configured and launched, your virtual machine runs a web server through which you can access your own instance of Codalab. We explain how you can configure it to open the necessary ports for HTTP and HTTPS (i.e. to use SSL for more secure access).

1. First get familiar with Google Cloud

Video: Intro and creating a virtual machine - Google Cloud Python Tutorials p.1

2. Run the following image: codalab-competitions-v15

Go to the VM Images page and search for codalab-competitions-v15. Click the link to codalab-competitions-v15 and then click the "Create Instance" button to begin creating an instance from this image.

Before clicking "create" make sure you check "Allow HTTP Traffic" (or HTTPS if you're using SSL).

3. Configure your machine for web access


Opening Ports

  1. Click on the instance name on the instance list page
  2. Click the "Edit" button on the top of the page
  3. Scroll to "Firewalls" and check "Allow HTTP Traffic" (or HTTPS if you're using SSL).

Editing .env file

Connect to the server (you can do this via your terminal or the SSH button on the instances page), then:

cd src/codalab-competitions
git pull

You should have now the latest version of Codalab.

ls -la

You should see a .env file, which contains the Codalab configuration. You will need to edit that file with your favorite editor (vim comes with Ubuntu. If you need emacs, use sudo apt-get install emacs).

The default way to access a Google Cloud instance is via the "External IP" which is listed on the instance in the instance list.

image

Edit the .env file: go to the CODALAB_SITE_DOMAIN field and put your DNS, e.g.:

CODALAB_SITE_DOMAIN=example.com

Save the file and exit. Then run:

docker-compose up -d

Every time you edit .env file you must restart the services, i.e. run docker-compose down then docker-compose up -d.

You should be now able to access the codalab website at your DNS/External IP.

WARNING: Running a server via HTTP is unsafe. To run HTTPS, you need to enable SSL.

Enabling SSL

  1. Get a certificate (for free certificates, type get free ssl certificate in Google).
  2. To enable SSL, follow these instructions.
  3. Make sure that HTTP redirects to HTTPS e.g. http://example.com redirects to https://example.com. This should be the default, but double-check.

YOU ARE NOT DONE!

Now you need to configure storage. Codalab needs cloud storage on AWS or Azure to properly function. Without it, no data can be uploaded/stored/downloaded.

Clone this wiki locally