Skip to main content
A Container is a long-running service that Datazone builds and runs for your project. You declare it in config.yml, either as a Dockerfile in the repository or as an existing image, and Datazone runs it on your deployment’s cluster. Use a container when a pipeline or action needs something that has to stay up between calls:
  • Model servers — an embedding or image model loaded once and called many times (for example a CLIP server that fills an Empty Vector)
  • Internal APIs — a service in any language that your actions and pipelines call
  • Web tools — a small web UI or API for the people in your organisation, or for anyone with the link

How it works

  1. Declare the container under containers: in config.yml and push. Datazone registers it on that branch. Registering does not deploy it.
  2. Deploy. Open Containers in the project and click Deploy. Datazone builds the image from the branch’s latest commit (or pulls the image you named) and starts it.
  3. Call it. Actions and pipelines call it with ContainerAPI. authenticated and public containers also get a URL.
  4. Stop it when you don’t need it. A stopped container uses no compute.
Each branch deploys separately. A container on feature-x runs the code and config of feature-x, at its own URL, without touching main. Only one deployment per branch runs at a time, and by default at most two branches of a container run at once.

Declaring a container

config.yml
string
required
Identifies the container in the project. Lowercase letters, digits and hyphens, starting and ending with a letter or digit, at most 40 characters. Unique within the project. ContainerAPI uses it to find the container.
string
Display name. Defaults to the alias.
string
Folder in the repository that holds the Dockerfile. It is the build context. Set exactly one of path or image.
string
default:"Dockerfile"
Name of the Dockerfile inside path.
string
An existing image to run instead of building one, for example traefik/whoami:v1.10. Datazone pulls it without credentials, so it must be in a public registry. Pin a tag; latest can change between deployments.
array
Folders copied from the project’s File Container into the build context before the build. Use it for files too large for git, such as model weights. Only for containers built from a path.
  • source — folder in the file container
  • target — folder in the build context, relative to path
Both must be relative paths. The Dockerfile then copies them like any other file: COPY weights/ /app/weights/.
integer
required
The port the service listens on inside the container.
integer
default:"1"
Number of copies to run. Requests are spread across them. At most 3 by default.
string
default:"2XSMALL"
Size of each replica. See Compute sizes.
string
default:"internal"
Who can call the container: internal, authenticated or public. See Access levels.
string
An HTTP path that answers 2xx when the service is ready, for example /health. When set, Datazone sends traffic to a replica only after the path answers, and restarts a replica that stops answering. Without it, a replica gets traffic as soon as its process starts.
If a container’s entry can’t be deployed, for example because its Dockerfile is missing or it asks for too many replicas, the container page shows why. Fix the entry and push again.

Compute sizes

Each replica gets the full CPU and memory of its size for as long as it runs. Running containers use compute (DCU) for every replica, for every minute they run. A stopped container uses none.

Access levels

Actions and pipelines of the project can call a container at any access level.
A public container is open to the internet. Anyone with its URL can call it. Use authenticated unless the service is meant to be open.

Deploying and stopping

On the container’s page, pick the branch and click Deploy. The deployment goes through these statuses: The Deployments tab lists every deployment with its commit, status and build log. If a deploy fails, the container that was already running keeps running. A new deploy replaces the running one when it is ready. To pick up a new commit, a changed config.yml entry or changed environment variables, deploy again. Stop scales the branch down to zero. Deploy again to start it.

Environment variables

Set environment variables on the Environment tab:
  • Shared variables apply to every branch.
  • Branch overrides replace a shared variable with the same name on one branch.
  • Mark a value as secret to store it encrypted. A secret is never shown again after you save it.
Changes take effect on the next deploy. A container gets no Datazone credentials of its own. If it needs to call the Datazone API, create an API key and add it as a secret variable.

Organisation overview

Settings → Containers lists every container pod running in your organisation, across all projects, like an activity monitor. You need the compute:manage permission to see it. See Policies. Each row is one pod (one replica), read from the cluster: The list refreshes every 10 seconds. A pod whose container was deleted is shown as Container removed. Click a pod to open its container branch:
  • Overview — the image, commit, compute, ready replicas, access, port and URL, and a Usage chart of CPU and memory for all replicas together, against the limit they reserve. Pick the last hour, 6 hours, 24 hours or 7 days.
  • Pods & Events — each replica with its node and IP, and the Kubernetes events of the deployment and its pods. The cluster keeps events for about an hour.
  • Deployments — every deployment with its build log.
  • Environment — the variables the next deployment gets: shared variables and this branch’s overrides. Secret values stay hidden.
Open in project goes to the container’s page in its project. Stop scales the branch down to zero; you need write access to the project.

Calling a container

From actions and pipelines

ContainerAPI calls a container of the same project by its alias. It signs in with the run’s access key, so it works at every access level, including internal.
class
Parameters:
  • alias — the container’s alias in config.yml
  • branch (optional) — the branch whose deployment is called. Default: main.
  • timeout (optional) — default request timeout in seconds. Default: 300.
Methods: get, post, put, patch, delete and request(method, path). Each takes a path inside the container and the same keyword arguments as requests (json, params, data, headers, …), and returns a requests.Response.
If the container doesn’t exist or isn’t running on that branch, ContainerAPI raises an error that says so, for example Container 'clip-embedder' on branch 'main' cannot be called: Container not found.

With its URL

authenticated and public containers are served at:
The container’s Overview tab shows the URL, an Open URL button, and ready-to-copy curl, Python and JavaScript examples. For an authenticated container, send an API key in the x-api-key header. Your Datazone browser session is not accepted, so a web UI meant for people in a browser must be public.
The container receives the request at /<path>, without the /api/v1/container-proxy/... prefix. A web UI served this way must use relative links (./assets/app.js, not /assets/app.js), because its pages are under that prefix. Datazone removes your credentials (Authorization, x-api-key, cookies) before the request reaches the container, and drops any cookie the container tries to set. A request waits at most 5 minutes for the container to start answering.

Security

  • Containers run as a non-root user (uid 10001) with all Linux capabilities dropped. Build your image so it works as a non-root user: don’t write to root-owned folders at runtime.
  • Images are built in an isolated build job with rootless BuildKit.
  • A container accepts traffic only from the Datazone proxy and your organisation’s pipelines. It can reach the public internet, but not other services inside the cluster.
  • Environment variables are stored in a Kubernetes Secret, not in the pod spec. Secret values are encrypted in Datazone.

Example: an embedding server

A small FastAPI service that loads a model once and embeds text on request.
containers/clip/Dockerfile
containers/clip/server.py
An action that embeds a query with it and searches an Empty Vector:

Next steps