Skip to content
DocsAll docs
Console

Connectors

Link GitHub, GitLab, Hugging Face or a container registry to a person or a team, so pipelines, workspaces, builds and environments use it.

Last updated

On this page

Description and operation

General

A connector links one provider account to an owner. The owner is a person or a team. Pipelines use the link without a token that you paste.

GitHub is the first provider, and container registries are the second. A connector installs the Kloudlite GitHub App on your GitHub account or organization. Kloudlite keeps no GitHub token. It asks GitHub for a short-lived token when a job needs one.

PartWhat it is
ConnectorThe link between an owner and one GitHub account. It has a name, such as acme-github-1.
Stateconnected, expired or revoked. Only a connected connector works.

A person's connector belongs to that person. A team's connector belongs to the team. Any active member can list the connectors of a team. Only a team admin or owner can connect or disconnect.

Hugging Face is the second provider. See Hugging Face.

A GitHub account connects to one owner. A second owner that connects the same account gets the error This GitHub account is already connected to another owner.

To do these tasks with an AI agent, see Agentic workflows – General.

What Kloudlite reads and writes

A GitHub or GitLab connector gives git read access to the pipeline jobs of its owner. It also gives git read access to the workspaces, benches and sandboxes of its person. A team connector gives it to those of every member of the team. The own connector of a member comes first. Kloudlite writes nothing to the provider.

RightUse
Read repository contentsgit clone and git fetch over HTTPS in a job with permissions.git: read, a workspace, a bench or a sandbox. See Git in pipeline jobs.

A provider event, such as a push or a pull request, starts no run. A run starts by hand, on a schedule, from a webhook or after another pipeline.

Hugging Face

A Hugging Face connector links one Hugging Face account to an owner. You sign in on Hugging Face and approve the Kloudlite app. The app asks for the scopes openid, profile, read-repos and write-repos. An owner has one Hugging Face connector. A second connect answers OWNER already has a Hugging Face connector.

A connector has one of two levels. The level is set by the owner that connects.

LevelWho connectsWho gets the token
AccountA team admin, for the teamThe pipeline jobs and the services of the team. The workspaces of team members who connected no account of their own.
UserYou, for yourselfYour workspaces, sandboxes and benches. In a team, your token comes before the token of the team.

A pipeline job of a team never gets the token of a member.

The token is the environment variable HF_TOKEN. Kloudlite stores it as a secret that the connector manages. You cannot set or delete it with the secret commands. They answer HF_TOKEN is managed by connector NAME. If the env of a resource names HF_TOKEN, your value is used and the connector adds nothing.

Kloudlite refreshes the token before it expires. A process that runs keeps the token that it had at its start. A refresh restarts nothing and sets no restart_required. A resource that starts later has the new token. A disconnect deletes the HF_TOKEN secrets of the connector.

GitLab

A GitLab connector links one gitlab.com account to an owner. You sign in on GitLab and approve the Kloudlite app.

After you connect, pick the projects to use in the Projects list of the connector. The list shows your projects, most recently active first. Type in the search box to narrow the list. Select Load more for the next fifty.

Kloudlite lists only the projects where you are a Maintainer or Owner. It needs that role to make deploy tokens. If the list is empty, you hold no such project on this account.

Tick a project to use it, and select Save projects. Each git credential request makes a read-only deploy token on the ticked project. The token ends one hour after the request at most. Nothing revokes it when the job ends.

Clear the box of a project to remove its tokens. A save also removes a webhook that an earlier version made. The projects that you picked stay ticked while you search. If a save fails, the page shows the reason that Kloudlite gives.

If the list cannot load, the page shows a box where you type the project as group/name.

Connect and reconnect

You connect in the web console. A terminal cannot show the consent page of GitHub, so no command connects an account. The console shows each connector as connected, expired or revoked.

A connector becomes expired or revoked when GitHub removes the installation or the sign-in stops working. The console then shows Reconnect. The connector keeps its name.

Disconnect

A disconnect removes the connector. Kloudlite uninstalls the app when it can, and deletes the stored data of the connector. A git command of a running job then gets no credential, and the log shows kl git-credential: no git connector of OWNER covers HOST/REPOSITORY. A registry login of a running job fails with connector NAME is gone.

Git in pipeline jobs

A job with permissions.git: read runs plain git clone https://github.com/OWNER/NAME in a step. Git asks the Kloudlite credential helper for a credential each time, and the helper asks Kloudlite.

HostConnectorCredential
github.comThe GitHub connector of the account in the path.A token for every repository that the app is installed on, with read access. It lasts one hour.
gitlab.comThe GitLab connector that picked the project.A read-only deploy token on that one project. It lasts one hour at most.
WARNING

A job with git: read can read every repository that the GitHub App is installed on, a webhook run included. Install the app only on the repositories that pipelines need.

