Skip to main content

Settings: environments and connectors

Environments​

An environment is the machine a task runs in, built from Workstation or Minimal. The gateway checks each one before people can pick it, and a change reaches a task at its next session. Workstation and Minimal are built in.

Built-in environments​

Minimal and Workstation (later Data) are the environments the installation built. The gateway adds each one by itself when it starts and finds its image on the engine host: nobody types an image ID. The image must be one this version built (deploy/build-images.sh, with --workstation for Workstation): it says which environment it is and is tagged with that name. Its tools come from the image.

  • A newer build. When the installation builds it again, the gateway's next start moves the environment to the new image. That change is recorded in the audit and shown on the environment ("Updated to the image built on "); tasks in it move to the new image at their next session.

  • Pinning a built-in to one image. A built-in is otherwise whichever image carries its tag (tqa-runtime:workstation) on the engine host, so a new build moves it. To fix it to one image instead (an installation that must run exactly an approved build, or installations sharing one engine host whose builds differ), name the image by its ID in gateway.toml:

    [runtime.builtin_images]
    workstation = "sha256:<the image's 64 hex digits>"

    Only minimal, workstation and data can be named, and only by image ID (docker image inspect --format '{{.Id}}' <image>), never a tag: anything else stops the gateway, saying which. A pinned built-in is that image, provided it is on the host and says it is that environment. Its tag is not used, so a new build doesn't move it, and while the image isn't on the host the built-in isn't added. The ones not named are found by their tag as before. Everything else here applies unchanged: a pinned built-in is registered, checked and becomes the default the same way.

  • An image built from it (a customised Workstation, for example) never takes its place. It is listed among the images on the host as derived from Workstation, and can be picked for a new environment of its own.

  • Editing a built-in makes it yours: it is marked "Customised: rebuilds no longer update it", and later builds leave it as you set it. It is still checked against the build it was customised from, so a change of its size, name or description keeps it available (Desktop included, whose entry point differs from Workstation's); a new image is checked as any environment's is. A Desktop customised under an earlier version and refused for its entry point is checked again at the gateway's next start, when it is still on the image its tag names. Reset to built-in, in its … menu or on its page, asks first, then hands it back: it takes the current build's image, name and tools, keeps its size, description and on/off switch, and follows later builds again. The reset is recorded in the audit. It needs the built-in's image on the host ("build it again, then reset" otherwise), and for the default environment a reset that would change its image or tools is refused, as an edit would be.

  • On a new install, Workstation appears and becomes the default once it is found and its checks pass (a few seconds after the gateway starts), so new tasks have Python, Node and the rest (and, as in every environment, python runs Python 3). That happens only while nobody has chosen a default: when gateway.toml lists its own environments, or an administrator has already set environments up, their default stays. Without Workstation on the host, or while its checks refuse it, Minimal stays the default. On microVM installs Workstation needs its own disk image: its row says when it isn't built, with the command that builds it.

  • Your own environment of the same name, or one in gateway.toml, is kept, and the built-in isn't added.

  • Deleting a built-in is final: a later build doesn't bring it back. Add it again from its image when you want it: Add environment, then its card under Start from a built-in. It comes back with every tool its image declares and its own size (Desktop's 2 CPUs and 4 GB), as your own environment, so later builds don't update it.

  • When the container engine doesn't answer at start, the environments stay as they were; the next start tries again.

The images on the host (API)​

GET /api/v1/admin/environment-images (administrators) lists the images on the engine host that hold a TensorQuay runtime, newest first, at most 200: each image's ID and tags, when it was built, its size, which environment it says it is and its tools, whether this version can run it, which environments use it and how many tasks run it now. An image that can't be used says why in plain words ("too old for this version: rebuild it", "its capability label names an unknown capability: gpu"); a built-in that isn't added says why ("deleted by an administrator"). A built-in with its own size says it in sizes (Desktop: 2 CPUs, 4096 MiB, 1024 processes; null for the others). The gateway never pulls: only what is on the host is listed. When the container engine doesn't answer, the list answers 503 engine_unavailable; try again in a moment. An empty list means no such image is on the host yet: build them with deploy/build-images.sh.

Build one from a recipe​

To add tools without writing a Dockerfile, write a recipe: the built-in to start from and the packages to add from its own sources. On the engine host, from the repository:

name = "data-r" # the environment's name: lowercase letters, digits, - or _
display_name = "R and LaTeX"
base = "workstation" # minimal or workstation
capabilities = [] # extra tools the packages bring, if any: shell, python, node, build, browser, data
[add]
apt = ["r-base=4.5.0-3", "texlive-latex-base"]
pip = ["pandas==2.2.3"] # Workstation only
npm = [] # Workstation only
deploy/build-environment.sh data-r.toml # --dry-run prints the Dockerfile and builds nothing

