code-sandboxes 1.9.30__tar.gz → 1.9.32__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.
Files changed (266) hide show
  1. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/PKG-INFO +1 -1
  2. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/__version__.py +1 -1
  3. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/daytona_sandbox.py +19 -1
  4. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/adapters/daytona.py +78 -44
  5. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/bases.py +16 -2
  6. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/conformance.py +104 -9
  7. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/resolve.py +50 -0
  8. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/spec.py +18 -0
  9. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/environments/specification.mdx +2 -2
  10. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/daytona.mdx +37 -9
  11. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/e2b.mdx +1 -1
  12. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/modal.mdx +1 -1
  13. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_daytona.py +38 -0
  14. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_bases.py +19 -8
  15. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_conformance.py +42 -0
  16. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_daytona_builder.py +108 -11
  17. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_managed_builders.py +3 -2
  18. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_resolve.py +87 -1
  19. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_spec.py +12 -0
  20. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/.github/workflows/build.yml +0 -0
  21. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/.github/workflows/environments-live.yml +0 -0
  22. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/.github/workflows/py-code-style.yml +0 -0
  23. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/.github/workflows/py-tests.yml +0 -0
  24. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/.github/workflows/py-typing.yml +0 -0
  25. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/.github/workflows/reusable-python.yml +0 -0
  26. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/.gitignore +0 -0
  27. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/.licenserc.yaml +0 -0
  28. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/.pre-commit-config.yaml +0 -0
  29. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/.vscode/settings.json +0 -0
  30. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/CHANGELOG.md +0 -0
  31. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/Dockerfile +0 -0
  32. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/LICENSE +0 -0
  33. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/Makefile +0 -0
  34. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/README.md +0 -0
  35. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/__init__.py +0 -0
  36. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/base.py +0 -0
  37. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/bridge_mount.py +0 -0
  38. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/builds.py +0 -0
  39. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/cli.py +0 -0
  40. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/client.py +0 -0
  41. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/cloudflare_sandbox.py +0 -0
  42. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/commands.py +0 -0
  43. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/console.py +0 -0
  44. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/contents.py +0 -0
  45. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/coreweave_sandbox.py +0 -0
  46. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/datalayer_sandbox.py +0 -0
  47. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/docker_sandbox.py +0 -0
  48. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/e2b_sandbox.py +0 -0
  49. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/__init__.py +0 -0
  50. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/__main__.py +0 -0
  51. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/accounts.py +0 -0
  52. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/adapters/__init__.py +0 -0
  53. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/adapters/datalayer.py +0 -0
  54. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/adapters/e2b.py +0 -0
  55. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/adapters/managed.py +0 -0
  56. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/adapters/modal.py +0 -0
  57. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/attest.py +0 -0
  58. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/breaker.py +0 -0
  59. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/build_secrets.py +0 -0
  60. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/builders.py +0 -0
  61. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/canonical.py +0 -0
  62. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/constraints/sandbox-contract-v1.txt +0 -0
  63. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/constraints/wheelhouse/README.md +0 -0
  64. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/constraints/wheelhouse/jupyter_server-2.21.0+datalayer.1-py3-none-any.whl +0 -0
  65. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/contract.py +0 -0
  66. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/doctor/__init__.py +0 -0
  67. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/doctor/build.py +0 -0
  68. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/doctor/datalayer_sandbox.py +0 -0
  69. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/doctor/report.schema.json +0 -0
  70. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/errors.py +0 -0
  71. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/files.py +0 -0
  72. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/image_import.py +0 -0
  73. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/lifecycle.py +0 -0
  74. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/policy.py +0 -0
  75. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/redact.py +0 -0
  76. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/resolve_conda.py +0 -0
  77. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/environments/schema.py +0 -0
  78. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/eval_sandbox.py +0 -0
  79. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/exceptions.py +0 -0
  80. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/filesystem.py +0 -0
  81. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/google_colab.py +0 -0
  82. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/google_colab_sandbox.py +0 -0
  83. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/interfaces.py +0 -0
  84. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/jupyter_ingress.py +0 -0
  85. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/jupyter_server_sandbox.py +0 -0
  86. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/kaggle.py +0 -0
  87. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/kaggle_execute.py +0 -0
  88. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/kaggle_live.py +0 -0
  89. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/kaggle_sandbox.py +0 -0
  90. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/lifecycle.py +0 -0
  91. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/manage.py +0 -0
  92. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/modal_sandbox.py +0 -0
  93. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/models.py +0 -0
  94. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/monty_sandbox.py +0 -0
  95. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/provider_ingress.py +0 -0
  96. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/code_sandboxes/providers.py +0 -0
  97. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docker/Dockerfile +0 -0
  98. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/.gitignore +0 -0
  99. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/LICENSE +0 -0
  100. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/Makefile +0 -0
  101. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/README.md +0 -0
  102. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/babel.config.js +0 -0
  103. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/api-reference/_category_.yml +0 -0
  104. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/api-reference/index.mdx +0 -0
  105. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/cli/_category_.yml +0 -0
  106. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/cli/index.mdx +0 -0
  107. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/contribute/_category_.yml +0 -0
  108. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/contribute/index.mdx +0 -0
  109. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/environments/_category_.yml +0 -0
  110. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/environments/contract.mdx +0 -0
  111. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/environments/index.mdx +0 -0
  112. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/environments/spike-2026-09.mdx +0 -0
  113. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/examples/_category_.yml +0 -0
  114. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/examples/index.mdx +0 -0
  115. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/guide/_category_.yml +0 -0
  116. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/guide/index.mdx +0 -0
  117. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/index.mdx +0 -0
  118. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/install/_category_.yml +0 -0
  119. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/install/index.mdx +0 -0
  120. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/provider-ingress.mdx +0 -0
  121. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/_category_.yml +0 -0
  122. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/cloudflare.mdx +0 -0
  123. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/coreweave.mdx +0 -0
  124. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/datalayer.mdx +0 -0
  125. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/docker.mdx +0 -0
  126. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/eval.mdx +0 -0
  127. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/google-colab.mdx +0 -0
  128. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/index.mdx +0 -0
  129. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/jupyter-server.mdx +0 -0
  130. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/kaggle.mdx +0 -0
  131. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docs/providers/monty.mdx +0 -0
  132. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/docusaurus.config.js +0 -0
  133. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/package.json +0 -0
  134. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/sidebars.js +0 -0
  135. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/components/HomepageRow1.js +0 -0
  136. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/components/HomepageRow1.module.css +0 -0
  137. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/components/HomepageRow2.js +0 -0
  138. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/components/HomepageRow2.module.css +0 -0
  139. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/components/HomepageRow3.js +0 -0
  140. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/components/HomepageRow3.module.css +0 -0
  141. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/css/custom.css +0 -0
  142. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/pages/index.module.css +0 -0
  143. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/pages/markdown-page.md +0 -0
  144. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/theme/CustomDocItem.tsx +0 -0
  145. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/src/theme/IconsTitle.tsx +0 -0
  146. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/bricks.svg +0 -0
  147. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/building-construction.svg +0 -0
  148. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/cloud-sun.svg +0 -0
  149. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/cloud.svg +0 -0
  150. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/collaboration.svg +0 -0
  151. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/copy-left.svg +0 -0
  152. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/datalayer/logo.png +0 -0
  153. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/datalayer/logo.svg +0 -0
  154. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/datalayer/personas/business.svg +0 -0
  155. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/datalayer/personas/data-scientist.svg +0 -0
  156. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/datalayer/personas/devops.svg +0 -0
  157. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/datalayer/project/project-line.svg +0 -0
  158. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/favicon.ico +0 -0
  159. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/jupyter.svg +0 -0
  160. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/open-source.svg +0 -0
  161. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/react-js.svg +0 -0
  162. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/react-js2.svg +0 -0
  163. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/ringed-planet.svg +0 -0
  164. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/robot.svg +0 -0
  165. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/rocket.svg +0 -0
  166. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/shield.svg +0 -0
  167. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/sparkles.svg +0 -0
  168. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/streamlit.gif +0 -0
  169. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/super-hero.svg +0 -0
  170. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/target.svg +0 -0
  171. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/docs/static/img/thumbs-up.svg +0 -0
  172. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/README.md +0 -0
  173. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/Makefile +0 -0
  174. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/cloudflare_sandbox_example.py +0 -0
  175. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/coreweave_sandbox_example.py +0 -0
  176. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/datalayer_sandbox_example.py +0 -0
  177. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/daytona_sandbox_example.py +0 -0
  178. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/docker_sandbox_example.py +0 -0
  179. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/e2b_sandbox_example.py +0 -0
  180. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/eval_sandbox_example.py +0 -0
  181. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/google_colab_sandbox_example.py +0 -0
  182. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/jupyter_server_sandbox_example.py +0 -0
  183. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/kaggle_sandbox_example.py +0 -0
  184. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/modal_sandbox_example.py +0 -0
  185. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/exec/monty_sandbox_example.py +0 -0
  186. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/Makefile +0 -0
  187. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/cloudflare_sandbox_example.py +0 -0
  188. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/coreweave_sandbox_example.py +0 -0
  189. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/datalayer_sandbox_example.py +0 -0
  190. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/daytona_sandbox_example.py +0 -0
  191. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/docker_sandbox_example.py +0 -0
  192. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/e2b_sandbox_example.py +0 -0
  193. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/eval_sandbox_example.py +0 -0
  194. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/google_colab_sandbox_example.py +0 -0
  195. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/jupyter_server_sandbox_example.py +0 -0
  196. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/kaggle_sandbox_example.py +0 -0
  197. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/modal_sandbox_example.py +0 -0
  198. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/examples/repl/monty_sandbox_example.py +0 -0
  199. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/pyproject.toml +0 -0
  200. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/schemas/environment-v1alpha1.json +0 -0
  201. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/__init__.py +0 -0
  202. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/conftest.py +0 -0
  203. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_a_datalayer_sandbox_can_be_interrupted.py +0 -0
  204. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_bridge_mount.py +0 -0
  205. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_builds.py +0 -0
  206. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_cli_exec.py +0 -0
  207. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_cli_repl.py +0 -0
  208. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_client.py +0 -0
  209. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_client_contents.py +0 -0
  210. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_client_files.py +0 -0
  211. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_client_outcome_error_output.py +0 -0
  212. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_cloudflare.py +0 -0
  213. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_commands_envelope.py +0 -0
  214. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_console.py +0 -0
  215. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_contents_contract.py +0 -0
  216. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_contents_live_matrix.py +0 -0
  217. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_coreweave.py +0 -0
  218. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_datalayer_sandbox.py +0 -0
  219. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_e2b.py +0 -0
  220. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_accounts.py +0 -0
  221. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_attest.py +0 -0
  222. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_breaker.py +0 -0
  223. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_build_secrets.py +0 -0
  224. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_builders.py +0 -0
  225. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_canonical.py +0 -0
  226. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_constraints.py +0 -0
  227. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_contract.py +0 -0
  228. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_cross_variant_report.py +0 -0
  229. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_datalayer_builder.py +0 -0
  230. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_dockerfile_source.py +0 -0
  231. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_doctor.py +0 -0
  232. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_e2b_builder.py +0 -0
  233. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_errors.py +0 -0
  234. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_image_import.py +0 -0
  235. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_lifecycle.py +0 -0
  236. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_live_matrix.py +0 -0
  237. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_modal_builder.py +0 -0
  238. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_organization_policy.py +0 -0
  239. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_redact.py +0 -0
  240. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_resolve_conda.py +0 -0
  241. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_environment_spec_organization_policy.py +0 -0
  242. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_eval.py +0 -0
  243. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_every_variant_has_a_real_interrupt.py +0 -0
  244. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_factory.py +0 -0
  245. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_google_colab.py +0 -0
  246. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_integration.py +0 -0
  247. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_jupyter_ingress.py +0 -0
  248. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_jupyter_server.py +0 -0
  249. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_jupyter_server_streaming.py +0 -0
  250. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_kaggle.py +0 -0
  251. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_kaggle_execute.py +0 -0
  252. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_kaggle_live.py +0 -0
  253. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_kaggle_session.py +0 -0
  254. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_kernel_client_compatibility.py +0 -0
  255. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_lifecycle_vocabulary.py +0 -0
  256. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_manage.py +0 -0
  257. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_manage_datalayer.py +0 -0
  258. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_modal_google_colab_sandbox.py +0 -0
  259. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_modal_session.py +0 -0
  260. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_models.py +0 -0
  261. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_output_line_fidelity.py +0 -0
  262. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_provider_catalog_names.py +0 -0
  263. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_provider_ingress.py +0 -0
  264. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_providers.py +0 -0
  265. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_sandboxes.py +0 -0
  266. {code_sandboxes-1.9.30 → code_sandboxes-1.9.32}/tests/test_the_kill_relaunch_drill.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: code_sandboxes
