Log in to FlakeHub from Google Cloud Platform (GCP)
Use Google Cloud Platform’s Identity and Access Management to log in to a FlakeHub organization and access private flakes and artifacts cached in FlakeHub Cache without managing tokens.
Security considerations
Authenticating to FlakeHub with a GCP Service Account currently grants read-only privileges to all sources and cached artifacts in the associated FlakeHub organization. FlakeHub only needs the Service Account’s email address to authenticate.
Setup
Identify the service account
Look up the service account for your GCP resource. You can find this in the console, or through the metadata API:
curl -H 'Metadata-Flavor: Google' \
http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/emailThe account identifier should look something like this:
123456789-compute@developer.gserviceaccount.comRegister the trust relationship
Register the Service Account email under the GCP IDs section of your FlakeHub organization’s settings at the URL with this form:
https://flakehub.com/:org/settings?editview=gcp-ids
staticrequired
Give the trust relationship a short name, such. as dev/ephemeral-vm.
These names can be alphanumeric and can contain dashes and up to one slash.
Click Add.
Copy the Full Resource Name
The Full Resource Name (FRN) is used by Determinate Nixd to identify the trust relationship. It should look something like this:
frn:flakehub:gcp-delegated:DeterminateSystems::dev/ephemeral-vmLog in from within GCP
Once the initial setup is complete, you can log in:
determinate-nixd login gcp \
--frn frn:flakehub:gcp-delegated:DeterminateSystems::dev/ephemeral-vmDeterminate is now authenticated with FlakeHub using the bound Service Account.