The image is tagged tqa-env:data-r and appears in the images on the host, based on Workstation, with its tools; add it as an environment from there. A recipe lists packages only: no commands, files or addresses. Name a version for each package to build the same image every time. The image records the versions it got, and a rebuild that got other versions says which. A later build of the recipe is a new image: environments made from the old one keep it until you pick the new one.

When the build can't go ahead, it says why in one line and tags nothing:

It saysWhat to do
The package r-bsae wasn't found in the apt sources of Workstation.Fix the name (or the version) in the recipe.
The build couldn't reach deb.debian.org. Check this host's network, then build again.The host needs the package mirrors.
Workstation isn't on this host: build it with deploy/build-images.sh --workstation first.Build the base (also when it's too old for this version).
Minimal has no pip: build on Workstation, or list the tool under apt.Change the base, or use the apt package.
run isn't a recipe field: a recipe lists packages only.Remove it; anything else belongs in your own Dockerfile.
That name belongs to a built-in environment; choose another.Rename the recipe.
The build ran out of disk space on this host. Free some space, then build again.Free space on the engine host.
The build took longer than 60 minutes and was stopped.Raise the bound with --timeout MINUTES.

The list​

ColumnMeaning
EnvironmentThe display name, Built in or based on its base, and the source (Found on this host for a built-in the gateway registered itself)
ToolsThe tools it declares, each by name: Shell, Python, Node.js, Build tools, Browser, Data
StatusDefault, Off and the check state, with the reason when it can't be picked

Each row has Edit, which opens the environment's page, and a … menu with Check the image now, Reset to built-in (on a customised built-in, whose row says "Customised: rebuilds no longer update it"), Make default (when it can be) and Delete.

The check state is one of:

StateMeaning
VerifiedThe image passed every check; people can pick it
Checking…A new or changed image is waiting for the gateway's check, which comes within a few minutes; the page refreshes on its own
Not checkedIt has not been checked; choose Check the image now in its menu
RefusedThe image failed a check; the sentence under it says why and what to do

People can pick an environment only when it is enabled and either verified, or built in and not yet checked. A refused image reads, for example, "The image does not start from Workstation or Minimal. Build it FROM one of them." On installs that run tasks in microVMs, an image also needs its VM disk image, built by an operator with images/rootfs/build_rootfs.py; the refusal names it, and Check the image now checks again once it is built.

Credential files in an image​

