DocumentationRecipesReferenceGraphQLChangelog
Log In

Creating a GCP Cloud Storage integration

To use remote files in projects, you must first create an integration. Then in each one of your projects, you can define a connector between the integration and the project.

πŸ“˜

Only organization admins can manage remote integrations.

To create a GCP Cloud Storage integration:

  1. Configure your GCP bucket
  2. Connect your GCP bucket to Kili

🚧

Path restrictions are not yet available for GCP.



Configuring your GCP bucket

You must properly configure your Google Cloud Storage bucket to use it with Kili. To do that, complete these two tasks:

  1. Setting the IAM permissions: from the UI or programmatically
  2. Setting the CORS

Setting IAM Permissions from the UI

  1. From your GCP account, go to your Google Cloud Storage bucket.
  2. In the Permissions section, click Add permissions.
  3. In the New principals field paste the address of the Kili service account: [email protected]
  4. Under Role, select the native Storage Object Viewer role. This grants Kili read permissions in your bucket.
Granting Kili's service account with **Storage Object Viewer** role on your bucket

Granting Kili's service account with Storage Object Viewer role on your bucket

  1. Click Save.

Setting IAM Permissions programmatically

πŸ“˜

You can set permissions programmatically by using GSUTIL in your terminal, or in the GCP console by using the Cloud Shell. The commands are the same.

gsutil iam ch serviceAccount:[email protected]:objectViewer gs://<bucket-name>

Replace <bucket-name> with your Cloud Storage bucket name.

Setting up CORS

You must set up CORS on the bucket. Otherwise assets will not load in the Kili UI.

πŸ“˜

You can set up CORS by using GSUTIL in your terminal, or in the GCP console by using the Cloud Shell. The commands are the same.

  1. Create a JSON configuration file for the CORS:
echo '[{"origin":["https://cloud.kili-technology.com"],"method":["GET"],"responseHeader":["*"]}]' > cors-config.json

echo '[{"origin":["https://cloud.eastus.kili-technology.com"],"method":["GET"],"responseHeader":["*"]}]' > cors-config.json
  1. Apply the configuration to your bucket:
gsutil cors set cors-config.json gs://<bucket-name>
  1. Check that the configuration is correctly applied:
gsutil cors get gs://<bucket-name>


Connecting your GCP bucket to Kili

  1. In Kili, click on your name in the top-right corner of the Kili app interface, and then go to Organization Management > Integrations.
  2. Click New.
  3. Select Google Cloud Platform.
  4. Name your integration and paste your GCP Cloud Storage bucket name .
  1. (Optional) Tick the I authorize Kili Technology to process my files on its servers to enable features that require such processing checkbox.

πŸ‘

You are now ready to synchronize data with a project.