The credentials are HTTPS only and read only. A pipeline of a team uses only the connectors of the team. Kloudlite makes no credential for other hosts. For them, put a personal access token from a Kloudlite secret in the clone URL. A pull request cannot change the pipeline that tests it, because a pipeline is not stored in a repository. The rules and their errors are in Code in a job.

Container registries

A registry connector holds a login for a container registry. The registries are Docker Hub, GitHub Container Registry (GHCR), Azure Container Registry (ACR), Amazon ECR, Google Artifact Registry (GAR) and other OCI registries. You paste the credential in the console. Kloudlite signs in to the registry with it before it keeps anything. For a pasted login, it signs in again every hour. A registry that refuses the credential turns the connector to expired.

ProviderHostLeast credential
Docker Hubdocker.ioAn access token with Read & Write on the one repository that you push to.
GHCRghcr.ioA personal access token with the scope write:packages, and your GitHub user name.
ACRNAME.azurecr.ioA token with a scope map for the one repository.
Amazon ECRACCOUNT.dkr.ecr.REGION.amazonaws.comAn IAM role with an external ID, and an access key that can only assume it.
GARREGION-docker.pkg.devA service account with the role roles/artifactregistry.writer on the one repository.
Another OCI registryAny host nameA robot account for the repositories that you use.

A broader credential works. The choice is yours. Kloudlite never shows the secret again.

For Amazon ECR and GAR, the credential that you paste is a root credential. Kloudlite never hands it out. It keeps the root credential. It asks AWS or Google for a short login each time that a build, a pull or a job needs one. An ECR login lasts 12 hours. A GAR login lasts 1 hour.

For ECR without a role, give the access key ecr:GetAuthorizationToken on all resources. Also give it the push and pull actions on the named repositories only. The console shows the full policy.

Kloudlite does not sign in to GHCR through the GitHub connector until a superadmin turns it on. Until then, paste a personal access token.

UseConnector that it takes
kl container build and kl container push in your workspaceYours first, then the connectors of the team of the workspace.
An environment that pulls a private imageThose of the team that owns the environment.
A pipeline job with permissions: { registry: push }Those of the owner of the pipeline.

The connector of another member is never used. kl and docker-credential-kl ask Kloudlite for a login each time, so a workspace holds no registry secret. With no registry connected, the commands answer no registry is configured.

Tasks

Connect GitHub

Reason for the task: Link a GitHub account or organization to a person or a team.

Job set-up

  • Access: you. For a team, a team member with the role admin or higher.
  • References: GET /v1/connectors.

Procedure

  1. Open Connectors in your profile settings. For a team, open Connectors in the settings of the team.
  2. Select Connect GitHub.
  3. Install the Kloudlite GitHub App on the account. Choose the repositories that pipelines use.
  4. Sign in to GitHub when it asks, to prove who you are.

Close-out

  1. Show the connectors as in task 004. Make sure that the new connector is connected.

Reconnect a connector

Reason for the task: Restore a connector that is expired or revoked.

Job set-up

  • Access: you. For a team, a team member with the role admin or higher.
  • References: GET /v1/connectors.

Procedure

  1. Open Connectors in your profile settings. For a team, open Connectors in the settings of the team.
  2. Select Reconnect in the row of the connector.
  3. Install the Kloudlite GitHub App again. Sign in to GitHub when it asks.

Close-out

  1. Show the connectors as in task 004. Make sure that the connector is connected.

Disconnect a connector

Reason for the task: Remove the link to a GitHub account that pipelines no longer use.

Job set-up

WARNING

Jobs that use the connector stop getting credentials. A git command of a running job fails at its next credential request.

Procedure

  1. Remove the connector acme-github-1. In the console, select Disconnect and type the name.

    Python
    from kloudlite import Kloudlitekl = Kloudlite()kl.connectors.delete(name="acme-github-1")
    TypeScript
    import { Kloudlite } from "./index.ts";const kl = new Kloudlite();await kl.connectors.delete({ name: "acme-github-1" });
    Go
    kl := kloudlite.New(kloudlite.Options{})if err := kl.Connectors.Delete("acme-github-1"); err != nil {    log.Fatal(err)}
    Ruby
    require_relative "kloudlite"kl = Kloudlite::Client.newkl.connectors.delete(name: "acme-github-1")
    Java
    var kl = new Kloudlite();kl.connectors().delete("acme-github-1");
    CLI
    kloudlite connectors remove acme-github-1

Close-out

  1. Show the connectors as in task 004. Make sure that the connector is not in the list.

Show the connectors

Reason for the task: Find the connectors of an owner, and the state of each one.

Job set-up

