GCP Storage
There are multiple parts to setting up a GCP integration in Encord:
- Start setting up the integration in Encord.
- Grant service account access and register your storage bucket with Encord.
- Set up a CORS configuration.
Ensure all objects in the bucket use the Standard Storage class.
1. Start setting up the integration
- In the Integrations section of the Encord platform, click +New integration to create a new integration and select GCP.
- Give your integration a meaningful title.
2. Grant service account access
-
Log into your Google Cloud account and navigate to the GCP bucket you want to integrate with Encord.
-
Click Grant Access to add a service account for Encord, in the bucket’s PERMISSION tab.
-
Add ‘cord-cloud-storage-integrator@cord-ai-platform.iam.gserviceaccount.com’ as a New Principal and assign the following roles:
Storage Object Viewer
Storage Object Creator
Storage Object Creator
is needed for features that require write permissions, including re-encoding data and creating image sequences.
2.1 Register the cloud bucket with Encord
Paste the name of your GCP bucket into Step 2.1 of the integration in Encord.
3. Create a CORS configuration
A CORS configuration must be applied to the bucket you want to integrate with Encord. A CORS configuration enables Encord to request resources from the specified bucket.
Install Google’s Cloud CLI, and use the following gcloud
command in your command line or terminal to create a CORS configuration.
- Replace <YOUR_BUCKET_NAME> with the name of the bucket you want to integrate.
- Replace
/path/to/you/cors.json
with the full path to your JSON CORS file. A sample JSON file is provided below.
Click Create in Encord to finish creating the integration, after creating a CORS configuration.
JSON configuration file
The following JSON file can be used to set up the CORS configuration in Step 3 of your GCP integration.
- Preflight requests are valid for 1 hour. Use the
maxAgeSeconds
variable to adjust the number of seconds the browser is allowed to make requests before it must repeat the preflight request. - Successful browser requests return the
Content-Type
of the resource in the response, as set by theresponseHeader
.
Consult the GCP documentation, to customize the file further.
4. Testing your integration
Click the Run a test button on the integration to test the integration.
Paste the URL of any object in the bucket and click Check Encord can access this URL. If the test is successful a green tick appears next to Encord infrastructure and This machine.
Upload GCP data
See the Upload cloud data page for guidance on how to upload data stored in GCP.
Was this page helpful?