The check also looks through the files an environment's image adds to its base for credentials left there by mistake: private keys, SSH keys, saved logins for a code host, AWS, Docker, npm and PyPI credentials, and .netrc passwords. It reads names and the first bytes of files, never runs anything, and shows only paths, never what a file holds. An image with such a file is refused, and the page lists the paths with what each one is.

  • Remove the file and build the image again: a credential in an image reaches every task that uses it. Tasks get their credentials from the secret store instead. Keep the file out of the build itself: deleting it in a later build step hides it from tasks, and from this check, but it stays inside the image's earlier layer, where anyone with the image can extract it.
  • Or acknowledge it, when the file is meant to be there (a test certificate's key for a development server, for example): list its path under acknowledged_secret_files in that environment's [[templates]] entry in gateway.toml. This is set in the file only, not on the page. The environment is then verified, with the path shown as a warning.

Very large images can pass the limits of this look-through ([template_checks] in gateway.toml, 160,000 files and 6 GiB by default). Such an image is refused rather than passed unchecked; raise the limit it names if the image is meant to be that large. The look-through catches common mistakes, not every possible secret: what an image holds stays the administrator's responsibility.

Add or edit an environment​

Add environment opens a page of its own (/settings/environments/new), and Edit opens the environment's page (/settings/environments/<name>); Environments at the top goes back, and Save and Cancel stay at the bottom. Leaving with unsaved changes, by any link or by closing the tab, asks first. Give the Display name and Description (optional: one line on what it is for, shown where people pick an environment, with its tools on hover). The environment's ID is made from the display name and shown under it ("ID: data-science"); Change opens it to type your own: lower-case letters, digits, - and _, starting with a letter. The ID is fixed once the environment exists, and new is reserved (it is the Add page's address).

Then its Image, chosen rather than typed. Build or pull it on the engine host first: the gateway never pulls.

  • Start from a built-in: a card for each built-in's current build, with its tools. Choosing one takes that build's image and ticks its tools.
  • Or pick one of your images: the other images on the host, each by its tag ("Untagged image" without one), with what it is based on, when it was built, its size and which environments use it. One that can't be an environment is shown but can't be picked, with why ("Too old for this version: rebuild it from a current Workstation or Minimal."). Picking one takes its image and the tools it declares. With none on the host the page says so: build them as the Built-in environments part above says.
  • Advanced holds the image ID itself, pinned by digest (sha256:… or name@sha256:…, never a tag), for an image the lists don't show; it opens by itself when the host's images can't be listed or the environment's image is none of the choices. When adding, How to build one there gives a starter file (from Workstation, as root, then back to the runtime user) and the commands that build it and read its ID.

A new environment starts from the default built-in, already chosen. A built-in sets its Capabilities ("Set by Workstation: Shell, Python, …"); for your own image or an image ID, choose them: they are declared, not detected, so the agent gets only the tools they allow. Its size may stay empty to use the installation's defaults: CPUs (in halves, from 0.5), Memory (GB) (from 0.25), Processes, and Disk for new workspaces (GB) (a workspace made for this environment gets this much space; an existing workspace keeps its size). No field may exceed the installation's ceiling ([sandbox.ceiling] in the configuration file, shown under Limits as Largest environment), which each field's hint names; a value above it is refused. On microVM installs a workspace's disk is an image of that size, made once: it never grows or shrinks, even when its task moves to another environment. If the configuration file later lowers the ceiling below an environment's size, the list shows what tasks get, marked ("8 CPUs, lowered"), the field says "Lowered to the installation's ceiling of 8 CPUs", and new tasks get the ceiling. Saving the environment accepts the lowered size and removes the mark, even when you changed only another field; a ceiling raised later no longer gives the old size back. A running task keeps the size it started with; a change applies from its next environment. Enabled off hides it from the picker; tasks already on it keep working.

Saving starts the gateway's check. The default environment stays enabled, and its image, capabilities, CPUs and memory cannot change while it is the default (its processes and disk can): make another environment the default first.

Make default and delete​

Make default, in the row's … menu, appears only on environments people can pick now, and asks for confirmation: new tasks start in it, and existing tasks keep theirs.

Delete, in the row's … menu, is unavailable for the default ("Make another environment the default first.") or while tasks use the environment ("… tasks use it; they can switch to another first."); the menu says which. Deleting removes it from the list only: its image and VM disk image stay on the engine until an operator removes them. If something still uses it, the dialog says what: the default, active tasks, or tool servers that list it.

Where tasks run​

Below the list, Where tasks run chooses what new workspaces run their tasks in: Docker containers or microVMs (Firecracker), side by side in one installation. Each workspace keeps where it was made, so a change applies to new workspaces only, and existing ones run as before. A fork or a helper's copy runs where its source does. The Desktop runs only in Docker containers, so a Desktop task always gets a Docker workspace.

The section says:

  • whether this computer is ready for microVMs, and if not, why in one sentence with what to do: for example "The VM runner can't open KVM on this computer. Someone with root access runs deploy/firecracker/host-setup.sh --apply on it, then restarts the gateway." The microVM guide has every step;
  • each environment that can't start in a microVM yet because its file system isn't built, and Build them now. The gateway builds them itself after a restart; each takes up to a minute;
  • how many workspaces run in Docker containers and how many in microVMs.

Save appears for a change to a choice that is ready, and asks first ("Run new workspaces in microVMs (Firecracker)?"). Choosing the backend gateway.toml names saves no choice of its own, so the file decides again; the other choice is saved and outlasts restarts. The API is GET and PUT /api/v1/admin/sandbox-backend (administrators).

Connectors​

A connector gives the agent tools from another service, such as searching your team's documents or filing an issue in your tracker; technically, it is a remote tool server (MCP). The gateway holds its credential and sends it; the agent never sees one. A change applies from each task's next connection.

The list​

ColumnMeaning
ConnectorThe display name (or the name, when it has none), with the server's host and the source under it
ToolsAll tools, the number allowed, or all but a number
StatusOff, In new tasks, and Key missing (with Add it under Keys › Shared) when its shared key does not exist

Each row has Edit and a … menu with Delete.

Add or edit a connector​

Choose Add connector, or Edit on a connector.

PartFields
ConnectorName (fixed once created), Display name, Server address (the server's https:// address)
CredentialSend a credential (No credential, As a bearer token, or In a header with a Header name), A credential is required, and Shared key: a shared key (Keys, Shared) that is allowed for this connector, never a value
ToolsTools the agent may use: All tools, Only these or All but these, with the Tool names, one per line, matched exactly
LimitsCall timeout (seconds), from 1 to 600
AvailabilityEnabled, and Offer in new tasks

What a connector's tools may do is decided by the service, through the scopes of the credential it is given: give a connector a least-privilege credential, and list only the tools the agent needs.

People can add their own credential for a connector (see Keys); theirs is used before the shared one. Turning Enabled off applies at once, also to running tasks; Offer in new tasks applies to tasks started from now on.

MessageWhat to do
Use the server’s https:// address, without a name, password or fragment.Remove any user:password@ part and any #…
Put credentials in a secret, not in the address.Remove the token from the address; use Send a credential and a secret
Use Authorization or a header name starting with X-, up to 64 characters.Rename the header
A connector or tool server already uses this name.Choose another name
… isn't allowed for this connector. Allow it first.Choose Allow it for …, then save again; or tick the connector under the secret's Who may use

Delete a connector​

Delete, in the row's … menu, asks for confirmation. Tasks lose the connector's tools from their next connection.