code-sandboxes 1.11.3__tar.gz → 1.11.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/PKG-INFO +1 -1
- code_sandboxes-1.11.5/code_sandboxes/__version__.py +1 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/adapters/datalayer.py +26 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/contract.py +19 -3
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/spec.py +63 -3
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/models.py +11 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/providers.py +4 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/datalayer/datalayer.py +2 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/daytona/daytona.py +4 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/kaggle/kaggle.py +5 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/environments/specification.mdx +1 -1
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/schemas/environment-v1alpha1.json +40 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_datalayer_sandbox.py +49 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_foreign_contract_layer.py +99 -1
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_providers.py +24 -0
- code_sandboxes-1.11.3/code_sandboxes/__version__.py +0 -1
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.github/workflows/build.yaml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.github/workflows/environments-live.yaml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.github/workflows/py-code-style.yaml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.github/workflows/py-tests.yaml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.github/workflows/py-typing.yaml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.github/workflows/release.yaml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.github/workflows/reusable-python.yaml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.gitignore +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.licenserc.yaml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.pre-commit-config.yaml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/.vscode/settings.json +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/CHANGELOG.md +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/Dockerfile +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/LICENSE +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/Makefile +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/README.md +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/RELEASE.md +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/base.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/bridge_mount.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/builds.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/cli.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/client.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/commands.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/console.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/contents.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/__main__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/accounts.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/adapters/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/adapters/daytona.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/adapters/e2b.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/adapters/managed.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/adapters/modal.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/attest.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/bases.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/breaker.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/build_secrets.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/builders.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/canonical.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/conformance.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/constraints/sandbox-contract-v1.txt +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/constraints/wheelhouse/README.md +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/constraints/wheelhouse/jupyter_server-2.21.0+datalayer.1-py3-none-any.whl +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/doctor/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/doctor/build.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/doctor/datalayer_sandbox.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/doctor/report.schema.json +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/errors.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/files.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/image_import.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/lifecycle.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/policy.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/redact.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/resolve.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/resolve_conda.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/schema.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/exceptions.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/filesystem.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/interfaces.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/jupyter_ingress.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/lifecycle.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/manage.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/provider_ingress.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/cloudflare/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/cloudflare/cloudflare.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/coreweave/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/coreweave/coreweave.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/datalayer/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/daytona/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/docker/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/docker/docker.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/e2b/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/e2b/e2b.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/eval/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/eval/eval.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/google_colab/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/google_colab/client.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/google_colab/google_colab.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/jupyter_server/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/jupyter_server/jupyter_server.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/kaggle/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/kaggle/client.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/kaggle/execute.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/kaggle/live.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/marimo/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/marimo/cells.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/marimo/marimo.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/marimo/reactive.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/marimo/reactive_kernel.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/modal/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/modal/modal.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/monty/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/monty/monty.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docker/Dockerfile +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/.gitignore +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/LICENSE +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/Makefile +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/README.md +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/babel.config.js +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/api-reference/_category_.yml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/api-reference/index.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/cli/_category_.yml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/cli/index.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/contribute/_category_.yml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/contribute/index.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/environments/_category_.yml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/environments/contract.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/environments/index.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/environments/spike-2026-09.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/examples/_category_.yml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/examples/index.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/guide/_category_.yml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/guide/index.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/index.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/install/_category_.yml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/install/index.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/provider-ingress/index.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/_category_.yml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/cloudflare.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/coreweave.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/datalayer.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/daytona.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/docker.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/e2b.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/eval.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/google-colab.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/index.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/jupyter-server.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/kaggle.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/marimo.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/modal.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docs/providers/monty.mdx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/docusaurus.config.js +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/package.json +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/sidebars.js +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/components/HomepageRow1.js +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/components/HomepageRow1.module.css +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/components/HomepageRow2.js +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/components/HomepageRow2.module.css +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/components/HomepageRow3.js +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/components/HomepageRow3.module.css +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/css/custom.css +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/pages/index.module.css +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/pages/markdown-page.md +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/theme/CustomDocItem.tsx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/src/theme/IconsTitle.tsx +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/bricks.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/building-construction.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/cloud-sun.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/cloud.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/collaboration.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/copy-left.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/datalayer/logo.png +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/datalayer/logo.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/datalayer/personas/business.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/datalayer/personas/data-scientist.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/datalayer/personas/devops.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/datalayer/project/project-line.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/favicon.ico +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/jupyter.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/open-source.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/react-js.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/react-js2.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/ringed-planet.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/robot.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/rocket.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/shield.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/sparkles.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/streamlit.gif +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/super-hero.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/target.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/docs/static/img/thumbs-up.svg +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/README.md +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/Makefile +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/cloudflare_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/coreweave_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/datalayer_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/daytona_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/docker_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/e2b_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/eval_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/google_colab_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/jupyter_server_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/kaggle_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/modal_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/exec/monty_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/Makefile +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/cloudflare_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/coreweave_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/datalayer_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/daytona_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/docker_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/e2b_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/eval_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/google_colab_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/jupyter_server_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/kaggle_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/modal_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/examples/repl/monty_sandbox_example.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/pyproject.toml +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/__init__.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/conftest.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/egress_logs/buildctl-base.log +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/egress_logs/buildctl-curl.log +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/egress_logs/buildctl-pip.log +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/egress_logs/buildctl-uv.log +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/egress_logs/micromamba.log +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_a_datalayer_sandbox_can_be_interrupted.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_bridge_mount.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_builds.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_cli_exec.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_cli_repl.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_client.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_client_contents.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_client_files.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_client_outcome_error_output.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_cloudflare.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_commands_envelope.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_console.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_contents_contract.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_contents_live_matrix.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_coreweave.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_daytona.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_e2b.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_accounts.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_attest.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_bases.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_breaker.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_build_secrets.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_builders.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_canonical.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_conformance.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_constraints.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_contract.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_cross_variant_report.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_datalayer_builder.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_daytona_builder.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_dockerfile_source.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_doctor.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_e2b_builder.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_egress_refusals.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_errors.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_image_import.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_lifecycle.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_live_matrix.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_managed_builders.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_modal_builder.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_organization_policy.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_redact.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_resolve.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_resolve_conda.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_spec.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_spec_organization_policy.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_eval.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_every_variant_has_a_real_interrupt.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_factory.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_google_colab.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_integration.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_jupyter_ingress.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_jupyter_server.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_jupyter_server_streaming.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_kaggle.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_kaggle_execute.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_kaggle_live.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_kaggle_session.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_kernel_client_compatibility.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_lifecycle_vocabulary.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_manage.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_manage_datalayer.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_marimo_cells.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_marimo_reactive_kernel.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_marimo_sandbox.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_modal_google_colab_sandbox.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_modal_session.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_models.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_output_line_fidelity.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_provider_catalog_names.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_provider_ingress.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_sandboxes.py +0 -0
- {code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_the_kill_relaunch_drill.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.11.5"
|
{code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/environments/adapters/datalayer.py
RENAMED
|
@@ -38,6 +38,7 @@ sandbox is launched through Runtimes' internal route and checked there
|
|
|
38
38
|
|
|
39
39
|
from __future__ import annotations
|
|
40
40
|
|
|
41
|
+
import base64
|
|
41
42
|
import json
|
|
42
43
|
import os
|
|
43
44
|
import shlex
|
|
@@ -210,6 +211,26 @@ def _pip_lock_command(find_links: str, *, authored: bool, foreign: bool = False)
|
|
|
210
211
|
)
|
|
211
212
|
|
|
212
213
|
|
|
214
|
+
def write_build_context(environment: Environment, root: Path) -> None:
|
|
215
|
+
"""Write a `foreignDockerfile`'s inline context where its `COPY`s read it.
|
|
216
|
+
|
|
217
|
+
Checked again here, against the folder itself, because this is the step
|
|
218
|
+
that writes to disk: nothing validated elsewhere is taken on trust.
|
|
219
|
+
"""
|
|
220
|
+
dockerfile = environment.spec.build.dockerfile
|
|
221
|
+
for item in (dockerfile.context if dockerfile else None) or []:
|
|
222
|
+
target = (root / item.path).resolve()
|
|
223
|
+
if not target.is_relative_to(root.resolve()) or target == root.resolve():
|
|
224
|
+
raise EnvironmentsError(
|
|
225
|
+
SPEC_INVALID,
|
|
226
|
+
f"`{item.path}` is not a path inside the build context",
|
|
227
|
+
detail={"field": "spec.build.dockerfile.context", "path": item.path},
|
|
228
|
+
)
|
|
229
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
230
|
+
target.write_bytes(base64.b64decode(item.content_base64))
|
|
231
|
+
target.chmod(0o755 if item.executable else 0o644)
|
|
232
|
+
|
|
233
|
+
|
|
213
234
|
def _contract_layer(request: BuildRequest) -> list[str]:
|
|
214
235
|
"""What makes a foreign image a sandbox, before its lock is installed: the
|
|
215
236
|
contract's files from the approved base it was resolved against, so they
|
|
@@ -241,6 +262,10 @@ def _contract_user() -> list[str]:
|
|
|
241
262
|
user, uid, gid, home = contract.user, contract.uid, contract.gid, contract.home
|
|
242
263
|
reserved, reserved_parent = contract.reserved_path, str(Path(contract.reserved_path).parent)
|
|
243
264
|
return [
|
|
265
|
+
# `datalayer` brings JupyterLab, which a sandbox never serves: it starts
|
|
266
|
+
# `jupyter server`. Out, and with it Lab's bundle and staging lock,
|
|
267
|
+
# whose pins can block the scan with no fixed release to move to.
|
|
268
|
+
"RUN uv pip uninstall --system jupyterlab",
|
|
244
269
|
f"RUN pwd > {TASK_WORKDIR_FILE} && chmod 0644 {TASK_WORKDIR_FILE} "
|
|
245
270
|
f'&& if [ "$(pwd)" != / ]; then find "$(pwd)" -path {reserved} -prune '
|
|
246
271
|
f"-o ! -path {reserved_parent} ! -path / -exec chown -h {uid}:{gid} {{}} +; fi",
|
|
@@ -577,6 +602,7 @@ class Builder:
|
|
|
577
602
|
root = Path(directory)
|
|
578
603
|
(root / "Dockerfile").write_text(self.dockerfile(request), encoding="utf-8")
|
|
579
604
|
(root / "lock.txt").write_text(request.lock_text, encoding="utf-8")
|
|
605
|
+
write_build_context(request.environment, root)
|
|
580
606
|
metadata = root / "metadata.json"
|
|
581
607
|
# A secret's value is never written under `root`: that directory
|
|
582
608
|
# is also `--local context=`, sent to `buildkitd` as ordinary
|
|
@@ -40,6 +40,8 @@ __all__ = [
|
|
|
40
40
|
"MAX_CONTEXT_FILES",
|
|
41
41
|
"MAX_CONTEXT_FILE_BYTES",
|
|
42
42
|
"MAX_CONTEXT_TOTAL_BYTES",
|
|
43
|
+
"MAX_INLINE_CONTEXT_BYTES",
|
|
44
|
+
"RESERVED_CONTEXT_PATHS",
|
|
43
45
|
"SANDBOX_CONTRACT_V1",
|
|
44
46
|
"SUPPORTED_CONTRACTS",
|
|
45
47
|
"BuildContextEntry",
|
|
@@ -537,8 +539,16 @@ def _approved_froms(text: str, bases: Mapping[str, ApprovedBase]) -> list[_Appro
|
|
|
537
539
|
return found
|
|
538
540
|
|
|
539
541
|
|
|
542
|
+
def _in_context(source: str, context: Sequence[str]) -> bool:
|
|
543
|
+
"""Whether a `COPY` source names a file of the context, or a folder of it."""
|
|
544
|
+
name = source.strip("/").removeprefix("./")
|
|
545
|
+
if name in ("", "."):
|
|
546
|
+
return bool(context)
|
|
547
|
+
return any(path == name or path.startswith(f"{name}/") for path in context)
|
|
548
|
+
|
|
549
|
+
|
|
540
550
|
def dockerfile_findings_for_build(
|
|
541
|
-
text: str, bases: Mapping[str, ApprovedBase] = APPROVED_BASES
|
|
551
|
+
text: str, bases: Mapping[str, ApprovedBase] = APPROVED_BASES, *, context: Sequence[str] = ()
|
|
542
552
|
) -> list[DockerfileFinding]:
|
|
543
553
|
"""What a Dockerfile source must also be to be built, beyond what the contract allows.
|
|
544
554
|
|
|
@@ -598,6 +608,7 @@ def dockerfile_findings_for_build(
|
|
|
598
608
|
continue
|
|
599
609
|
sources = [t for t in tokens if not t.startswith("--")][:-1]
|
|
600
610
|
local = [s for s in sources if not re.match(r"^(https?|git)://|^git@", s, re.IGNORECASE)]
|
|
611
|
+
local = [s for s in local if not _in_context(s, context)]
|
|
601
612
|
if local:
|
|
602
613
|
findings.append(
|
|
603
614
|
DockerfileFinding(
|
|
@@ -655,7 +666,7 @@ def _foreign_froms(text: str) -> list[tuple[int, str]]:
|
|
|
655
666
|
|
|
656
667
|
|
|
657
668
|
def foreign_dockerfile_findings(
|
|
658
|
-
text: str, *, registries: tuple[str, ...]
|
|
669
|
+
text: str, *, registries: tuple[str, ...], context: Sequence[str] = ()
|
|
659
670
|
) -> list[DockerfileFinding]:
|
|
660
671
|
"""What a Dockerfile on a foreign base must be: the contract's refusals, one
|
|
661
672
|
base, in `registries`, and no build context.
|
|
@@ -705,7 +716,7 @@ def foreign_dockerfile_findings(
|
|
|
705
716
|
findings += _foreign_stage_findings(text)
|
|
706
717
|
findings += [
|
|
707
718
|
finding
|
|
708
|
-
for finding in dockerfile_findings_for_build(text)
|
|
719
|
+
for finding in dockerfile_findings_for_build(text, context=context)
|
|
709
720
|
if finding.instruction in ("COPY", "ADD", "escape")
|
|
710
721
|
]
|
|
711
722
|
return sorted(findings, key=lambda finding: finding.line)
|
|
@@ -798,6 +809,11 @@ def pin_dockerfile_base(
|
|
|
798
809
|
MAX_CONTEXT_FILES = 2000
|
|
799
810
|
MAX_CONTEXT_FILE_BYTES = 50 * 1024 * 1024
|
|
800
811
|
MAX_CONTEXT_TOTAL_BYTES = 100 * 1024 * 1024
|
|
812
|
+
#: A context carried inside the spec, as a `foreignDockerfile` does: it is stored
|
|
813
|
+
#: with the version, so it is small, and its bytes are in the spec's digest.
|
|
814
|
+
MAX_INLINE_CONTEXT_BYTES = 1024 * 1024
|
|
815
|
+
#: What the build's own context already holds at its root.
|
|
816
|
+
RESERVED_CONTEXT_PATHS = ("Dockerfile", "lock.txt", "metadata.json", ".dockerignore")
|
|
801
817
|
|
|
802
818
|
_CONTEXT_SEPARATOR = re.compile(r"[\\/]")
|
|
803
819
|
|
|
@@ -22,6 +22,7 @@ base digest are the others.
|
|
|
22
22
|
|
|
23
23
|
from __future__ import annotations
|
|
24
24
|
|
|
25
|
+
import base64
|
|
25
26
|
import json
|
|
26
27
|
import posixpath
|
|
27
28
|
import re
|
|
@@ -29,7 +30,7 @@ from collections.abc import Mapping
|
|
|
29
30
|
from dataclasses import dataclass
|
|
30
31
|
from typing import Any, Literal
|
|
31
32
|
|
|
32
|
-
from pydantic import BaseModel, ConfigDict, Field, ValidationError
|
|
33
|
+
from pydantic import BaseModel, ConfigDict, Field, ValidationError, model_serializer
|
|
33
34
|
from pydantic.alias_generators import to_camel
|
|
34
35
|
|
|
35
36
|
from .bases import APPROVED_BASES, ApprovedBase
|
|
@@ -352,6 +353,14 @@ class DependencyFileSpec(_Model):
|
|
|
352
353
|
lock_content: str = ""
|
|
353
354
|
|
|
354
355
|
|
|
356
|
+
class ContextFile(_Model):
|
|
357
|
+
"""One file of an inline build context."""
|
|
358
|
+
|
|
359
|
+
path: str
|
|
360
|
+
content_base64: str
|
|
361
|
+
executable: bool = False
|
|
362
|
+
|
|
363
|
+
|
|
355
364
|
class DockerfileSpec(_Model):
|
|
356
365
|
"""The Dockerfile a `dockerfile`-sourced version builds from (E3-03).
|
|
357
366
|
|
|
@@ -369,6 +378,17 @@ class DockerfileSpec(_Model):
|
|
|
369
378
|
|
|
370
379
|
#: The Dockerfile text.
|
|
371
380
|
content: str = ""
|
|
381
|
+
#: The files its `COPY`s read, for a `foreignDockerfile`: inline, so the
|
|
382
|
+
#: spec's digest covers them, and bounded for it.
|
|
383
|
+
context: list[ContextFile] | None = None
|
|
384
|
+
|
|
385
|
+
@model_serializer(mode="wrap")
|
|
386
|
+
def _no_empty_context(self, handler: Any) -> dict[str, Any]:
|
|
387
|
+
"""Leave `context` out when there is none: a spec's digest does not move."""
|
|
388
|
+
dumped = handler(self)
|
|
389
|
+
if self.context is None:
|
|
390
|
+
dumped.pop("context", None)
|
|
391
|
+
return dumped
|
|
372
392
|
|
|
373
393
|
|
|
374
394
|
class ImageSourceSpec(_Model):
|
|
@@ -543,6 +563,38 @@ def parse_requirements_txt(text: str) -> list[str]:
|
|
|
543
563
|
return lines
|
|
544
564
|
|
|
545
565
|
|
|
566
|
+
def _context_findings(context: list[ContextFile]) -> list[SpecFinding]:
|
|
567
|
+
"""An inline context: the upload's own rules, and its bound."""
|
|
568
|
+
from .contract import (
|
|
569
|
+
MAX_INLINE_CONTEXT_BYTES,
|
|
570
|
+
RESERVED_CONTEXT_PATHS,
|
|
571
|
+
BuildContextEntry,
|
|
572
|
+
validate_build_context,
|
|
573
|
+
)
|
|
574
|
+
|
|
575
|
+
field = "spec.build.dockerfile.context"
|
|
576
|
+
findings: list[SpecFinding] = []
|
|
577
|
+
entries: list[BuildContextEntry] = []
|
|
578
|
+
for item in context:
|
|
579
|
+
try:
|
|
580
|
+
size = len(base64.b64decode(item.content_base64, validate=True))
|
|
581
|
+
except ValueError:
|
|
582
|
+
findings.append(SpecFinding(field, f"`{item.path}` is not base64"))
|
|
583
|
+
continue
|
|
584
|
+
entries.append(BuildContextEntry(path=item.path, size_bytes=size))
|
|
585
|
+
if item.path in RESERVED_CONTEXT_PATHS:
|
|
586
|
+
findings.append(SpecFinding(field, f"`{item.path}` is reserved by the build"))
|
|
587
|
+
findings += [
|
|
588
|
+
SpecFinding(field, f"`{found.path}` {found.message}")
|
|
589
|
+
for found in validate_build_context(entries)
|
|
590
|
+
]
|
|
591
|
+
if sum(entry.size_bytes for entry in entries) > MAX_INLINE_CONTEXT_BYTES:
|
|
592
|
+
findings.append(
|
|
593
|
+
SpecFinding(field, f"is over the {MAX_INLINE_CONTEXT_BYTES}-byte inline limit")
|
|
594
|
+
)
|
|
595
|
+
return findings
|
|
596
|
+
|
|
597
|
+
|
|
546
598
|
def _foreign_dockerfile_findings(
|
|
547
599
|
dockerfile: DockerfileSpec | None, *, registries: tuple[str, ...]
|
|
548
600
|
) -> list[SpecFinding]:
|
|
@@ -555,13 +607,19 @@ def _foreign_dockerfile_findings(
|
|
|
555
607
|
return [SpecFinding(f"{field}.content", "is empty; it is the Dockerfile text")]
|
|
556
608
|
from .contract import foreign_dockerfile_findings
|
|
557
609
|
|
|
558
|
-
|
|
610
|
+
context = dockerfile.context or []
|
|
611
|
+
problems = _context_findings(context)
|
|
612
|
+
return problems + [
|
|
559
613
|
SpecFinding(
|
|
560
614
|
f"{field}.content",
|
|
561
615
|
f"line {finding.line}: {finding.message}",
|
|
562
616
|
finding.code or SPEC_INVALID,
|
|
563
617
|
)
|
|
564
|
-
for finding in foreign_dockerfile_findings(
|
|
618
|
+
for finding in foreign_dockerfile_findings(
|
|
619
|
+
dockerfile.content,
|
|
620
|
+
registries=registries,
|
|
621
|
+
context=[item.path for item in context],
|
|
622
|
+
)
|
|
565
623
|
]
|
|
566
624
|
|
|
567
625
|
|
|
@@ -579,6 +637,8 @@ def _dockerfile_findings(dockerfile: DockerfileSpec | None) -> list[SpecFinding]
|
|
|
579
637
|
return [SpecFinding(field, "is required when `spec.build.source` is `dockerfile`")]
|
|
580
638
|
if not dockerfile.content.strip():
|
|
581
639
|
return [SpecFinding(f"{field}.content", "is empty; it is the Dockerfile text")]
|
|
640
|
+
if dockerfile.context is not None:
|
|
641
|
+
return [SpecFinding(f"{field}.context", "is taken by a `foreignDockerfile` source")]
|
|
582
642
|
from .contract import dockerfile_findings_for_build, validate_dockerfile
|
|
583
643
|
|
|
584
644
|
# The contract's refusals, then what building it needs on top (E3-03):
|
|
@@ -53,6 +53,17 @@ class SandboxEnvironment(BaseModel):
|
|
|
53
53
|
gpu_count: Optional[int] = None
|
|
54
54
|
gpu_memory: Optional[str] = None
|
|
55
55
|
|
|
56
|
+
#: Whether the environment is withheld from the platform's pickers.
|
|
57
|
+
#:
|
|
58
|
+
#: A disabled environment keeps its definition — it is still listed, still
|
|
59
|
+
#: named, and a caller that asks for it by name still gets it — but a
|
|
60
|
+
#: surface that offers environments to choose from shows it only on
|
|
61
|
+
#: request, greyed, and does not let it be picked. This is where an
|
|
62
|
+
#: environment is switched off for everyone: `provider_catalog` carries
|
|
63
|
+
#: it, the operator's `/v1/environments` serves it, and the pickers read
|
|
64
|
+
#: it from there, so no surface keeps its own list of what is off.
|
|
65
|
+
disabled: bool = False
|
|
66
|
+
|
|
56
67
|
@property
|
|
57
68
|
def features(self) -> list[str]:
|
|
58
69
|
"""What the environment is known to allow, beyond running code.
|
|
@@ -426,6 +426,10 @@ def provider_catalog(
|
|
|
426
426
|
"gpu_count": environment.gpu_count,
|
|
427
427
|
"gpu_memory": environment.gpu_memory,
|
|
428
428
|
"features": environment.features,
|
|
429
|
+
# Always said, like `features`: an environment
|
|
430
|
+
# is offered or it is not, and a picker must not
|
|
431
|
+
# have to guess which.
|
|
432
|
+
"disabled": environment.disabled,
|
|
429
433
|
}.items()
|
|
430
434
|
if value is not None
|
|
431
435
|
}
|
{code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/code_sandboxes/sandboxes/datalayer/datalayer.py
RENAMED
|
@@ -412,6 +412,8 @@ class DatalayerSandbox(Sandbox):
|
|
|
412
412
|
visibility=env.visibility,
|
|
413
413
|
burning_rate=float(env.burning_rate),
|
|
414
414
|
metadata=env.metadata,
|
|
415
|
+
# The platform's word on whether it may be picked.
|
|
416
|
+
disabled=bool(getattr(env, "disabled", False)),
|
|
415
417
|
)
|
|
416
418
|
for env in environments
|
|
417
419
|
]
|
|
@@ -424,6 +424,9 @@ class DaytonaSandbox(Sandbox):
|
|
|
424
424
|
expose `/dev/fuse`, so a local folder cannot be bridged in as a
|
|
425
425
|
filesystem on any of them — a snapshot built to expose FUSE, with
|
|
426
426
|
fusepy and the bridge client preinstalled, is what would carry it.
|
|
427
|
+
|
|
428
|
+
`daytona-gpu` is disabled on the platform (2 November 2026): kept,
|
|
429
|
+
and still startable by name, but no longer offered in the pickers.
|
|
427
430
|
"""
|
|
428
431
|
return [
|
|
429
432
|
SandboxEnvironment(
|
|
@@ -446,6 +449,7 @@ class DaytonaSandbox(Sandbox):
|
|
|
446
449
|
gpu_count=1,
|
|
447
450
|
gpu_memory=gpu_memory("H100"),
|
|
448
451
|
metadata={"variant": "daytona", "gpu": "H100", "spot": False, "features": []},
|
|
452
|
+
disabled=True,
|
|
449
453
|
),
|
|
450
454
|
SandboxEnvironment(
|
|
451
455
|
name="daytona-gpu-spot",
|
|
@@ -109,6 +109,9 @@ class KaggleSandbox(Sandbox):
|
|
|
109
109
|
named machine to run in, not a free-form choice of hardware. Kaggle
|
|
110
110
|
gives a notebook session either on CPU alone or with an accelerator
|
|
111
111
|
attached, so it ships one of each and nothing in between.
|
|
112
|
+
|
|
113
|
+
Both are disabled on the platform (2 November 2026): kept, and still
|
|
114
|
+
startable by name, but no longer offered in the environment pickers.
|
|
112
115
|
"""
|
|
113
116
|
return [
|
|
114
117
|
SandboxEnvironment(
|
|
@@ -119,6 +122,7 @@ class KaggleSandbox(Sandbox):
|
|
|
119
122
|
visibility="cloud",
|
|
120
123
|
burning_rate=0.0,
|
|
121
124
|
metadata={"variant": "kaggle", "accelerator": None},
|
|
125
|
+
disabled=True,
|
|
122
126
|
),
|
|
123
127
|
SandboxEnvironment(
|
|
124
128
|
name="kaggle-gpu",
|
|
@@ -131,6 +135,7 @@ class KaggleSandbox(Sandbox):
|
|
|
131
135
|
gpu_count=1,
|
|
132
136
|
gpu_memory=gpu_memory("T4"),
|
|
133
137
|
metadata={"variant": "kaggle", "accelerator": "T4"},
|
|
138
|
+
disabled=True,
|
|
134
139
|
),
|
|
135
140
|
]
|
|
136
141
|
|
|
@@ -42,7 +42,7 @@ A document is refused with `DL_ENV_SPEC_INVALID` when a field is wrong, and with
|
|
|
42
42
|
| `compatibility.variants.required` | `[datalayer]` | At least one of `datalayer`, `e2b`, `daytona`, `modal`. |
|
|
43
43
|
| `compatibility.variants.optional` | none | The same variants, none of them also required. |
|
|
44
44
|
| `compatibility.regions` | none | Region names. |
|
|
45
|
-
| `build.source` | `packages` | `packages`; `dependencyFile` (a `requirements.txt`; a `pyproject.toml` whose own `uv.lock` is checked against Datalayer's protected pins and exported rather than re-resolved; or a conda `environment.yml`, resolved in its own `micromamba` solve into an explicit lock with the protected pins merged over its `pip:` layer); `dockerfile` (`build.dockerfile.content`, inline: its `FROM` names an approved base with its channel as the tag, which is what resolves, and what its own instructions install is not locked, as the lock's header says); and `image` (an existing image from a bootstrap registry allowlist, replacing the approved base). `packages`, a `requirements.txt`, a `pyproject.toml` with its `uv.lock`, a conda `environment.yml` and `dockerfile` build on the Datalayer and Daytona variants. A `pyproject.toml`'s `uv.lock` has to lock Datalayer's `jupyter-server` fork, which no package index serves: the project takes it by URL from [the fork's release](https://github.com/datalayer-externals/jupyter-server/releases/tag/v2.21.0-datalayer.1), in `[tool.uv.sources]`, which is also what makes `uv` record its hash. `image` resolves but does not yet start as a sandbox, because the imported image has no Datalayer runtime layer; `image` from a private registry, and a `COPY` from a Dockerfile's build context, are refused.; `foreignDockerfile` (a Dockerfile `FROM` one image in the registries `image` may import from, Datalayer builder only). An `image` or `foreignDockerfile` must be Debian-derived; the build layers `sandbox-contract/v1` on it from an approved base (the contract files, PID 1, the kernel stack and the contract user, installing over what the image holds), and installs Python from its distribution if it has none. |
|
|
45
|
+
| `build.source` | `packages` | `packages`; `dependencyFile` (a `requirements.txt`; a `pyproject.toml` whose own `uv.lock` is checked against Datalayer's protected pins and exported rather than re-resolved; or a conda `environment.yml`, resolved in its own `micromamba` solve into an explicit lock with the protected pins merged over its `pip:` layer); `dockerfile` (`build.dockerfile.content`, inline: its `FROM` names an approved base with its channel as the tag, which is what resolves, and what its own instructions install is not locked, as the lock's header says); and `image` (an existing image from a bootstrap registry allowlist, replacing the approved base). `packages`, a `requirements.txt`, a `pyproject.toml` with its `uv.lock`, a conda `environment.yml` and `dockerfile` build on the Datalayer and Daytona variants. A `pyproject.toml`'s `uv.lock` has to lock Datalayer's `jupyter-server` fork, which no package index serves: the project takes it by URL from [the fork's release](https://github.com/datalayer-externals/jupyter-server/releases/tag/v2.21.0-datalayer.1), in `[tool.uv.sources]`, which is also what makes `uv` record its hash. `image` resolves but does not yet start as a sandbox, because the imported image has no Datalayer runtime layer; `image` from a private registry, and a `COPY` from a Dockerfile's build context, are refused.; `foreignDockerfile` (a Dockerfile `FROM` one image in the registries `image` may import from, Datalayer builder only; the files its `COPY`s read go inline in `build.dockerfile.context`, 1 MiB at most, so the spec's digest covers them). An `image` or `foreignDockerfile` must be Debian-derived; the build layers `sandbox-contract/v1` on it from an approved base (the contract files, PID 1, the kernel stack and the contract user, installing over what the image holds), and installs Python from its distribution if it has none. |
|
|
46
46
|
|
|
47
47
|
## The spec digest
|
|
48
48
|
|
|
@@ -203,6 +203,31 @@
|
|
|
203
203
|
"title": "ContentsBuildEntry",
|
|
204
204
|
"type": "object"
|
|
205
205
|
},
|
|
206
|
+
"ContextFile": {
|
|
207
|
+
"additionalProperties": false,
|
|
208
|
+
"description": "One file of an inline build context.",
|
|
209
|
+
"properties": {
|
|
210
|
+
"contentBase64": {
|
|
211
|
+
"title": "Contentbase64",
|
|
212
|
+
"type": "string"
|
|
213
|
+
},
|
|
214
|
+
"executable": {
|
|
215
|
+
"default": false,
|
|
216
|
+
"title": "Executable",
|
|
217
|
+
"type": "boolean"
|
|
218
|
+
},
|
|
219
|
+
"path": {
|
|
220
|
+
"title": "Path",
|
|
221
|
+
"type": "string"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"required": [
|
|
225
|
+
"path",
|
|
226
|
+
"contentBase64"
|
|
227
|
+
],
|
|
228
|
+
"title": "ContextFile",
|
|
229
|
+
"type": "object"
|
|
230
|
+
},
|
|
206
231
|
"DependencyFileSpec": {
|
|
207
232
|
"additionalProperties": false,
|
|
208
233
|
"description": "A `requirements.txt`, a `pyproject.toml` with its `uv.lock`, or a conda\n`environment.yml` (E3-01, E3-02).\n\n``requirements`` resolves the way ``packages`` does \u2014 the protected\nconstraints merged in, the same solve. ``pyproject`` does not resolve at\nall: its own ``uv.lock`` is verified against the current\n``pyproject.toml`` and exported, never re-solved, because a lock the\nauthor already made is the whole point of bringing one. ``conda`` resolves\nthe ``environment.yml`` in its own ``micromamba`` solve into an explicit\nlock, with the protected constraints merged over its ``pip:`` layer.",
|
|
@@ -239,6 +264,21 @@
|
|
|
239
264
|
"default": "",
|
|
240
265
|
"title": "Content",
|
|
241
266
|
"type": "string"
|
|
267
|
+
},
|
|
268
|
+
"context": {
|
|
269
|
+
"anyOf": [
|
|
270
|
+
{
|
|
271
|
+
"items": {
|
|
272
|
+
"$ref": "#/$defs/ContextFile"
|
|
273
|
+
},
|
|
274
|
+
"type": "array"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"type": "null"
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
"default": null,
|
|
281
|
+
"title": "Context"
|
|
242
282
|
}
|
|
243
283
|
},
|
|
244
284
|
"title": "DockerfileSpec",
|
|
@@ -439,3 +439,52 @@ def test_connecting_twice_is_connecting_once(one_runtime):
|
|
|
439
439
|
sandbox.run_code("print(2)")
|
|
440
440
|
|
|
441
441
|
assert sandbox._runtime.starts == 1
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
def test_the_platform_listing_keeps_a_disabled_environment_disabled(monkeypatch):
|
|
445
|
+
"""An environment the platform serves disabled stays disabled here."""
|
|
446
|
+
import sys
|
|
447
|
+
|
|
448
|
+
served = [
|
|
449
|
+
SimpleNamespace(
|
|
450
|
+
name=name,
|
|
451
|
+
title=name,
|
|
452
|
+
language="python",
|
|
453
|
+
owner="platform",
|
|
454
|
+
visibility="public",
|
|
455
|
+
burning_rate=1,
|
|
456
|
+
metadata={},
|
|
457
|
+
**extra,
|
|
458
|
+
)
|
|
459
|
+
for name, extra in (
|
|
460
|
+
("kaggle-gpu", {"disabled": True}),
|
|
461
|
+
("python-cpu", {"disabled": False}),
|
|
462
|
+
("older-service", {}),
|
|
463
|
+
)
|
|
464
|
+
]
|
|
465
|
+
|
|
466
|
+
class FakeClient:
|
|
467
|
+
def __init__(self, **_kwargs):
|
|
468
|
+
pass
|
|
469
|
+
|
|
470
|
+
def list_environments(self):
|
|
471
|
+
return served
|
|
472
|
+
|
|
473
|
+
urls = SimpleNamespace()
|
|
474
|
+
monkeypatch.setitem(
|
|
475
|
+
sys.modules, "datalayer_core", SimpleNamespace(utils=SimpleNamespace(urls=urls))
|
|
476
|
+
)
|
|
477
|
+
monkeypatch.setitem(sys.modules, "datalayer_core.utils", SimpleNamespace(urls=urls))
|
|
478
|
+
monkeypatch.setitem(sys.modules, "datalayer_core.utils.urls", urls)
|
|
479
|
+
monkeypatch.setitem(sys.modules, "agent_runtimes", SimpleNamespace())
|
|
480
|
+
monkeypatch.setitem(
|
|
481
|
+
sys.modules, "agent_runtimes.client", SimpleNamespace(AgentClient=FakeClient)
|
|
482
|
+
)
|
|
483
|
+
|
|
484
|
+
listed = DatalayerSandbox.list_environments(token="t")
|
|
485
|
+
|
|
486
|
+
assert {env.name: env.disabled for env in listed} == {
|
|
487
|
+
"kaggle-gpu": True,
|
|
488
|
+
"python-cpu": False,
|
|
489
|
+
"older-service": False,
|
|
490
|
+
}
|
{code_sandboxes-1.11.3 → code_sandboxes-1.11.5}/tests/test_environment_foreign_contract_layer.py
RENAMED
|
@@ -16,6 +16,7 @@ and the plane's start script and config, which `PLANE_DOCKERFILES` names.
|
|
|
16
16
|
# ruff: noqa: S603, S607
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
|
+
import base64
|
|
19
20
|
import json
|
|
20
21
|
import os
|
|
21
22
|
import shutil
|
|
@@ -31,9 +32,11 @@ from code_sandboxes.environments.adapters.datalayer import (
|
|
|
31
32
|
TASK_WORKDIR_FILE,
|
|
32
33
|
TINI_SHA256,
|
|
33
34
|
Builder,
|
|
35
|
+
write_build_context,
|
|
34
36
|
)
|
|
35
37
|
from code_sandboxes.environments.builders import BuildRequest
|
|
36
38
|
from code_sandboxes.environments.contract import (
|
|
39
|
+
MAX_INLINE_CONTEXT_BYTES,
|
|
37
40
|
foreign_dockerfile_findings,
|
|
38
41
|
pin_foreign_dockerfile_base,
|
|
39
42
|
)
|
|
@@ -50,7 +53,7 @@ from code_sandboxes.environments.resolve import (
|
|
|
50
53
|
merge_requirements,
|
|
51
54
|
resolve_environment,
|
|
52
55
|
)
|
|
53
|
-
from code_sandboxes.environments.spec import parse_environment, spec_findings
|
|
56
|
+
from code_sandboxes.environments.spec import parse_environment, spec_digest, spec_findings
|
|
54
57
|
|
|
55
58
|
BASE = "datalayer/python-cpu@sha256:" + "a" * 64
|
|
56
59
|
FOREIGN = "docker.io/library/python@sha256:" + "b" * 64
|
|
@@ -252,6 +255,83 @@ class TestTheReviewsFindings:
|
|
|
252
255
|
assert plane_of({"PLANE_DOCKERFILES": "/no/such/plane"}) is None
|
|
253
256
|
|
|
254
257
|
|
|
258
|
+
def with_context(content, *files):
|
|
259
|
+
spec = dockerfile_source(content)
|
|
260
|
+
spec["spec"]["build"]["dockerfile"]["context"] = [
|
|
261
|
+
{"path": path, "contentBase64": base64.b64encode(data).decode(), **extra}
|
|
262
|
+
for path, data, extra in files
|
|
263
|
+
]
|
|
264
|
+
return spec
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class TestABuildContext:
|
|
268
|
+
"""Inline, so the spec's digest covers its bytes, and bounded because of it."""
|
|
269
|
+
|
|
270
|
+
COPIES = "FROM python:3.12\nCOPY app/run.sh /run.sh\n"
|
|
271
|
+
|
|
272
|
+
def test_a_copy_of_what_it_holds_is_taken(self):
|
|
273
|
+
assert findings(with_context(self.COPIES, ("app/run.sh", b"x", {}))) == []
|
|
274
|
+
|
|
275
|
+
def test_a_copy_of_its_folder_is_taken(self):
|
|
276
|
+
content = "FROM python:3.12\nCOPY app/ /app/\n"
|
|
277
|
+
assert findings(with_context(content, ("app/run.sh", b"x", {}))) == []
|
|
278
|
+
|
|
279
|
+
def test_a_copy_of_what_it_does_not_hold_is_refused(self):
|
|
280
|
+
said = findings(with_context(self.COPIES, ("other.txt", b"x", {})))
|
|
281
|
+
assert "build context" in said[0]
|
|
282
|
+
|
|
283
|
+
def test_with_none_a_copy_stays_refused(self):
|
|
284
|
+
assert "build context" in findings(dockerfile_source(self.COPIES))[0]
|
|
285
|
+
|
|
286
|
+
@pytest.mark.parametrize(
|
|
287
|
+
("path", "said"),
|
|
288
|
+
[
|
|
289
|
+
("../escape", "escapes the context"),
|
|
290
|
+
("/etc/passwd", "absolute path"),
|
|
291
|
+
("Dockerfile", "reserved"),
|
|
292
|
+
("lock.txt", "reserved"),
|
|
293
|
+
],
|
|
294
|
+
)
|
|
295
|
+
def test_a_path_that_is_not_a_context_path_is_refused(self, path, said):
|
|
296
|
+
spec = with_context("FROM python:3.12\n", (path, b"x", {}))
|
|
297
|
+
assert said in " ".join(findings(spec))
|
|
298
|
+
|
|
299
|
+
def test_it_is_bounded(self):
|
|
300
|
+
spec = with_context(
|
|
301
|
+
"FROM python:3.12\n", ("big", b"x" * (MAX_INLINE_CONTEXT_BYTES + 1), {})
|
|
302
|
+
)
|
|
303
|
+
assert "inline" in " ".join(findings(spec))
|
|
304
|
+
|
|
305
|
+
def test_what_is_not_base64_is_refused(self):
|
|
306
|
+
spec = dockerfile_source("FROM python:3.12\n")
|
|
307
|
+
spec["spec"]["build"]["dockerfile"]["context"] = [{"path": "a", "contentBase64": "%%"}]
|
|
308
|
+
assert "base64" in " ".join(findings(spec))
|
|
309
|
+
|
|
310
|
+
def test_only_a_foreign_dockerfile_takes_one(self):
|
|
311
|
+
spec = with_context("FROM datalayer/python-cpu:2026.09\n", ("a", b"x", {}))
|
|
312
|
+
spec["spec"]["build"]["source"] = "dockerfile"
|
|
313
|
+
assert "foreignDockerfile" in " ".join(findings(spec))
|
|
314
|
+
|
|
315
|
+
def test_its_bytes_are_in_the_digest(self):
|
|
316
|
+
one = parse_environment(with_context(self.COPIES, ("app/run.sh", b"one", {})))
|
|
317
|
+
two = parse_environment(with_context(self.COPIES, ("app/run.sh", b"two", {})))
|
|
318
|
+
assert spec_digest(one) != spec_digest(two)
|
|
319
|
+
|
|
320
|
+
def test_a_spec_with_none_keeps_the_digest_it_had(self):
|
|
321
|
+
parsed = parse_environment(dockerfile_source(self.COPIES))
|
|
322
|
+
dumped = parsed.spec.model_dump(by_alias=True, mode="json")
|
|
323
|
+
assert "context" not in dumped["build"]["dockerfile"]
|
|
324
|
+
|
|
325
|
+
def test_the_builder_writes_it_beside_the_dockerfile(self, tmp_path):
|
|
326
|
+
request = request_of(
|
|
327
|
+
with_context(self.COPIES, ("app/run.sh", b"#!/bin/sh\n", {"executable": True}))
|
|
328
|
+
)
|
|
329
|
+
write_build_context(request.environment, tmp_path)
|
|
330
|
+
written = tmp_path / "app" / "run.sh"
|
|
331
|
+
assert written.read_bytes() == b"#!/bin/sh\n"
|
|
332
|
+
assert written.stat().st_mode & 0o111
|
|
333
|
+
|
|
334
|
+
|
|
255
335
|
class TestTheRegistries:
|
|
256
336
|
def test_the_list_is_what_it_was(self):
|
|
257
337
|
assert DEFAULT_ALLOWED_REGISTRIES == (
|
|
@@ -367,6 +447,7 @@ def solve_and_build(approved, tmp_path, spec, base):
|
|
|
367
447
|
context = tmp_path / "context"
|
|
368
448
|
context.mkdir()
|
|
369
449
|
(context / "lock.txt").write_text(locked["content"])
|
|
450
|
+
write_build_context(parse_environment(spec), context)
|
|
370
451
|
rendered = Builder().dockerfile(request_of(spec, lock=locked["content"], base=base))
|
|
371
452
|
(context / "Dockerfile").write_text(rendered)
|
|
372
453
|
tag = f"foreign-layer:{uuid.uuid4().hex[:8]}"
|
|
@@ -480,6 +561,15 @@ class TestARealImage:
|
|
|
480
561
|
)
|
|
481
562
|
self._settled(solve_and_build(approved, tmp_path, spec, base))
|
|
482
563
|
|
|
564
|
+
def test_a_context_is_copied_into_the_image(self, approved, tmp_path):
|
|
565
|
+
base = self._digest("python:3.12-slim")
|
|
566
|
+
spec = with_context(
|
|
567
|
+
"FROM python:3.12-slim\nCOPY app/ /app/\nRUN /app/run.sh > /built\n",
|
|
568
|
+
("app/run.sh", b"#!/bin/sh\necho from-the-context\n", {"executable": True}),
|
|
569
|
+
)
|
|
570
|
+
tag = solve_and_build(approved, tmp_path, spec, base)
|
|
571
|
+
assert docker("run", "--rm", tag, "cat", "/built").strip() == "from-the-context"
|
|
572
|
+
|
|
483
573
|
def test_an_image_with_no_python_gets_its_distributions(self, approved, tmp_path):
|
|
484
574
|
base = self._digest("ubuntu:24.04")
|
|
485
575
|
tag = solve_and_build(approved, tmp_path, image_source("ubuntu:24.04"), base)
|
|
@@ -509,3 +599,11 @@ def test_the_kernel_runs_in_the_contracts_working_directory():
|
|
|
509
599
|
|
|
510
600
|
pinned = next(line for line in _contract_user() if "MappingKernelManager.root_dir" in line)
|
|
511
601
|
assert "/home/datalayer" in pinned and "/usr/local/share/jupyter_config.py" in pinned
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
def test_a_foreign_image_keeps_no_jupyterlab():
|
|
605
|
+
"""A sandbox starts `jupyter server`. JupyterLab, which `datalayer` brings, is
|
|
606
|
+
taken out once the lock is installed, its bundle and staging lock with it."""
|
|
607
|
+
from code_sandboxes.environments.adapters.datalayer import _contract_user
|
|
608
|
+
|
|
609
|
+
assert "RUN uv pip uninstall --system jupyterlab" in _contract_user()
|
|
@@ -147,3 +147,27 @@ def test_a_provider_carries_the_mark_it_is_drawn_with():
|
|
|
147
147
|
# No mark for it in the set yet, which is said as nothing rather than as
|
|
148
148
|
# a slug that resolves to whatever the reader keeps for the unknown.
|
|
149
149
|
assert catalog["cloudflare"]["icon"] is None
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def test_kaggle_and_daytona_gpu_are_disabled_and_kept():
|
|
153
|
+
"""Disabled on the platform, not removed: the catalogue still serves them.
|
|
154
|
+
|
|
155
|
+
The pickers hide a disabled environment behind "Show disabled
|
|
156
|
+
environments" and refuse to pick it; the flag is set here, on the
|
|
157
|
+
definition, and nowhere else.
|
|
158
|
+
"""
|
|
159
|
+
secrets = {"KAGGLE_API_TOKEN": "t", "DAYTONA_API_KEY": "t"}
|
|
160
|
+
catalog = {entry["name"]: entry for entry in provider_catalog(secrets, ("kaggle", "daytona"))}
|
|
161
|
+
|
|
162
|
+
kaggle = {env["name"]: env for env in catalog["kaggle"]["environments"]}
|
|
163
|
+
daytona = {env["name"]: env for env in catalog["daytona"]["environments"]}
|
|
164
|
+
|
|
165
|
+
assert set(kaggle) == {"kaggle-cpu", "kaggle-gpu"}
|
|
166
|
+
assert all(env["disabled"] for env in kaggle.values())
|
|
167
|
+
assert daytona["daytona-gpu"]["disabled"] is True
|
|
168
|
+
assert daytona["daytona-default"]["disabled"] is False
|
|
169
|
+
assert daytona["daytona-gpu-spot"]["disabled"] is False
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def test_an_environment_is_offered_unless_it_says_otherwise():
|
|
173
|
+
assert _environment("plain").disabled is False
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.11.3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|