3
- Version: 1.9.30
3
+ Version: 1.9.32
4
4
  Project-URL: Home, https://github.com/datalayer/code-sandboxes
5
5
  Author-email: Datalayer <info@datalayer.io>
6
6
  License: BSD 3-Clause License
@@ -3,4 +3,4 @@
3
3
 
4
4
  """Code Sandboxes."""
5
5
 
6
- __version__ = "1.9.30"
6
+ __version__ = "1.9.32"
@@ -510,6 +510,24 @@ class DaytonaSandbox(Sandbox):
510
510
  given = {key: value for key, value in settings.items() if value}
511
511
  return daytona.DaytonaConfig(**given) if given else None
512
512
 
513
+ def _snapshot_carries_a_gpu(self) -> bool:
514
+ """Whether the snapshot this sandbox starts from was built with a GPU (E2-17).
515
+
516
+ A GPU is baked into a snapshot with its other resources, so a sandbox
517
+ of one asks for a GPU without saying so, and Daytona refuses it unless
518
+ it is ephemeral, the same as one asked for with `gpu=`. The snapshot
519
+ record says: a GPU environment's artifact, launched by its id, reads
520
+ `gpu` there. One that cannot be read is taken to have none, and
521
+ Daytona's own refusal then says why.
522
+ """
523
+ if self._snapshot is None or self._daytona is None:
524
+ return False
525
+ try:
526
+ snapshot = self._daytona.snapshot.get(self._snapshot)
527
+ except Exception:
528
+ return False
529
+ return bool(getattr(snapshot, "gpu", 0))
530
+
513
531
  def _create_params(self, daytona: Any) -> Any: # noqa: C901
