DataRobot Execution Environment Builder
Homepage · PyPI · Documentation · Support
Build Codespace-ready execution environment Docker contexts for DataRobot application templates. Uses a customer-buildable Wolfi base with Python 3.11 and pre-warmed shared uv, npm, and Go dependency caches.
Note Early development. The generated Dockerfile and the CLI flags may change between releases. Released under DataRobot's open-source program; it does not carry an official support SLA. See SECURITY.md.
How this relates to DataRobot custom environments
The built-in environments in DataRobot Registry are the supported default, and the stock
[DataRobot] Python 3.11 GenAI Agents environment is the right choice for most projects. This tool
covers the air-gapped case: it produces an environment with every dependency cache baked in, so the
image runs with no network access. Its output is uploaded through the same custom execution
environment flow as any other image.
Prerequisites
curl https://cli.datarobot.com/install | sh
# or: brew install datarobot-oss/taps/dr-cli
Lockfile validation runs each ecosystem's own tool, so an application template may also need
Node.js for a package.json, Go for a
go.mod, or Task for an environment hook.
Install
uv tool install 'dr-environment>=0.1.12'
Make an execution environment
- Generate the Docker context from your application template:
dr environment template --template-path datarobot-agent-application
This writes docker_context/ in the current working directory (and docker_context.tar.gz unless you pass --no-tarball).
- Change into the generated context:
cd docker_context
- Build the image for linux/amd64 (required for DataRobot notebook kernels):
docker build --platform linux/amd64 -t exec-env .
On Apple Silicon, always pass --platform linux/amd64. An arm64 image fails at runtime with exec format error on start_server.sh.
- Export the image to a tarball:
docker image save exec-env -o image.tar
- Upload
image.taras a custom execution environment in DataRobot:
Usage reference
dr environment template --template-path /path/to/datarobot-agent-application
Defaults:
- Output:
docker_context/in the current working directory (override with--target) - Archive:
docker_context.tar.gzin the current working directory - Versions:
.datarobot/cli/versions.yaml
Options
dr environment template --template-path . --no-tarball
FIPS 140-3
On a FIPS 140-3 install, an execution environment does not start unless its base ships
openssl-fips-test. Public Wolfi does not, so pass --fips to build on DataRobot's mirror of
Chainguard python-fips:
docker login # with the DataRobot-issued pull credentials
dr environment template --template-path . --fips
--fips uses datarobot/mirror_chainguard_datarobot.com_python-fips:<python version>-dev. To pull
from another mirror, set DR_ENVIRONMENT_FIPS_BASE_IMAGE (or --fips-base-image) to its
repository, without a tag.
--fips also keeps the image's crypto in the FIPS module:
cryptographyandgrpcioare built from source against the system OpenSSL, at build time and whenever uv or pip installs them later. PyPI wheels bundle their own OpenSSL and BoringSSL. The build fails if a cached build links anything else.- The newest locked
cryptographyandgrpcioare preinstalled into the system Python, so DataRobot's offlineuv pip install --system --no-cachefor a custom app finds them installed instead of failing to build them. That holds one version of each, so--fipsrefuses a template with more than one custom app (ApplicationSourcein its Pulumi code). GODEBUG=fips140=onfor Go tools (pulumi,task,gh,dr).- A guard on
PYTHONPATH(/etc/datarobot-fips, from datarobot-user-models) stops any Python process whose FIPS module fails, with exit 78.DATAROBOT_FIPS_ENFORCE=falseturns it off. - OpenSSL's legacy provider is replaced by the default one, so
hashlib.md5()raises andmd5(usedforsecurity=False)still works.
Node and Pulumi's Go crypto are not FIPS-validated builds.
What it produces
docker_context/
├── Dockerfile # assembled from dockerfile.d/*
├── dockerfile.d/ # one fragment per build stage
├── build-deps/ # build-time manifests
├── kernel/ # kernel deps, entrypoints, Jupyter assets
│ ├── requirements.txt # kernel-only deps
│ ├── setup-caches.sh # offline cache paths for login shells
│ ├── start_server_*.sh # Codespaces and deployed-model entrypoints
│ └── agent/, extensions/ # kernel assets
└── components/<name>/ # per-component manifests
Lockfile policy
Build fails if a component has:
pyproject.tomlwithoutuv.lock(fix:uv lock)package.jsonwithoutpackage-lock.json(fix:npm install)go.modwithoutgo.sum(fix:go mod tidy)- Stale lockfiles (
uv lock --check,npm ci --dry-run, orgo mod verifyfailure)
Runtime cache behavior
The Dockerfile sets tool-native env vars:
UV_CACHE_DIR=/opt/cache/uvNPM_CONFIG_CACHE=/opt/cache/npmNPM_CONFIG_PREFER_OFFLINE=trueGOMODCACHE/GOCACHE
Per-component cache stages run uv sync --frozen --no-install-project against each uv.lock so runtime uv sync --offline can resolve lockfile wheels (including platform-specific builds like litellm).
The Dockerfile always sets strict offline env vars (UV_OFFLINE=1, NPM_CONFIG_OFFLINE=true, GOPROXY=off) in addition to shared cache paths. NOTEBOOKS_AIR_GAP=1 in setup-caches.sh applies the same overrides for login shells.
This is deliberate and always-on, not a toggle for the platform to opt out of. Without UV_OFFLINE=1, a cache miss makes uv fall through to whatever UV_INDEX_URL/mirror is configured in the environment — in an air-gapped install that host can be unreachable, or have no access to a certain library. So instead of a fast, clear "not found in the cache" error, the install hangs until the request times out or fails. Keeping this image strictly offline trades "install anything, sometimes slowly or not at all" for "install only what's baked, fail fast and clearly otherwise." A platform that needs to install extra, non-baked packages from its own reachable mirror should do so outside this image (e.g. in a derived image or a separate step), not by unsetting these vars here.
Component hooks
If a component Taskfile defines an environment task, dr environment template runs it with:
| Variable | Purpose |
|---|---|
DOCKER_CONTEXT |
Output docker context path |
COMPONENT_DIR |
Source component directory |
COMPONENT_NAME |
Component name |
DOCKERFILE_FRAGMENT |
Path to append cache stage fragment; pre-filled with FROM kernel AS cache-<name> |
COMPONENT_DEST |
components/<name>/ in docker context |
DOCKERFILE_FRAGMENT starts as FROM kernel AS cache-<name>, so the hook's instructions build in their own stage. The final image copies the cache dirs (/opt/cache/uv, /opt/cache/npm, the Go cache, the wheelhouse) out of the last stage the fragment defines.
Development
uv pip install -e ".[dev]"
pytest
dr-environment --dr-plugin-manifest
See PLUGIN_TESTING.md and CONTRIBUTING.md.
License
Apache 2.0. See LICENSE and NOTICE.
That grant covers this repository's own code. It does not extend to the components the generated image fetches at build time, which keep their own terms, including Wolfi apk packages under GPL-2.0 and GPL-3.0, and the DataRobot Python SDK under the DataRobot Tool and Utility Agreement.
Metadata
Release files for dr-environment 0.1.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dr_environment-0.1.15.tar.gz | 304.4 kB | Without provenance | Details for dr_environment-0.1.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dr_environment-0.1.15-py3-none-any.whl | Python 3 | none | any | Details for dr_environment-0.1.15-py3-none-any.whl |
Total release size: 382.2 kB
Release files / dr_environment-0.1.15.tar.gz
| Download URL | dr_environment-0.1.15.tar.gz |
|---|---|
| Size | 304.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7be241bcbf0b1341a421b44386ad90de227d5daac9e7747b50d6376e5cfa507
|
|
BLAKE2b-256 checksum How to use checksums |
a342c9c16abab818b2a6f227dd92dd4e97061b06f912600d28bf5d8c43ff8ed4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dr_environment-0.1.15-py3-none-any.whl
| Download URL | dr_environment-0.1.15-py3-none-any.whl |
|---|---|
| Size | 77.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57078dcf839f9e134efeb6fe5860aacf9ca382a0e4b374a37d8ab67641a5a9e7
|
|
BLAKE2b-256 checksum How to use checksums |
b64b1780e740e02c82d37ed218b870549bc5c513a2d9cec5ec0f9924fb45f56b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for dr-environment 0.1.15
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.