Getting 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 Cloud project. Learn how to confirm that billing is enabled for your project.

  4. Enable the Cloud Life Sciences API.

    Enable the API

When you run a pipeline for the first time (using the gcloud tool or the RPC and REST APIs) in a Google Cloud project, a new service account for the project is automatically assigned a role (lifesciences.workflowsRunner) that enables starting and stopping Compute Engine instances inside your project.

If you later remove this default role from the relevant project service account, you might encounter errors. In particular, attempts to run pipelines using the API will result in permission errors. The API will also be unable to shut down running instances when pipelines complete and you will continue to be billed for these resources. For details on how to fix this issue, see Troubleshooting.

Set up Cloud SDK and the gcloud command-line tool

Install Cloud SDK 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 Cloud SDK.

  2. Initialize Cloud SDK.

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

    gcloud components update beta
    

    If you're using a Compute Engine VM with the default installation of gcloud tool, you won't be able to update the components. To enable the Cloud Life Sciences API on a Compute Engine VM, reinstall gcloud command-line tool 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

If you are using a code sample from the Cloud Life Sciences GitHub repository or a tool other than the gcloud command-line tool that accesses the Cloud Life Sciences API directly, complete the following steps to download a service account key file for your project.

  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 Cloud project. Learn how to confirm that billing is enabled for your project.

  4. Enable the Cloud Life Sciences and Cloud Storage JSON APIs.

    Enable the APIs

  5. Open the Credentials page in the API console.
  6. Click Create credentials > Service account.
  7. On the Service account details page, enter a service account name, and then click Create.
  8. 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.
  9. Optional: Fill out the Grant users access to this service account tab.
  10. Click Done.

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

  1. In the Cloud Console, go to the Service Accounts page.

    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 the , 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 however you would like.

What's next