514
532
  """What to ask Daytona for, from the configuration of this sandbox.
515
533
 
@@ -534,7 +552,7 @@ class DaytonaSandbox(Sandbox):
534
552
  ]
535
553
 
536
554
  resources = self._resources(daytona)
537
- if _asks_for_a_gpu(resources):
555
+ if _asks_for_a_gpu(resources) or self._snapshot_carries_a_gpu():
538
556
  # Daytona will not create a GPU sandbox that outlives its stop:
539
557
  # "GPU sandboxes must be ephemeral; set autoDeleteInterval to 0".
540
558
  # It is a property of asking for a GPU at all, not of asking for
@@ -69,18 +69,13 @@ would make an artifact refuse to build for a reason that says nothing about
69
69
  what it does once actually launched. A real answer needs a launched
70
70
  sandbox, which is a smoke test's job (E1-14), not this builder's.
71
71
 
72
- **GPU classes are not built here.** `gpu = True` on this builder is a true
73
- capability (Daytona's own hardware runs one, D-20), and `validate` leaves a
74
- GPU size class buildable rather than refusing it — the constraint table of
75
- section 6 has nothing against it, and an existing test
76
- (`test_a_gpu_spec_is_buildable_on_modal_and_daytona`) already pins that
77
- answer. What actually stops a GPU build today is upstream: the CUDA base
78
- channel is E2-17's to publish, and `bases.py` has no digest to resolve
79
- `python-cuda` to yet, so a `BuildRequest` for one cannot be constructed in
80
- practice. `build()` itself still guards it explicitly, refusing plainly
81
- rather than baking an unsourced guess at a GPU type and count into a
82
- snapshot, in case that ever changes before the real numbers do (section 11.3
83
- item 7).
72
+ **A GPU is baked into the snapshot** (E2-17, D-20), from the spec's own
73
+ `resources.accelerator`: its `type` is one of Daytona's GPUs, checked at
74
+ `validate` so a GPU Daytona does not offer is refused before any build, and
75
+ its `count` is the number of them. CPU and memory come from the spec's hints,
76
+ or Daytona's own default for that GPU; the disk from the hints, or enough for
77
+ the CUDA base. A sandbox of a GPU snapshot is ephemeral, which Daytona
78
+ requires of every GPU sandbox (`DaytonaSandbox` reads the snapshot's `gpu`).
84
79
 
85
80
  @module code_sandboxes.environments.adapters.daytona
86
81
  """
@@ -118,10 +113,10 @@ from ..resolve_conda import (
118
113
  micromamba_bootstrap_command,
119
114
  micromamba_install_command,
120
115
  )
121
- from ..spec import GPU_SIZE_CLASSES, Environment
116
+ from ..spec import GPU_SIZE_CLASSES, Environment, EnvironmentSpec
122
117
  from .managed import ManagedBuilder
123
118
 
124
- __all__ = ["Builder"]
119
+ __all__ = ["DAYTONA_GPUS", "Builder", "daytona_gpu"]
125
120
 
