Get started

This page walks you through the setup steps required to use the Cloud Life Sciences API.

(If you've completed the Quickstart, you've already done some of these steps. Review this page to make sure you're ready to use the Cloud Life Sciences API).

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Cloud Life Sciences API.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

  7. Enable the Cloud Life Sciences API.

    Enable the API

Understand service accounts and default roles

When you run a pipeline for the first time (using the gcloud CLI or the RPC and REST APIs), the following authentication steps occur:

  1. A service account called the Cloud Life Sciences Service Agent service account is created.
  2. The service account is automatically assigned the default role lifesciences.workflowsRunner. The role enables starting and stopping Compute Engine instances inside your project.

If you later remove the default role from the relevant project service account, you might encounter the following errors:

  • Attempts to run pipelines using the API result in permission errors. To fix this issue, see Troubleshooting.
  • The API cannot shut down running instances when pipelines complete, and you will continue to be billed for these resources. To fix this issue, see Troubleshooting.

Set up Google Cloud CLI and the Google Cloud CLI

Install Google Cloud CLI to use the tools and libraries in Cloud Life Sciences, Compute Engine, Cloud Storage, and BigQuery. The SDK includes the gcloud, gsutil, and bq command-line tools.

  1. Download and install Google Cloud CLI.

  2. Initialize Google Cloud CLI.

  3. After you've initialized the SDK, install the Cloud Life Sciences components:

    gcloud components update beta
    

    If you're using a Compute Engine VM with the default installation of the gcloud CLI, you can't install the components using the previous command. To enable the Cloud Life Sciences API on a Compute Engine VM, reinstall the gcloud CLI by running the following commands:

    sudo apt-get remove google-cloud-sdk
        curl https://sdk.cloud.google.com | bash
        exec -l $SHELL
        gcloud init
    

Download credentials for API access

You must download a service account key file for your project if you are using either of the following methods to access the Cloud Life Sciences API:

  • A code sample from the Cloud Life Sciences GitHub repository
  • A tool other than the Google Cloud CLI that accesses the Cloud Life Sciences API directly

Complete the following steps to create a service account key file:

  1. Go to the Credentials page in Google Cloud console.

    Go to the Credentials page

  2. Click Create credentials > Service account.

  3. On the Service account details page, enter a service account name, and then click Create.

  4. In the Grant this service account access to project tab, select the role for the service account. For the broadest access to Cloud Life Sciences, select Cloud Life Sciences > Cloud Life Sciences Workflows Runner, and then click Continue.

  5. (Optional) Fill out the Grant users access to this service account tab.

  6. Click Done.

To download the service account key, complete the following steps:

  1. Go to the Service Accounts page in Google Cloud console.

    Go to the Service Accounts page

  2. Find the row of the service account that you want to create a key for. In that row, click , and then click Manage keys.

  3. On the Keys page, click Add key, and then click Create new key.

  4. Select JSON for the Key type and click Create.

Clicking Create downloads a service account key file. Make sure to store this file securely, because it can be used to authenticate as your service account. You can move and rename this file.

What's next