Workspace definition files
A workspace saves an independent definition when you create it. These files describe its next Start; changing the source workspace template does not change them. This reference covers the files edited through Definition files, the CLI, or directly on the host.
Location and layout
Section titled “Location and layout”The files belong to the workspace owner’s real Linux account and live beneath the home directory recorded for that account on the host:
<passwd-home>/.config/labpod/workspaces/<workspace-id>/ bundle.json workspace.json README.md context/ # optional build context Dockerfile requirements.txt # example additional context filebundle.json describes the software recipe and apps. workspace.json describes this workspace’s
name, resources, environment overrides, and mounts. README.md is required, must contain text,
and must be valid UTF-8. context/ is needed only for a recipe with a Dockerfile.
The definition directory is not mounted into the container and is not available in Files.
It is separate from /work and the persistent workspace home. Renaming a workspace changes
only workspace.json; its ID and directory stay the same. Back up the files separately from the
database; see Backups & restore.
Workspaces created before per-workspace definition files existed have none. See Upgrades.
JSON rules
Section titled “JSON rules”Both JSON documents reject unknown fields, duplicate keys, explicit null, and invalid UTF-8.
Omit an optional field instead of setting it to null. Integer fields require integer notation:
use 2, not 2.0 or 2e0, within the server’s supported integer range. Optional arrays may be
omitted or set to [].
The schema checks document structure. Additional server rules check GPU combinations, environment names, mounts, image references, Dockerfiles, and app consistency. Passing a JSON Schema check alone does not establish that the saved definition is usable.
workspace.json
Section titled “workspace.json”A minimal CPU-only definition looks like this:
{ "schema_version": "1", "kind": "labpod.workspace.definition", "name": "analysis", "resources": { "cpu": 2, "memory_gb": 8, "gpu": { "mode": "whole", "count": 0 } }}| Field | Meaning and constraints |
|---|---|
schema_version, kind | Required literal strings "1" and "labpod.workspace.definition" |
name | Required, 1–100 characters, non-empty after trimming, with no surrounding whitespace |
resources.cpu, resources.memory_gb | Required integers, at least 1; requested CPU cores and memory in GB |
resources.gpu | Required object with mode and non-negative integer count; see the combinations below |
environment[] | Optional overrides with name, value, and optional remove |
mounts[] | Optional folders with name, host_path, container_path, read_only, and optional source_mount_name |
GPU combinations
Section titled “GPU combinations”| Mode | Required combination |
|---|---|
| CPU only | mode: "whole", count: 0, no non-zero limits or MIG profile |
whole | Positive count, no non-zero memory_limit_mb or sm_limit_pct, no MIG profile |
hami | count: 1, positive integer memory_limit_mb, integer sm_limit_pct from 1 to 100, no MIG profile |
mig | count: 1, non-empty mig_profile, no non-zero HAMi memory or compute limits |
When present, memory_limit_mb must be a non-negative integer and sm_limit_pct an integer from
0 to 100. These combinations do not guarantee available hardware: GPU availability is checked
at Start, and sharing must be enabled for fractional allocations.
Environment overrides
Section titled “Environment overrides”Names must match ^[A-Za-z_][A-Za-z0-9_]*$ and be unique. Each entry replaces the same-named
bundle.json environment value. A required value of "" deliberately sets an empty value.
Use "remove": true to remove an inherited value; then value may be omitted or empty, but
cannot be non-empty. Values cannot contain NUL, newline, or carriage return.
You cannot set or remove these reserved names: HOME, USER, PATH, LD_PRELOAD,
JUPYTER_BASE_URL, CUDA_DEVICE_MEMORY_LIMIT, CUDA_DEVICE_SM_LIMIT, or names beginning with
LABPOD_, CUDA_DEVICE_MEMORY_LIMIT_, or CUDA_DEVICE_SM_LIMIT_.
Mounts
Section titled “Mounts”Each mount requires all four fields name, host_path, container_path, and read_only.
Names match ^[a-z][a-z0-9-]{0,63}$; duplicate names and duplicate container targets are rejected.
host_path must be a concrete absolute directory path, without : or NUL, newline, or carriage
return. Resolve any {server_userid} placeholder before saving. The directory must exist and
remain the same resolved directory when checked. A custom folder must belong to the owner and
be inside that owner’s home or work directory. Shared presets follow the administrator’s
selection and access rules.
Container targets must be absolute and cannot shadow reserved paths such as /work, /home,
/labpod, or system directories. Host system paths, LabPod application data, other accounts’
protected paths, and mounts exposing the host home or definition tree are also refused. A
read-only mount must satisfy the same path checks.
source_mount_name identifies a shared preset or a selected subdirectory. A new selection must
match its resolved preset exactly: mount name, concrete host path, container target, and
read-only mode. A selection captured at creation or a successful Start retains its recorded
mount; later preset edits do not rewrite it. See Shared mounts.
workspace.json excludes image/build inputs, app ports, owner identity, host ports, container
identity, and execution state. Put software and app changes in bundle.json and its context.
bundle.json
Section titled “bundle.json”The recipe uses schema_version: "2" and kind: "labpod.template.bundle". For example:
{ "schema_version": "2", "kind": "labpod.template.bundle", "name": "Python analysis", "type": "terminal", "image": { "ref": "docker.io/library/python:3.12" }, "defaults": { "cpu": 2, "memory_gb": 8, "sleep_entrypoint": true }, "ports": []}This example also needs a non-empty README.md. It describes a Terminal-only environment.
| Field | Meaning and constraints |
|---|---|
id_hint | Optional template identifier hint; does not change workspace identity |
name, description, type | Recipe name, optional description, and type label. name and type must be non-empty; type has no fixed list of allowed values |
terms_url | Optional informational publisher-terms link using HTTP or HTTPS; no LabPod acceptance step |
env[] | Default environment entries with required name and value; valid, unique, non-reserved names and single-line values |
image.ref | Required software image reference, including an explicit registry host, or a local recipe name such as localhost/my-analysis:1 |
image.dockerfile | Optional local recipe declaration with path omitted, "", or "Dockerfile", and optional string-valued build_args |
image.published | Optional published-image metadata: ref, definition_digest, and optional variants[] with the same fields and optional build_args |
defaults | Resource defaults and app startup behavior, detailed below |
ports[] | Optional HTTP app/launcher definitions, detailed below; omit or use [] for Terminal only |
provenance | Optional author, homepage, license, and labpod_min_version metadata |
Normally edit the image/recipe, apps, defaults, environment, and README. id_hint, provenance,
and published-image records describe the recipe’s origin or catalog artifacts. Published metadata
is read-only in the form. Its definition digest describes the build inputs, not an image-layer
backup. Keep it consistent with the recipe; do not invent a digest to mark an edit as published.
Image and build rules
Section titled “Image and build rules”Registry image references must be well-formed and name the registry explicitly, for example
docker.io/library/python:3.12 or ghcr.io/org/image:tag. An unqualified python:3.12 is refused.
A localhost/... recipe name does not have to be built to pass definition validation.
Declaring image.dockerfile requires a non-empty context/Dockerfile. Context cannot be supplied
without that declaration. The Dockerfile must have a FROM instruction. External image references
in FROM, # syntax=, COPY --from=, and RUN --mount=from= require explicit registry hosts;
scratch and earlier build-stage references are handled as special cases. Arguments used in
image references must resolve from the recipe’s build arguments or Dockerfile declarations.
Build-argument names match ^[A-Za-z_][A-Za-z0-9_]*$. Values are strings with no NUL, newline, or
carriage return. The limits are 32 arguments, 4 KiB per value, and 16 KiB total for names plus
values. These checks do not build the image or test whether its packages can be downloaded.
Published metadata requires a Dockerfile for its local fallback. Each published reference must
use a pinned tag other than latest, or a digest. Its definition_digest must be
sha256: followed by 64 lowercase hexadecimal characters; published references must be unique.
Defaults and apps
Section titled “Defaults and apps”defaults.cpu and defaults.memory_gb are required positive integers. Other defaults are
command, gpu_required, gpu_default, idle_timeout_override_minutes (non-negative),
app_port, base_url_arg, and sleep_entrypoint. The idle policy is inactive: LabPod does not
auto-stop idle workspaces. app_port and base_url_arg are single-app compatibility fields;
use ports[] for app definitions.
Each ports[] entry requires name, label, container_port, and protocol. Optional fields
are base_path_arg, is_primary, command_template, readiness_path, probe_command,
install_hint, option_schema_json, and proxy_strip_prefix.
- App names match
^[a-z][a-z0-9-]{0,31}$and must be unique; labels must contain text. container_portis an integer from 1 to 65535. The only allowedprotocolis"http".- A non-empty app list needs exactly one
is_primary: true. command_templateandprobe_commandmust appear together. Probe commands are executable names without paths or spaces and must be unique. Launcher commands and option definitions also pass the server’s launcher checks; see Add a launcher.sleep_entrypoint: truecannot be combined with a non-emptydefaults.command. With no apps, use the sleep entrypoint or leave the command empty.- Launcher-driven recipes (
sleep_entrypoint: trueor an empty command) require any launcher command to bind${HOST_PORT}. A recipe with its own non-empty command and no sleep entrypoint instead needs distinct fixed container ports and cannot use${HOST_PORT}in app commands.
File and archive limits
Section titled “File and archive limits”| Input | Maximum |
|---|---|
| Each JSON document | 256 KiB |
context/Dockerfile | 32 KiB |
README.md | 64 KiB |
| Additional context files | 256 KiB total, 64 KiB per file, 32 files (excluding Dockerfile) |
| Imported TAR bundle | 1 MiB, 64 entries |
Additional context paths are relative to context/, with no .. or absolute paths. Path
segments use letters, digits, ., _, and -. Allowed extensions are .txt, .md, .yaml,
.yml, .json, .toml, .cfg, .conf, .ini, .sh, .py, .lock, and .in. Keep datasets,
model weights, and checkpoints in /work or shared storage.
Validation and safe editing
Section titled “Validation and safe editing”The server checks required files, UTF-8 and duplicate keys in JSON, integer notation, the
embedded JSON Schemas, and domain rules before using a saved definition. Invalid input is never
used for Start: it returns a typed error. If workspace.json cannot be read as a valid
definition, the workspace list retains the registered database name. Raw file inspection can
still return malformed bytes for repair.
To check the currently saved files without downloading, building, starting, or reserving resources:
labpod ws validate <workspace-id>Success prints definition valid (revision=...). In the web editor, open Saved definition
actions → Validate saved definition. The API equivalent is
GET /api/workspaces/{id}/definition/validate. These checks examine saved files, not an unsaved
draft; quota and mount checks still use current server policy.
Prefer the web editor or labpod ws definition save for settings, and ws definition patch for
named file changes. A proposed save is validated as a complete definition before any file is
written. Validation rejection leaves the previous files and revision intact. Saves require the
revision from the last read; on definition_conflict, read again, review the changes, and reapply
your draft. If a save is interrupted, read the saved files before retrying.
When editing on the host, edit as the owning Linux account, retain the full file set, and run
ws validate before Start. Edits to a running workspace apply at its next Start. Save and Validate
do not prepare software or alter running apps.
labpod ws import preview recipe.tar and the template import preview check an uploaded bundle
without persistent changes. Exporting with ws export includes bundle.json, README.md, and
context, but excludes workspace.json, data, image layers, and persistent home. See
CLI.
Schemas and validation limits
Section titled “Schemas and validation limits”Validation runs on the server; there is no standalone offline LabPod validator. For editor completion or structural checks, obtain the running server’s embedded schemas with:
labpod ws definition schema workspace > workspace.schema.jsonlabpod ws definition schema bundle > bundle.schema.jsonThese commands require the running service and an authenticated host-local account, but no
workspace ID. Default output and --json both print the exact schema bytes used by that server.
The exported schemas do not include every domain or policy check; use ws validate for the
complete saved-definition check. There are no separately hosted schema downloads on this site.
Error details
Section titled “Error details”Invalid file content normally returns definition_invalid with a validation object containing
code, file, detail, and, where available, field, line, and column. A field is a JSON
pointer such as /resources/cpu or /ports/0/name; array indexes start at zero. Parse positions
use one-based lines and byte columns.
Codes include definition_json, definition_duplicate_key, definition_version,
definition_kind, definition_schema, definition_domain, definition_missing, and
definition_archive. A missing definition directory returns definition_missing directly.
Validation never restores or regenerates missing files.
| Message or detail | What to correct |
|---|---|
required field is missing | Add the named field with the required type |
unknown field | Remove or correct the unrecognized field name |
expected an in-range integer without decimal point or exponent | Use an integer such as 2 instead of 2.0, 2e0, or an out-of-range number |
name must be non-empty and trimmed | Supply a name without surrounding whitespace |
cpu-only GPU settings must use whole mode with no limits | Use whole, count 0, and remove fractional limits and the MIG profile |
hami mode requires one GPU and valid memory/sm limits | Use count 1, positive memory, compute 1–100%, and no MIG profile |
duplicate environment override | Keep one override per environment name |
cannot set a non-empty value and remove | Choose either assignment or removal |
duplicate mount target | Give mounts distinct container targets |
host_path must be concrete and absolute, without mount-option delimiters | Supply an absolute host directory, resolving placeholders and removing forbidden characters |
context supplied without image.dockerfile | Declare the Dockerfile recipe or remove the unused context |
image.dockerfile needs a non-empty context/Dockerfile | Supply the declared Dockerfile |
required file is missing | Check the named file; for pre-upgrade workspaces, follow Upgrades |