126
121
  #: Tags Daytona refuses for a snapshot's source image: each moves.
127
122
  MOVING_TAGS = ("latest", "lts", "stable")
@@ -148,6 +143,26 @@ _CPU_RESOURCES: dict[str, dict[str, int]] = {
148
143
  }
149
144
 
150
145
 
146
+ #: The GPUs Daytona offers, as its SDK's `GpuType` names them (E2-17). Spelled
147
+ #: out rather than read from the SDK, because `validate` runs where the SDK may
148
+ #: not be installed; a test holds the two together.
149
+ DAYTONA_GPUS: tuple[str, ...] = ("H100", "H200", "RTX-PRO-6000", "RTX-4090", "RTX-5090")
150
+
151
+ #: A GPU snapshot's disk when the spec gives no hint: the CUDA base alone is
152
+ #: about 15 GB, and Daytona's own default would not hold it with room to work.
153
+ _GPU_DISK_GI = 50
154
+
155
+
156
+ def daytona_gpu(accelerator_type: str) -> str | None:
157
+ """Daytona's name for an accelerator type, or `None` when Daytona has no such GPU.
158
+
159
+ `h100`, `H100` and `rtx_4090` name what Daytona calls `H100` and
160
+ `RTX-4090`; a `T4` or an `A100-80GB` is Modal's vocabulary, not Daytona's.
161
+ """
162
+ name = accelerator_type.strip().upper().replace("_", "-")
163
+ return name if name in DAYTONA_GPUS else None
164
+
165
+
151
166
  def _pip_lock_command(*, authored: bool) -> str:
152
167
  """Install the pip lock: `sync` to it, or `install` it over an authored Dockerfile.
153
168
 
@@ -204,8 +219,8 @@ class Builder(ManagedBuilder):
204
219
  #: 2026-09-17.
205
220
  forbidden_instructions = ()
206
221
  dependency_formats = ("requirements", "pyproject", "conda")
207
- #: Daytona runs GPUs, on its own hardware and the owner's account (E2-17).
208
- #: This builder does not build one yet: see `_own_findings`.
222
+ #: Daytona runs GPUs, on its own hardware and the owner's account (E2-17),
223
+ #: baked into the snapshot with the rest of its resources.
209
224
  gpu = True
210
225
  #: E0-04's spike found only a registry login for the private base, never
211
226
  #: a per-step arbitrary named secret (E3-05): `buildSecrets` is refused.
@@ -300,15 +315,7 @@ class Builder(ManagedBuilder):
300
315
  field="spec.compatibility.regions",
301
316
  )
302
317
  )
303
- # A GPU class is left buildable here on purpose (`gpu = True`,
304
- # D-20): the CUDA base E2-17 has not published yet, so a GPU
305
- # `BuildRequest` cannot reach `build()` in practice — `bases.py`'s
306
- # own resolver has no digest to resolve `python-cuda` to, and
307
- # refuses first. `build()` itself still guards it explicitly (see
308
- # its own docstring), so a spec that somehow got a `resolved_base`
309
- # anyway is refused plainly rather than baking an unsourced guess
310
- # at a GPU type and count into a snapshot.
311
- #
318
+ findings.extend(self._accelerator_findings(environment.spec))
312
319
  # `spec.buildSecrets` needs no check of its own here: `supports_build_secrets
313
320
  # = False` above (E3-05, merged since this branch started) makes
314
321
  # `ManagedBuilder._own_findings` refuse it before this method is
@@ -330,18 +337,6 @@ class Builder(ManagedBuilder):
330
337
  (E0-04).
331
338
  """
332
339
  spec = request.environment.spec
333
- if request.size_class in GPU_SIZE_CLASSES:
334
- # `validate` leaves a GPU class buildable (`gpu = True`, D-20):
335
- # `bases.py` has no CUDA digest to resolve yet, so this cannot
336
- # be reached in practice — refused plainly here rather than
337
- # baking an unsourced guess at a GPU type and count into a
338
- # snapshot (E2-17 is what will give this real numbers).
339
- raise EnvironmentsError(
340
- CAPABILITY_UNSUPPORTED,
341
- f"Daytona runs `{request.size_class}` on its own GPUs, but the CUDA base "
342
- "and the GPU resource shape this needs are E2-17's, not built yet",
343
- detail={"variant": self.variant, "missing": "E2-17"},
344
- )
345
340
  sdk = self._daytona_sdk()
346
341
  client = self._client(sdk)
347
342
  name = f"dl-{request.environment.metadata.name}-v{request.version}-{request.build_uid}"
@@ -437,7 +432,7 @@ class Builder(ManagedBuilder):
437
432
  logged.append(line)
438
433
  self._log(line)
439
434
 
440
- resources = self._resources(sdk, request.size_class)
435
+ resources = self._resources(sdk, request.size_class, spec)
441
436
  # A snapshot is region-scoped, and the region that scopes it is
442
437
  # Daytona's, not this platform's. `validate` already refuses
443
438
  # more than one, so the first is the only one.
@@ -505,10 +500,40 @@ class Builder(ManagedBuilder):
505
500
  )
506
501
  return sdk.Image.from_dockerfile(str(dockerfile))
507
502
 