Procedure

  1. Show the connectors of the team acme. For your own, leave out the owner.

    Python
    from kloudlite import Kloudlitekl = Kloudlite()print(kl.connectors.list(owner="acme"))
    TypeScript
    import { Kloudlite } from "./index.ts";const kl = new Kloudlite();console.log(await kl.connectors.list({ owner: "acme" }));
    Go
    kl := kloudlite.New(kloudlite.Options{})rows, err := kl.Connectors.List("acme")if err != nil {    log.Fatal(err)}fmt.Println(rows)
    Ruby
    require_relative "kloudlite"kl = Kloudlite::Client.newputs kl.connectors.list(owner: "acme")
    Java
    var kl = new Kloudlite();System.out.println(kl.connectors().list("acme"));
    CLI
    kloudlite connectors list --owner acme

Close-out

  1. Read the output. It shows the name, provider, account and state, and never a token.

Connect Hugging Face

Reason for the task: Give your workspaces, or the pipelines and services of a team, the variable HF_TOKEN.

Job set-up

  • Access: you. For a team, a team member with the role admin or higher.
  • References: Hugging Face.

Procedure

  1. Open Connectors in your profile settings. For a team, open Connectors in the settings of the team.
  2. Select Connect Hugging Face.
  3. Sign in to Hugging Face when it asks. Approve the Kloudlite app.

Close-out

  1. Show the connectors as in task 004. Make sure that the connector is connected.
  2. Start a workspace and run printenv HF_TOKEN in it. Make sure that the variable is set.

Connect a container registry

Reason for the task: Let builds push to a registry, and environments and pipelines pull from it.

Job set-up

Procedure

  1. Create a token or a robot account in the registry. Give it the least rights that you need.
  2. Open Connectors in your profile settings. For a team, open Connectors in the settings of the team.
  3. Select the registry in Add a container registry.
  4. Enter the host if the form asks, the path prefix, the user name and the secret.
  5. Enter the region, the access key ID and the secret access key for Amazon ECR. Add the role ARN to use a role.
  6. Enter the region, the path as PROJECT/REPOSITORY and the JSON key of the service account for GAR.
  7. Select Connect.

Close-out

  1. Show the connectors as in task 004. Make sure that the new connector is connected.

Troubleshooting

SymptomPossible causeCorrective action
The connect link expired or was opened in another browser. Start again.The link lasts 10 minutes and works only in the browser that started it.Connect GitHub again in one browser.
That connect link was already used. Start again.Each link works once.Connect GitHub again.
Only a team admin can connect an account for the team.Your role in the team is lower than admin.Ask a team admin to connect the account.
The app was not installed on an account. Install it and try again.You left the GitHub page before the install finished.Connect GitHub again, and finish the install.
This GitHub account is already connected to another owner.Another person or team holds the link to this account.Disconnect the account from the other owner, then connect it.
This owner has reached the connector limit. Disconnect one first.The owner has as many connectors as Kloudlite allows.Disconnect a connector that you do not use.
kl git-credential: no git connector of OWNER covers HOST/REPOSITORYNo connected connector of the owner reaches the repository.Connect GitHub, or pick the project on the GitLab connector.
OWNER already has a Hugging Face connectorThe owner holds one Hugging Face account.Select Reconnect in its row, or disconnect it and connect another account.
HF_TOKEN is managed by connector NAMEA Hugging Face connector writes this secret.Disconnect the connector, or set HF_TOKEN in the env of the resource.
Hugging Face is not configuredThis region has no Hugging Face app set up.Ask a superadmin to set the Hugging Face client ID and secret.
A running workspace has no HF_TOKENIt started before the connect.Restart the workspace. A new process reads the token.
connector NAME is goneThe registry connector was removed while a run used it.Connect a container registry again, and start the run again.
A push starts no runA provider event never starts a run.Use a schedule, a webhook or an after trigger. See Triggers and inputs.
the registry refused this credentialThe user name or the secret is wrong, or the token has too few rights.Connect a container registry again with a correct credential.
the registry refused the credential; paste a new oneThe registry stopped accepting the stored credential.Disconnect the connector, then connect the registry again.
an access key id, a secret access key and a region such as us-east-1 are requiredThe ECR form lacks a value.Fill in the three values, and connect again.
the service account key is not a Google service account JSON keyThe pasted text is not the JSON key of a service account.Create a JSON key for the service account, and paste all of it.
GHCR sign-in through GitHub is not enabledOnly a pasted token signs in to GHCR on this region.Paste a personal access token with the scope write:packages.
an ACR host must end in .azurecr.ioThe host is not an Azure Container Registry host.Enter the host as NAME.azurecr.io.
no registry is configuredYou and your team have no connected registry.Connect a container registry.
several registries are connected: NAMES; pass --registryMore than one registry fits, and none is only yours.Add --registry with one of the names.