Skip to content

Google Cloud setup

Eric Carmichael edited this page Apr 10, 2018 · 13 revisions

NOTE: This is a very simple setup

VM

Setup your VM with docker and docker-compose, you can do this quickly with:

$ curl https://get.docker.com | sudo sh
$ sudo usermod -aG docker $USER
# and then re-login

Checkout the repo on the google-cloud-storage branch and prepare configuration:

$ git clone https://github.com/codalab/codalab-competitions.git
$ cd codalab-competitions
$ git checkout google-cloud-storage
$ cp .env_sample .env

Ports

Make sure your VM has the relevant ports open:

  • RABBITMQ_PORT
  • SSL_PORT

Storage

Create 2 buckets, 1 public and 1 private, for example:

  • coda-private
  • coda-public

coda-private

Set bucket permissions so it is not publicly readable.

Set this CORS configuration:

[
    {
        "origin": ["*"],
        "responseHeader": ["Content-Type"],
        "method": ["GET", "PUT", "OPTIONS", "HEAD"],
        "maxAgeSeconds": 3600
    }
]

coda-public

Set the public to publicly readable by all users:

image

Configure .env

Configure these lines in your .env

# Google Cloud Storage
DEFAULT_FILE_STORAGE=apps.web.storage.CodalabGoogleCloudStorage
GS_PUBLIC_BUCKET_NAME=coda-public
GS_PRIVATE_BUCKET_NAME=coda-private
GOOGLE_APPLICATION_CREDENTIALS=/app/certs/google-storage-api.json

This assumes your google-storage-api.json api credentials are in the <project root>/certs directory.

More:

SSL

Email

Clone this wiki locally