508
- def _resources(self, sdk: Any, size_class: str) -> Any:
509
- """The CPU resources a size class bakes into the snapshot (§11.3 item 4)."""
510
- shape = _CPU_RESOURCES.get(size_class, _CPU_RESOURCES["small"])
511
- return sdk.Resources(cpu=shape["cpu"], memory=shape["memory"], disk=shape["disk"])
503
+ @staticmethod
504
+ def _accelerator_findings(spec: EnvironmentSpec) -> list[CapabilityFinding]:
505
+ """A GPU Daytona does not offer, refused before any build (E2-17)."""
506
+ accelerator = spec.resources.accelerator
507
+ if accelerator == "none" or daytona_gpu(accelerator.type):
508
+ return []
509
+ return [
510
+ CapabilityFinding(
511
+ code="DL_ENV_CAPABILITY_UNSUPPORTED",
512
+ message=(
513
+ f"Daytona has no GPU called `{accelerator.type}`; it offers "
514
+ + ", ".join(DAYTONA_GPUS)
515
+ ),
516
+ field="spec.resources.accelerator.type",
517
+ )
518
+ ]
519
+
520
+ def _resources(self, sdk: Any, size_class: str, spec: EnvironmentSpec) -> Any:
521
+ """What the snapshot bakes in: a class's CPU, or the spec's GPU (§11.3 item 4, E2-17)."""
522
+ accelerator = spec.resources.accelerator
523
+ if size_class not in GPU_SIZE_CLASSES or accelerator == "none":
524
+ shape = _CPU_RESOURCES.get(size_class, _CPU_RESOURCES["small"])
525
+ return sdk.Resources(cpu=shape["cpu"], memory=shape["memory"], disk=shape["disk"])
526
+ # D-4 gives the GPU classes no CPU or memory of their own (E4-11 has
527
+ # them, for Datalayer's nodes): the GPU is what the class is for, and
528
+ # Daytona sizes the rest of the machine for it unless the spec hints.
529
+ hints = spec.resources.hints
530
+ return sdk.Resources(
531
+ cpu=round(hints.cpu) if hints.cpu else None,
532
+ memory=round(hints.memory_gi) if hints.memory_gi else None,
533
+ disk=round(hints.disk_gi) if hints.disk_gi else _GPU_DISK_GI,
534
+ gpu=accelerator.count,
535
+ gpu_type=sdk.GpuType(daytona_gpu(accelerator.type)),
536
+ )
512
537
 
513
538
  def _register_base_pull(self, client: Any, resolved_base: str) -> str | None:
514
539
  """A private registry entry for this build's base pull (D-17, D-18).
@@ -657,20 +682,29 @@ class Builder(ManagedBuilder):
657
682
  "lock pinned, and an artifact carries neither",
658
683
  detail={"variant": self.variant},
659
684
  )
660
- from ..conformance import expected_packages, run_core_tier
685
+ from ..conformance import expected_packages, run_accelerator_check, run_core_tier
661
686
 
662
687
  snapshot = artifact.provider_artifact_id or artifact.immutable_reference
663
688
  sandbox = self._smoke_test_sandbox(snapshot)
664
689
  self._log(f"Launching {snapshot} to smoke-test it")
665
690
  try:
666
691
  sandbox.start()
667
- return run_core_tier(
692
+ result = run_core_tier(
668
693
  sandbox,
669
694
  python_version=environment.spec.language.version,
670
695
  expected_packages=expected_packages(environment, lock_text or ""),
671
696
  secret_values=tuple(secret_values),
672
697
  restart=lambda: self._restart(sandbox),
673
698
  )
699
+ accelerator = environment.spec.resources.accelerator
700
+ if accelerator != "none":
701
+ # A GPU version is only the version its spec describes when
702
+ # its GPUs are visible and its CUDA is the spec's (check 11,
703
+ # E2-17): the core tier alone passes on a machine with none.
704
+ result.checks.append(
705
+ run_accelerator_check(sandbox, cuda=accelerator.cuda, count=accelerator.count)
706
+ )
707
+ return result
674
708
  except EnvironmentsError:
675
709
  raise
676
710
  except Exception as error:
@@ -59,6 +59,9 @@ class ApprovedBase(BaseModel):
59
59
  python_versions: tuple[str, ...]
60
60
  #: Whether the base carries CUDA, which a GPU size class requires.
61
61
  accelerator: bool = False
62
+ #: The CUDA toolkit the base pins, ``major.minor`` (E2-17): what a spec's
63
+ #: ``accelerator.cuda`` may ask for, and what check 11 reads back.
64
+ cuda: str | None = None
62
65
  #: Channel, then variant, to the digest resolution pins. A channel with no
63
66
  #: variant is approved and not yet published.
64
67
  channels: dict[str, dict[str, str]] = Field(default_factory=dict)
@@ -140,12 +143,23 @@ APPROVED_BASES: dict[str, ApprovedBase] = {
140
143
  },
141
144
  snapshots={"2026.09": "20260916T120000Z"},
142
145
  ),
143
- # E2-17: jupyter-python-cuda plus the same layer.
146
+ # E2-17: jupyter-python-cuda:0.3.1 (jupyter-python 0.2.2 and the CUDA
147
+ # 12.8 toolkit, pinned) plus the same layer, released 2026-09-18 to
148
+ # environments/base/python-cuda as `2026.09-bceb272088e4`. The doctor
149
+ # passes all fifteen checks and `nvcc` answers 12.8 without a GPU.
144
150
  ApprovedBase(
145
151
  ref="datalayer/python-cuda",
146
152
  python_versions=("3.13",),
147
153
  accelerator=True,
148
- channels={"2026.09": {}},
154
+ cuda="12.8",
155
+ channels={
156
+ "2026.09": dict.fromkeys(
157
+ ("datalayer", "e2b", "daytona", "modal"),
158
+ "sha256:a6374a2d4ff07c8a8fe0a71ee605964f93319894cc4152c4e2a1af6258ac9e6a",
159
+ )
160
+ },
161
+ # After its CUDA layer's own `apt-get update`, which ran that day.
162
+ snapshots={"2026.09": "20260918T150000Z"},
149
163
  ),
150
164
  )
151
165
  }
@@ -37,6 +37,7 @@ __all__ = [
37
37
  "cross_variant_packages",
38
38
  "drifted_from",
39
39
  "package_versions_of",
40
+ "run_accelerator_check",
40
41
  "run_conformance",
41
42
  "run_core_tier",
42
43
  "run_extended_tier",
@@ -487,7 +488,7 @@ def expected_packages(environment: Any, lock_text: str) -> dict[str, str]:
487
488
  return conda_expected_packages(dependency_file.content, lock_text or "")
488
489
  pinned = locked_versions(lock_text) if lock_text else {}
489
490
  names: list[str] = []
490
- for text in environment.spec.packages.python.dependencies:
491
+ for text in _declared_dependencies(environment):
491
492
  try:
492
493
  names.append(canonicalize_name(Requirement(text).name))
493
494
  except InvalidRequirement:
@@ -495,6 +496,42 @@ def expected_packages(environment: Any, lock_text: str) -> dict[str, str]:
495
496
  return {name: pinned[name] for name in names if name in pinned}
496
497
 
497
498
 
499
+ def _declared_dependencies(environment: Any) -> list[str]:
500
+ """The requirements a person declared, wherever the source keeps them.
501
+
502
+ A `dependencyFile` source names its packages in the file and leaves
503
+ `packages.python` empty, which is what the resolver reads too (E3-01).
504
+ Read from `packages.python` alone, check 5 was handed nothing for a
505
+ `requirements.txt` and passed for it, found live on 2026-09-18 (E3-08).
506
+ """
507
+ from .spec import parse_requirements_txt
508
+
509
+ build = environment.spec.build
510
+ dependency_file = build.dependency_file
511
+ if build.source == "dependencyFile" and dependency_file is not None:
512
+ if dependency_file.source_format == "requirements":
513
+ return parse_requirements_txt(dependency_file.content)
514
+ if dependency_file.source_format == "pyproject":
515
+ return _pyproject_dependencies(dependency_file.content)
516
+ return list(environment.spec.packages.python.dependencies)
517
+
518
+
519
+ def _pyproject_dependencies(text: str) -> list[str]:
520
+ """`[project].dependencies` of a `pyproject.toml`, or none when it cannot be read."""
521
+ try:
522
+ import tomllib as toml
523
+ except ImportError: # Python 3.10
524
+ try:
525
+ import tomli as toml # type: ignore[no-redef]
526
+ except ImportError:
527
+ return []
528
+ try:
529
+ project = toml.loads(text).get("project") or {}
530
+ except toml.TOMLDecodeError:
531
+ return []
532
+ return [str(item) for item in project.get("dependencies") or []]
533
+
534
+
498
535
  def run_core_tier(
499
536
  sandbox: Sandbox,
500
537
  *,
@@ -560,30 +597,62 @@ def _egress(
560
597
  )
561
598
 
562
599
 
563
- def _gpu(sandbox: Sandbox, requested: bool, cuda: str | None, timeout: float | None) -> CheckResult:
600
+ def _gpu(
601
+ sandbox: Sandbox,
602
+ requested: bool,
603
+ cuda: str | None,
604
+ timeout: float | None,
605
+ count: int = 1,
606
+ ) -> CheckResult:
607
+ """Check 11: the GPUs asked for are visible, and CUDA is the spec's.
608
+
609
+ Two CUDA versions are read, and they answer different questions. The
610
+ image's own toolkit (`nvcc`, or the base's `CUDA_VERSION`) is what the
611
+ spec's `accelerator.cuda` names and the base channel pins. `nvidia-smi`'s
612
+ "CUDA Version" is the newest CUDA the host's *driver* runs, which the
613
+ image does not choose: comparing the spec with it failed a correct image
614
+ on any newer driver (found on 2026-09-18, E2-17). The driver only has to
615
+ be new enough for the toolkit.
616
+ """
564
617
  if not requested:
565
618
  return _result(11, True, gating=False, detail="no accelerator was requested")
566
619
  body = (
567
- "import re as _dl_re, subprocess as _dl_sp\n"
568
- "_dl_out = {'returncode': None, 'gpus': [], 'cuda': None}\n"
620
+ "import os as _dl_os, re as _dl_re, shutil as _dl_sh, subprocess as _dl_sp\n"
621
+ "_dl_out = {'returncode': None, 'gpus': [], 'driver': None, 'cuda': None}\n"
569
622
  "try:\n"
570
623
  " _dl_run = _dl_sp.run(['nvidia-smi'], capture_output=True, text=True, timeout=30)\n"
571
624
  " _dl_out['returncode'] = _dl_run.returncode\n"
572
625
  " _dl_match = _dl_re.search(r'CUDA Version:\\s*([0-9.]+)', _dl_run.stdout)\n"
573
- " _dl_out['cuda'] = _dl_match.group(1) if _dl_match else None\n"
626
+ " _dl_out['driver'] = _dl_match.group(1) if _dl_match else None\n"
574
627
  " _dl_names = _dl_sp.run(['nvidia-smi', '--query-gpu=name', '--format=csv,noheader'], "
575
628
  "capture_output=True, text=True, timeout=30)\n"
576
629
  " _dl_out['gpus'] = [_dl_l.strip() for _dl_l in _dl_names.stdout.splitlines() "
577
630
  "if _dl_l.strip()]\n"
578
631
  "except (OSError, _dl_sp.SubprocessError) as _dl_error:\n"
579
632
  " _dl_out['error'] = str(_dl_error)\n"
633
+ "try:\n"
634
+ " _dl_nvcc = _dl_sh.which('nvcc') or '/usr/local/cuda/bin/nvcc'\n"
635
+ " _dl_run = _dl_sp.run([_dl_nvcc, '--version'], capture_output=True, text=True, "
636
+ "timeout=30)\n"
637
+ " _dl_match = _dl_re.search(r'release ([0-9.]+),', _dl_run.stdout)\n"
638
+ " _dl_out['cuda'] = _dl_match.group(1) if _dl_match else None\n"
639
+ "except (OSError, _dl_sp.SubprocessError):\n"
640
+ " pass\n"
641
+ "_dl_out['cuda'] = _dl_out['cuda'] or _dl_os.environ.get('CUDA_VERSION') or None\n"
580
642
  )
581
643
  answer = probe(sandbox, _code(11, body, "_dl_out"), timeout=timeout)
582
644
  problems = []
583
- if answer.get("returncode") != 0 or not answer.get("gpus"):
645
+ gpus = answer.get("gpus") or []
646
+ if answer.get("returncode") != 0 or not gpus:
584
647
  problems.append("no GPU is visible")
585
- if cuda and not str(answer.get("cuda") or "").startswith(cuda):
586
- problems.append(f"CUDA is {answer.get('cuda')}, not {cuda}")
648
+ elif len(gpus) < count:
649
+ problems.append(f"{len(gpus)} GPU(s) visible, not the {count} asked for")
650
+ toolkit = str(answer.get("cuda") or "")
651
+ if cuda and not _version_is(toolkit, cuda):
652
+ problems.append(f"CUDA is {toolkit or None}, not {cuda}")
653
+ driver = str(answer.get("driver") or "")
654
+ if toolkit and driver and _version_tuple(driver) < _version_tuple(toolkit):
655
+ problems.append(f"the driver runs CUDA up to {driver}, older than the image's {toolkit}")
587
656
  # A GPU version gates on this (E2-17): a version that asked for an
588
657
  # accelerator and cannot see it, or sees the wrong CUDA, is not the
589
658
  # version its spec describes. A version that asked for none never
@@ -592,6 +661,31 @@ def _gpu(sandbox: Sandbox, requested: bool, cuda: str | None, timeout: float | N
592
661
  return _result(11, not problems, gating=True, detail="; ".join(problems) or None, actual=answer)
593
662
 
594
663
 
664
+ def _version_tuple(version: str) -> tuple[int, ...]:
665
+ return tuple(int(part) for part in re.findall(r"\d+", version))
666
+
667
+
668
+ def _version_is(version: str, asked: str) -> bool:
669
+ """Whether `version` is what `asked` names: `12` and `12.8` both name 12.8.3."""
670
+ wanted = _version_tuple(asked)
671
+ return bool(wanted) and _version_tuple(version)[: len(wanted)] == wanted
672
+
673
+
674
+ def run_accelerator_check(
675
+ sandbox: Sandbox,
676
+ *,
677
+ cuda: str | None = None,
678
+ count: int = 1,
679
+ timeout: float | None = 120.0,
680
+ ) -> CheckResult:
681
+ """Appendix B check 11 alone, gating, for a version that asked for an accelerator (E2-17).
682
+
683
+ What a builder's smoke test adds to the core tier for a GPU version: the
684
+ rest of the extended tier records, and this one decides.
685
+ """
686
+ return _guard(11, True, lambda: _gpu(sandbox, True, cuda, timeout, count))
687
+
688
+
595
689
  def _throughput(
596
690
  sandbox: Sandbox, contract: SandboxContract, minimum: float, timeout: float | None
597
691
  ) -> CheckResult:
@@ -658,6 +752,7 @@ def run_extended_tier(
658
752
  contract: SandboxContract = SANDBOX_CONTRACT_V1,
659
753
  accelerator_requested: bool = False,
660
754
  cuda_version: str | None = None,
755
+ accelerator_count: int = 1,
661
756
  egress_allowed: Sequence[str] = (),
662
757
  egress_blocked: Sequence[str] = (),
663
758
  cold_start_seconds: float | None = None,
@@ -675,7 +770,7 @@ def run_extended_tier(
675
770
  _guard(
676
771
  11,
677
772
  accelerator_requested,
678
- lambda: _gpu(sandbox, accelerator_requested, cuda_version, timeout),
773
+ lambda: _gpu(sandbox, accelerator_requested, cuda_version, timeout, accelerator_count),
679
774
  ),
680
775
  _guard(12, False, lambda: _throughput(sandbox, contract, minimum_mib_per_second, timeout)),
681
776
  _guard(13, False, lambda: _cold_start(cold_start_seconds, cold_start_budget)),
@@ -39,6 +39,7 @@ Where the solve runs is the :class:`ResolveRunner`'s business:
39
39
  from __future__ import annotations
40
40
 
41
41
  import hashlib
42
+ import os
42
43
  import re
43
44
  import shlex
44
45
  import shutil
@@ -860,9 +861,38 @@ def locked_versions(lock_text: str) -> dict[str, str]:
860
861
  ]
861
862
  if len(pinned) == 1:
862
863
  versions[canonicalize_name(requirement.name)] = pinned[0]
864
+ elif requirement.url:
865
+ wheel = _wheel_version(requirement.name, requirement.url)
866
+ if wheel:
867
+ versions[canonicalize_name(requirement.name)] = wheel
863
868
  return versions
864
869
 
865
870
 
871
+ def _wheel_version(name: str, url: str) -> str | None:
872
+ """The version of a direct reference to a wheel, read from its file name.
873
+
874
+ How a `pyproject` lock brings Datalayer's `jupyter-server` fork, which no
875
+ index serves (E3-08): `uv` records a hash only for a wheel it fetched by
876
+ URL, so the export pins it as `jupyter-server @ https://…whl`, with no
877
+ `==` for the version. The wheel's name carries one, and nothing else here
878
+ does. A reference that is not a wheel of the same distribution pins none.
879
+ """
880
+ from urllib.parse import unquote, urlsplit
881
+
882
+ from packaging.utils import InvalidWheelFilename, canonicalize_name, parse_wheel_filename
883
+
884
+ filename = unquote(urlsplit(url).path.rsplit("/", 1)[-1])
885
+ if not filename.endswith(".whl"):
886
+ return None
887
+ try:
888
+ wheel_name, version, _build, _tags = parse_wheel_filename(filename)
889
+ except InvalidWheelFilename:
890
+ return None
891
+ if wheel_name != canonicalize_name(name):
892
+ return None
893
+ return str(version)
894
+
895
+
866
896
  def apt_pins_in(lock_text: str) -> dict[str, str]:
867
897
  """The apt versions a lock records, by package.
868
898
 
@@ -1058,10 +1088,12 @@ def _verified_pyproject_lock(
1058
1088
  root = Path(directory)
1059
1089
  (root / "pyproject.toml").write_text(dependency_file.content, encoding="utf-8")
1060
1090
  (root / "uv.lock").write_text(dependency_file.lock_content, encoding="utf-8")
1091
+ environment = _uv_environment(root)
1061
1092
  try:
1062
1093
  checked = invoke(
1063
1094
  [resolved_uv, "lock", "--dry-run"],
1064
1095
  cwd=root,
1096
+ env=environment,
1065
1097
  capture_output=True,
1066
1098
  text=True,
1067
1099
  timeout=timeout,
@@ -1109,6 +1141,7 @@ def _verified_pyproject_lock(
1109
1141
  exported = invoke(
1110
1142
  [resolved_uv, "export", "--locked", "--format", "requirements.txt"],
1111
1143
  cwd=root,
1144
+ env=environment,
1112
1145
  capture_output=True,
1113
1146
  text=True,
1114
1147
  timeout=timeout,
@@ -1138,6 +1171,23 @@ def _verified_pyproject_lock(
1138
1171
  }
1139
1172
 
1140
1173
 
1174
+ def _uv_environment(root: Path) -> dict[str, str]:
1175
+ """What `uv` checks a lock with: its cache in the scratch directory, and no downloads.
1176
+
1177
+ The durable worker runs as a user with no home, so `uv`'s default cache
1178
+ under `~/.cache` could not be made, and neither could the interpreter it
1179
+ downloads when none satisfies `requires-python` (found on 2026-09-18, E3-08).
1180
+ The interpreter comes from the worker's image instead, where the base
1181
+ channel's own Python is installed: a check that fetched one per resolve would
1182
+ be a check that depends on the network in a way nothing records.
1183
+ """
1184
+ return {
1185
+ **os.environ,
1186
+ "UV_CACHE_DIR": str(root / ".uv-cache"),
1187
+ "UV_PYTHON_DOWNLOADS": "never",
1188
+ }
1189
+
1190
+
1141
1191
  def _refuse_unless_protected_pins_are_locked(packages: Mapping[str, str]) -> None:
1142
1192
  """A `pyproject` source is never merged with Datalayer's pins (E3-01):
1143
1193
  bringing your own lock is the point, so nothing is force-injected the
@@ -497,6 +497,12 @@ def _index_findings(field: str, url: str) -> list[SpecFinding]:
497
497
  return []
498
498
 
499
499
 
500
+ def _same_cuda(asked: str, carried: str) -> bool:
501
+ """Whether a spec's CUDA names the base's: `12` and `12.8` both name 12.8."""
502
+ asked_parts = asked.strip().split(".")
503
+ return carried.strip().split(".")[: len(asked_parts)] == asked_parts
504
+
505
+
500
506
  def parse_requirements_txt(text: str) -> list[str]:
501
507
  """The requirement lines of a `requirements.txt`, comments and blanks dropped.
502
508
 
@@ -960,6 +966,18 @@ def spec_findings(
960
966
  "spec.base.ref", f"`{base.ref}` has no CUDA; a GPU size class needs a CUDA base"
961
967
  )
962
968
  )
969
+ # The CUDA a spec asks for is the base's toolkit, which a channel pins
970
+ # (E2-17): a version that asks for another would build and then fail
971
+ # check 11 in every sandbox it starts.
972
+ cuda = resources.accelerator.cuda if wants_gpu else None
973
+ if cuda and base is not None and base.cuda and not _same_cuda(cuda, base.cuda):
974
+ findings.append(
975
+ SpecFinding(
976
+ "spec.resources.accelerator.cuda",
977
+ f"`{base.ref}` carries CUDA {base.cuda}, not {cuda}; ask for {base.cuda} "
978
+ "or leave `cuda` out",
979
+ )
980
+ )
963
981
 
964
982
  variants = spec.compatibility.variants
965
983
  if not variants.required:
@@ -37,12 +37,12 @@ A document is refused with `DL_ENV_SPEC_INVALID` when a field is wrong, and with
37
37
  | `commands.postInstall` | none | At most 32 non-empty commands, run after the packages are installed. |
38
38
  | `buildSecrets` | none | `id` is a Datalayer secret id, `dlsec_...`; `mountAs` is `env` or `file`; `name` is the variable or file name. Ids and names are unique. Secrets are injected into the build step that needs them and never written into the artifact. |
39
39
  | `resources.sizeClass` | `small` | `small`, `medium`, `large`, `gpu-small` or `gpu-large`. A GPU class needs an accelerator and a CUDA base; an accelerator needs a GPU class. Datalayer runs no GPU nodes yet, so a GPU class is built for Modal and Daytona, which bring their own GPUs; E2B has none. |
40
- | `resources.accelerator` | `none` | `none`, or `type`, `count` and `cuda`. |
40
+ | `resources.accelerator` | `none` | `none`, or `type`, `count` and `cuda`. `type` is the provider's own name for the GPU (Daytona: `H100`, `H200`, `RTX-PRO-6000`, `RTX-4090`, `RTX-5090`), and a GPU a variant does not offer is refused for it at `validate`. `cuda` is the base's toolkit: `datalayer/python-cuda:2026.09` carries 12.8, and another version is refused. |
41
41
  | `resources.hints` | none | `cpu`, `memoryGi`, `diskGi`: positive numbers, within the size class. |
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) and `image` (an existing image from a bootstrap registry allowlist, replacing the approved base) all resolve on the Datalayer variant; `image` from a private registry, and `dockerfile`, are refused until they do. |
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. |
46
46
 
47
47
  ## The spec digest
48
48