omicslab 2.6.0__tar.gz → 2.8.0__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 (178) hide show
  1. {omicslab-2.6.0 → omicslab-2.8.0}/PKG-INFO +1 -1
  2. {omicslab-2.6.0 → omicslab-2.8.0}/README.developer.md +37 -5
  3. {omicslab-2.6.0 → omicslab-2.8.0}/envs/pixi.toml +1 -0
  4. {omicslab-2.6.0 → omicslab-2.8.0}/scripts/bootstrap-env.sh +118 -69
  5. omicslab-2.8.0/src/omicslab/_version.py +1 -0
  6. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/job_commands.py +51 -6
  7. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/main.py +161 -192
  8. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/runner_commands.py +5 -0
  9. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/utils.py +51 -9
  10. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/workspace_commands.py +1 -2
  11. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/ws_commands.py +4 -205
  12. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/client.py +13 -5
  13. omicslab-2.8.0/src/omicslab/download.py +241 -0
  14. omicslab-2.8.0/src/omicslab/job/_run/_apptainer.py +331 -0
  15. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_auth.py +43 -18
  16. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_broker.py +138 -9
  17. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_config_download.py +32 -1
  18. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_consts.py +6 -2
  19. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_data_prep.py +287 -72
  20. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_env.py +31 -2
  21. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_exec.py +8 -1
  22. omicslab-2.8.0/src/omicslab/job/_run/_gh_proxy.py +288 -0
  23. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_images.py +49 -22
  24. omicslab-2.8.0/src/omicslab/job/_run/_llm_proxy.py +204 -0
  25. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_nextflow.py +22 -0
  26. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_params.py +34 -0
  27. omicslab-2.8.0/src/omicslab/job/_run/_proc.py +139 -0
  28. omicslab-2.8.0/src/omicslab/job/_run/_repo.py +220 -0
  29. omicslab-2.8.0/src/omicslab/job/_run/_sandbox.py +778 -0
  30. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_spec.py +4 -4
  31. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_storage.py +48 -6
  32. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_studio_prep.py +5 -0
  33. omicslab-2.8.0/src/omicslab/job/_run/_system_deps.py +317 -0
  34. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/analysis.py +580 -50
  35. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/studio.py +482 -20
  36. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/client.py +23 -3
  37. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/system.py +18 -0
  38. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/jobs.py +0 -6
  39. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/storage.py +32 -0
  40. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/workspaces.py +0 -37
  41. omicslab-2.8.0/src/omicslab/upload.py +167 -0
  42. {omicslab-2.6.0 → omicslab-2.8.0}/tests/e2e/test_cli_e2e.py +6 -4
  43. omicslab-2.8.0/tests/job/_run/test__apptainer.py +213 -0
  44. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__auth.py +32 -1
  45. omicslab-2.8.0/tests/job/_run/test__broker.py +279 -0
  46. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__data_prep.py +424 -13
  47. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__engine_helpers.py +572 -2
  48. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__env.py +19 -0
  49. omicslab-2.8.0/tests/job/_run/test__gh_proxy.py +198 -0
  50. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__images.py +49 -0
  51. omicslab-2.8.0/tests/job/_run/test__llm_proxy.py +131 -0
  52. omicslab-2.8.0/tests/job/_run/test__nextflow_custom_config.py +166 -0
  53. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__params.py +35 -0
  54. omicslab-2.8.0/tests/job/_run/test__repo.py +172 -0
  55. omicslab-2.8.0/tests/job/_run/test__sandbox.py +386 -0
  56. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__spec.py +14 -0
  57. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__storage.py +54 -0
  58. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__studio_docker.py +229 -0
  59. omicslab-2.8.0/tests/job/_run/test__system_deps.py +257 -0
  60. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_job_client_extra.py +57 -0
  61. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_studio_image_download.py +27 -0
  62. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_cli.py +64 -21
  63. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_cli_storage.py +284 -25
  64. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_cli_utils.py +71 -0
  65. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_client.py +2 -10
  66. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_client_broker.py +39 -2
  67. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_job_exec.py +72 -0
  68. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_resources.py +29 -31
  69. omicslab-2.8.0/tests/test_upload.py +119 -0
  70. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_ws_commands.py +1 -60
  71. omicslab-2.6.0/src/omicslab/_version.py +0 -1
  72. omicslab-2.6.0/src/omicslab/job/_run/_proc.py +0 -88
  73. omicslab-2.6.0/tests/job/_run/test__broker.py +0 -146
  74. {omicslab-2.6.0 → omicslab-2.8.0}/.gitignore +0 -0
  75. {omicslab-2.6.0 → omicslab-2.8.0}/Makefile +0 -0
  76. {omicslab-2.6.0 → omicslab-2.8.0}/README.md +0 -0
  77. {omicslab-2.6.0 → omicslab-2.8.0}/envs/.gitignore +0 -0
  78. {omicslab-2.6.0 → omicslab-2.8.0}/envs/dev/hcm.pixi.lock +0 -0
  79. {omicslab-2.6.0 → omicslab-2.8.0}/envs/dev/hcm.pixi.toml +0 -0
  80. {omicslab-2.6.0 → omicslab-2.8.0}/envs/dev/pixi.lock +0 -0
  81. {omicslab-2.6.0 → omicslab-2.8.0}/envs/dev/pixi.toml +0 -0
  82. {omicslab-2.6.0 → omicslab-2.8.0}/envs/dev/us-east-1.pixi.lock +0 -0
  83. {omicslab-2.6.0 → omicslab-2.8.0}/envs/dev/us-east-1.pixi.toml +0 -0
  84. {omicslab-2.6.0 → omicslab-2.8.0}/envs/prod/hcm.pixi.lock +0 -0
  85. {omicslab-2.6.0 → omicslab-2.8.0}/envs/prod/hcm.pixi.toml +0 -0
  86. {omicslab-2.6.0 → omicslab-2.8.0}/envs/prod/pixi.lock +0 -0
  87. {omicslab-2.6.0 → omicslab-2.8.0}/envs/prod/pixi.toml +0 -0
  88. {omicslab-2.6.0 → omicslab-2.8.0}/envs/regions.json +0 -0
  89. {omicslab-2.6.0 → omicslab-2.8.0}/pixi.config.toml +0 -0
  90. {omicslab-2.6.0 → omicslab-2.8.0}/pyproject.toml +0 -0
  91. {omicslab-2.6.0 → omicslab-2.8.0}/scripts/check_publish.py +0 -0
  92. {omicslab-2.6.0 → omicslab-2.8.0}/scripts/write_version_manifest.py +0 -0
  93. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/__init__.py +0 -0
  94. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/__init__.py +0 -0
  95. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/analysis_commands.py +0 -0
  96. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/auth_commands.py +0 -0
  97. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/context_commands.py +0 -0
  98. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/credential_commands.py +0 -0
  99. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/fuse_commands.py +0 -0
  100. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/org_commands.py +0 -0
  101. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/setup_commands.py +0 -0
  102. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/studio_commands.py +0 -0
  103. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/cli/token_commands.py +0 -0
  104. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/config.py +0 -0
  105. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/exceptions.py +0 -0
  106. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/__init__.py +0 -0
  107. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/__init__.py +0 -0
  108. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_git.py +0 -0
  109. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_git_proxy.py +0 -0
  110. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_log.py +0 -0
  111. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_monitor.py +0 -0
  112. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_proxy.py +0 -0
  113. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/_run/_s3_proxy.py +0 -0
  114. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/console.py +0 -0
  115. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/executor.py +0 -0
  116. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/job/paths.py +0 -0
  117. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/__init__.py +0 -0
  118. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/analysis.py +0 -0
  119. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/base.py +0 -0
  120. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/credentials.py +0 -0
  121. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/orgs.py +0 -0
  122. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/runners.py +0 -0
  123. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/studio.py +0 -0
  124. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/resources/tokens.py +0 -0
  125. {omicslab-2.6.0 → omicslab-2.8.0}/src/omicslab/selfupdate.py +0 -0
  126. {omicslab-2.6.0 → omicslab-2.8.0}/tests/__init__.py +0 -0
  127. {omicslab-2.6.0 → omicslab-2.8.0}/tests/conftest.py +0 -0
  128. {omicslab-2.6.0 → omicslab-2.8.0}/tests/e2e/__init__.py +0 -0
  129. {omicslab-2.6.0 → omicslab-2.8.0}/tests/e2e/conftest.py +0 -0
  130. {omicslab-2.6.0 → omicslab-2.8.0}/tests/e2e/test_tokens.py +0 -0
  131. {omicslab-2.6.0 → omicslab-2.8.0}/tests/fixtures/nfcore-demo-custom.config +0 -0
  132. {omicslab-2.6.0 → omicslab-2.8.0}/tests/fixtures/studio_specs/jupyter.json +0 -0
  133. {omicslab-2.6.0 → omicslab-2.8.0}/tests/fixtures/studio_specs/rstudio.json +0 -0
  134. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__get_images_cli.py +0 -0
  135. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__git.py +0 -0
  136. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__git_proxy.py +0 -0
  137. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__log.py +0 -0
  138. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__monitor.py +0 -0
  139. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__nextflow.py +0 -0
  140. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__proxy.py +0 -0
  141. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__proxy_extra.py +0 -0
  142. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test__s3_proxy.py +0 -0
  143. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/_run/test_studio_proxy_start.py +0 -0
  144. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_job_cli.py +0 -0
  145. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_job_client.py +0 -0
  146. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_job_executor.py +0 -0
  147. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_job_executor_extra.py +0 -0
  148. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_job_fuse.py +0 -0
  149. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_job_resource.py +0 -0
  150. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_job_system.py +0 -0
  151. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_snapshot_request.py +0 -0
  152. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_studio_validate_cli.py +0 -0
  153. {omicslab-2.6.0 → omicslab-2.8.0}/tests/job/test_ws_helpers.py +0 -0
  154. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_cli_catalog.py +0 -0
  155. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_cli_context.py +0 -0
  156. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_config.py +0 -0
  157. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_fuse.py +0 -0
  158. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_job_heartbeat.py +0 -0
  159. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_misc.py +0 -0
  160. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_runner_helpers.py +0 -0
  161. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_runner_self_update.py +0 -0
  162. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_sandbox_report.py +0 -0
  163. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_selfupdate.py +0 -0
  164. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_studio_snapshot.py +0 -0
  165. {omicslab-2.6.0 → omicslab-2.8.0}/tests/test_system_monitor_interval.py +0 -0
  166. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-nextflow/input.txt +0 -0
  167. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-nextflow/main.nf +0 -0
  168. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-nextflow/omicslab/main.sh +0 -0
  169. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-nextflow/pixi.toml +0 -0
  170. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-nextflow/schema.json +0 -0
  171. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-simple/omicslab/main.sh +0 -0
  172. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-simple/pixi.toml +0 -0
  173. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-simple/schema.json +0 -0
  174. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-snakemake/Snakefile +0 -0
  175. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-snakemake/input.txt +0 -0
  176. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-snakemake/omicslab/main.sh +0 -0
  177. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-snakemake/pixi.toml +0 -0
  178. {omicslab-2.6.0 → omicslab-2.8.0}/tests/tools/hello-snakemake/schema.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omicslab
3
- Version: 2.6.0
3
+ Version: 2.8.0
4
4
  Summary: Python SDK and CLI for the OmicsLab Platform
5
5
  Project-URL: Homepage, https://platform.omicslab.io
6
6
  Project-URL: Repository, https://github.com/vieomics/omicslab-platform
@@ -93,12 +93,12 @@ and then hand the raw token to `Client`.
93
93
  | Property | Class | Purpose |
94
94
  |------------|--------------------------|---------|
95
95
  | `orgs` | `OrgResource` | Org CRUD + members + roles + job counts |
96
- | `workspaces` | `WorkspaceResource` | Workspace CRUD, members, pin, linked resources, budget/storage-quota (read-only) |
96
+ | `workspaces` | `WorkspaceResource` | Workspace CRUD, members, pin, budget/storage-quota (read-only) |
97
97
  | `analysis` | `AnalysisResource` | Tool catalog (batch tools) CRUD/tags/profiles/schema |
98
98
  | `studio` | `StudioResource` | Tool catalog (interactive tools) CRUD + tags/profiles/schema |
99
99
  | `jobs` | `JobResource` | Launch/list/get/rerun/estimate/counts/snapshot/terminate analysis + studio jobs |
100
100
  | `storage` | `StorageResource` | Upload/download list/delete/rename vs workspace S3 |
101
- | `credentials` | `CredentialResource` | S3/GitHub/Cloud credentials (user + org scopes) |
101
+ | `credentials` | `CredentialResource` | S3/GitHub/cloud/LLM credentials (user + org scopes) |
102
102
  | `tokens` | `TokenResource` | Create/list/revoke API tokens |
103
103
  | `runners` | `RunnerResource` | Runner registration/token/heartbeat/deprovision |
104
104
 
@@ -277,7 +277,7 @@ create their own tokens — never reuse the shared org when mutating it destruct
277
277
 
278
278
  | File | Covers |
279
279
  |------|--------|
280
- | `test_org_workspace.py` | Org update/list, workspace CRUD, members, pin/unpin, linked resources |
280
+ | `test_org_workspace.py` | Org update/list, workspace CRUD, members, pin/unpin |
281
281
  | `test_credentials.py` | S3 storage credential lifecycle, workspace merged view, GitHub (skippable) |
282
282
  | `test_tools.py` | Analysis/studio tool CRUD + pin/unpin |
283
283
  | `test_storage.py` | Health, presigned upload, list, download, delete, rename, batch |
@@ -467,8 +467,8 @@ daemon over WebSocket. Only `job run --work-dir` analysis is native/synchronous.
467
467
  Studio session mounts (no token exposure, snapshot-safe):
468
468
 
469
469
  - The SDK environment is bind-mounted **read-only at its own absolute path**
470
- (pixi/conda envs are path-sensitive), and `omicslab`/`omx` are exposed on
471
- `PATH` via a dedicated `/opt/omicslab/bin` directory.
470
+ (pixi/conda envs are path-sensitive), and `omicslab`/`omx`/`gh` are exposed
471
+ on `PATH` via a dedicated `/opt/omicslab/bin` directory.
472
472
  - `pixi` itself is mounted there too, together with the SDK project's
473
473
  `pixi.toml`/`pixi.lock`, so `pixi run ...` works inside the session. A
474
474
  writable copy of the env's small `conda-meta` directory is mounted over the
@@ -497,6 +497,29 @@ Studio session mounts (no token exposure, snapshot-safe):
497
497
  proxy URL, so no token or credential helper is present in the container.
498
498
  Studio launches reject organization and marketplace credentials. The token
499
499
  stays in the agent process and is never logged or returned to the session.
500
+ - The **same GitHub credential** also backs the `gh` CLI through a host-side
501
+ GitHub API proxy. `gh` is configured with `http_unix_socket` (go-gh sends
502
+ plain HTTP over the socket even for `https://api.github.com` URLs) and
503
+ `GH_CONFIG_DIR` points at a staged directory that contains only a
504
+ placeholder token. The proxy injects the real token for `api.github.com`
505
+ and `uploads.github.com`, and forwards pre-signed download hosts
506
+ (`objects.githubusercontent.com`, `codeload.github.com`, …) without it.
507
+ This lets `gh pr create` / `gh pr merge` work in the session while keeping
508
+ the real token out of the container env, writable layer, and snapshots.
509
+ The token scope must cover both git (`Contents: write`) and pull requests
510
+ (`Pull requests: write`); the `gh` binary itself comes from the SDK pixi
511
+ environment and is exposed at `/opt/omicslab/bin/gh`.
512
+ - The **personal LLM provider** credential selected in the Studio launch form
513
+ (`Settings → LLM providers`, default endpoint
514
+ `https://opencode.ai/zen/go/v1`) is proxied by a host-side HTTP proxy. The
515
+ selection is nullable: choosing **None** runs the session without a brokered
516
+ provider. The credential carries an `agent` enum (currently only `opencode`);
517
+ the generated OpenCode config points the `opencode-go` provider at that
518
+ proxy, and the container receives only `OPENCODE_API_KEY=broker` and
519
+ `OPENCODE_CONFIG=/run/omicslab/opencode.json`. Adding a new agent (for example
520
+ Pi) means a new enum value plus its config writer in
521
+ `studio._llm_agent_env_args`. The real API key stays in the agent process and
522
+ never enters the container env, writable layer, or snapshots.
500
523
  - When `STUDIO_EXPORT_AWS_CREDENTIALS` is enabled (Settings → Studio), the
501
524
  backend mints short-lived STS credentials for the workspace storage and the
502
525
  agent starts a host-side S3 signing proxy. The session receives only
@@ -504,6 +527,15 @@ Studio session mounts (no token exposure, snapshot-safe):
504
527
  `AWS_ENDPOINT_URL=<host proxy>`; the real STS never enters the container.
505
528
  Only credentials carrying a session token are proxied; long-lived provider
506
529
  keys are never exported by this path.
530
+ - The selected **personal repository** (`Settings → Repositories`) is cloned
531
+ on the host and bind-mounted into the session at `/repo/<name>`; Docker `-w`
532
+ and `REPOSITORY_DIR` make it the working folder. Selection is optional
533
+ (None runs the image's default workdir). A repository must link a personal
534
+ GitHub credential; that credential supplies the clone token and the
535
+ in-session Git proxy. If the linked credential is deleted the repository
536
+ remains but must be re-linked before it can be launched. The token is passed
537
+ only through a process-scoped `http.extraheader`, never in argv or the remote
538
+ URL. Bind mounts are excluded from `docker commit` snapshots.
507
539
  - The old implicit `/home/omicslab` bind is gone (opt-in via
508
540
  `runtime.home_mount` only): user files stay in the container's writable layer
509
541
  and are therefore included in `docker commit` snapshots.
@@ -9,6 +9,7 @@ channel-priority = "disabled"
9
9
  python = "==3.12"
10
10
  jq = ">=1.5,<2"
11
11
  git = ">=2.39,<3"
12
+ gh = ">=2.60,<3"
12
13
  nextflow = ">=26.4.6,<27"
13
14
  openjdk = ">=17,<21"
14
15
  apptainer = ">=1.3,<2"
@@ -12,6 +12,10 @@
12
12
  # (default: v0.76.1)
13
13
  # INSTALL_DOCKER — set to 1 for studio jobs to install the docker engine
14
14
  # (client + daemon) and start its daemon (default: 0)
15
+ # INSTALL_SYSTEM_DEPS — set to 0 to skip host packages (fuse3, fuse2fs,
16
+ # docker). Cloud jobs set this to 0 and let the agent
17
+ # install them from the job's preparation step, where the
18
+ # install is visible in the job log. Shared runners keep 1.
15
19
  #
16
20
  # The script is idempotent: re-running it after a successful install is a
17
21
  # no-op (pixi binary present, environment installed, SDK already loaded).
@@ -36,6 +40,7 @@ PIXI_TOML="${PIXI_TOML:-pixi.toml}"
36
40
  PIXI_LOCK="${PIXI_LOCK:-pixi.lock}"
37
41
  PIXI_VERSION="${PIXI_VERSION:-v0.76.1}"
38
42
  RETRIES=3
43
+ INSTALL_SYSTEM_DEPS="${INSTALL_SYSTEM_DEPS:-1}"
39
44
 
40
45
  # Download helper. Every fetch is bounded and retried so a stalled connection
41
46
  # fails in minutes with a clear message instead of hanging until the platform's
@@ -70,82 +75,98 @@ else
70
75
  fi
71
76
  export PATH="$(dirname "${PIXI_BIN}"):$PATH"
72
77
 
73
- # ── 1b. FUSE helper for mountpoint-s3 (non-root mounts) ────────────────────
74
- # mount-s3 performs unprivileged FUSE mounts via `fusermount3`, which must be
75
- # root-owned + setuid. The pixi env ships a non-setuid copy under sbin/ (also
76
- # not on PATH), so use the distro package when it is missing. Best-effort: on
77
- # air-gapped hosts without apt, mounts still work when run as root.
78
- if ! command -v fusermount3 >/dev/null 2>&1; then
79
- if command -v apt-get >/dev/null 2>&1; then
78
+ # ── 1b. FUSE host helpers (mountpoint-s3 + Apptainer) ──────────────────────
79
+ # mount-s3 performs unprivileged FUSE mounts via `fusermount3` (package
80
+ # fuse3), which must be root-owned + setuid. Apptainer uses `fuse2fs` to mount
81
+ # EXT3 images (including `--overlay`) without root; without it Apptainer logs
82
+ # "fuse2fs not found" and EXT3 images cannot be mounted. Both are best-effort:
83
+ # on air-gapped hosts without apt, mounts still work when run as root.
84
+ #
85
+ # 1b/1c are host packages, not agent dependencies. Cloud jobs set
86
+ # INSTALL_SYSTEM_DEPS=0 and install them later from the job's preparation
87
+ # step, after the job is visible and streaming logs.
88
+ if [ "${INSTALL_SYSTEM_DEPS}" = "1" ]; then
89
+ if ! command -v fusermount3 >/dev/null 2>&1 || \
90
+ ! command -v fuse2fs >/dev/null 2>&1; then
91
+ if command -v apt-get >/dev/null 2>&1; then
92
+ SUDO=""
93
+ if [ "$(id -u)" -ne 0 ] && command -v sudo >/dev/null 2>&1; then
94
+ SUDO="sudo -n"
95
+ fi
96
+ $SUDO apt-get update -qq >/dev/null 2>&1 || true
97
+ if ! command -v fusermount3 >/dev/null 2>&1; then
98
+ echo "Installing fuse3 (fusermount3 helper for mountpoint-s3)..."
99
+ $SUDO apt-get install -y -qq fuse3 >/dev/null 2>&1 || \
100
+ echo "WARNING: fuse3 install failed; mountpoint-s3 mounts will require root"
101
+ fi
102
+ if ! command -v fuse2fs >/dev/null 2>&1; then
103
+ echo "Installing fuse2fs (EXT3 image support for Apptainer)..."
104
+ $SUDO apt-get install -y -qq fuse2fs >/dev/null 2>&1 || \
105
+ echo "WARNING: fuse2fs install failed; Apptainer cannot mount EXT3 images"
106
+ fi
107
+ else
108
+ echo "WARNING: no apt-get; mountpoint-s3 non-root mounts will require root and Apptainer EXT3 images are unavailable"
109
+ fi
110
+ fi
111
+
112
+ # ── 1c. docker engine (studio jobs) ────────────────────────────────────
113
+ # Studio jobs start their session container with `docker run`. On the
114
+ # Docker-simulated VM the host daemon answers `docker info` through the
115
+ # mounted /var/run/docker.sock, so only the client is needed; a real cloud
116
+ # VM (CloudFly / GreenNode) has no host socket, so install the engine
117
+ # (client + daemon), start the daemon, and let the job user reach its
118
+ # socket. Gated by INSTALL_DOCKER so analysis jobs pay nothing for it.
119
+ # Best-effort: on air-gapped hosts without apt the install is skipped and
120
+ # `job run --studio` reports the unreachable daemon.
121
+ if [ "${INSTALL_DOCKER:-0}" = "1" ]; then
80
122
  SUDO=""
81
123
  if [ "$(id -u)" -ne 0 ] && command -v sudo >/dev/null 2>&1; then
82
124
  SUDO="sudo -n"
83
125
  fi
84
- echo "Installing fuse3 (fusermount3 helper for mountpoint-s3)..."
85
- $SUDO apt-get update -qq >/dev/null 2>&1 || true
86
- $SUDO apt-get install -y -qq fuse3 >/dev/null 2>&1 || \
87
- echo "WARNING: fuse3 install failed; mountpoint-s3 mounts will require root"
88
- else
89
- echo "WARNING: no apt-get; mountpoint-s3 non-root mounts will require root"
90
- fi
91
- fi
92
-
93
- # ── 1c. docker engine (studio jobs) ────────────────────────────────────────
94
- # Studio jobs start their session container with `docker run`. On the
95
- # Docker-simulated VM the host daemon answers `docker info` through the
96
- # mounted /var/run/docker.sock, so only the client is needed; a real cloud VM
97
- # (CloudFly / GreenNode) has no host socket, so install the engine (client +
98
- # daemon), start the daemon, and let the job user reach its socket. Gated by
99
- # INSTALL_DOCKER so analysis jobs pay nothing for it. Best-effort: on
100
- # air-gapped hosts without apt the install is skipped and `job run --studio`
101
- # reports the unreachable daemon.
102
- if [ "${INSTALL_DOCKER:-0}" = "1" ]; then
103
- SUDO=""
104
- if [ "$(id -u)" -ne 0 ] && command -v sudo >/dev/null 2>&1; then
105
- SUDO="sudo -n"
106
- fi
107
- if ! command -v docker >/dev/null 2>&1; then
108
- if command -v apt-get >/dev/null 2>&1; then
109
- echo "Installing docker engine (client + daemon)..."
110
- $SUDO apt-get update -qq >/dev/null 2>&1 || true
111
- $SUDO apt-get install -y -qq docker.io >/dev/null 2>&1 || \
112
- echo "WARNING: docker install failed; the studio session cannot start"
126
+ if ! command -v docker >/dev/null 2>&1; then
127
+ if command -v apt-get >/dev/null 2>&1; then
128
+ echo "Installing docker engine (client + daemon)..."
129
+ $SUDO apt-get update -qq >/dev/null 2>&1 || true
130
+ $SUDO apt-get install -y -qq docker.io >/dev/null 2>&1 || \
131
+ echo "WARNING: docker install failed; the studio session cannot start"
132
+ else
133
+ echo "WARNING: no apt-get; cannot install docker for the studio session"
134
+ fi
135
+ fi
136
+ # Start the daemon: systemd where available, else a detached dockerd.
137
+ # Check for the socket (not `docker info`) so a permission problem on
138
+ # the socket is not mistaken for a stopped daemon and does not spawn a
139
+ # second dockerd next to the systemd unit.
140
+ if command -v systemctl >/dev/null 2>&1; then
141
+ $SUDO systemctl enable --now docker >/dev/null 2>&1 || true
142
+ fi
143
+ if [ ! -S /var/run/docker.sock ] && command -v dockerd >/dev/null 2>&1; then
144
+ echo "Starting dockerd..."
145
+ $SUDO dockerd >/dev/null 2>&1 &
146
+ fi
147
+ for _ in $(seq 1 15); do
148
+ [ -S /var/run/docker.sock ] && break
149
+ sleep 1
150
+ done
151
+ # The daemon socket is root:docker mode 0660. The studio agent runs as
152
+ # the (possibly non-root) SSH user and reuses this very session, so
153
+ # `usermod` membership alone would only apply to a later login. Grant
154
+ # the socket to the job user's own group for the current session
155
+ # instead — least privilege, never world-writable. The studio container
156
+ # itself is started with --security-opt no-new-privileges and without
157
+ # the host socket mounted, so the web app inside it cannot reach this
158
+ # daemon.
159
+ if [ "$(id -u)" -ne 0 ]; then
160
+ $SUDO usermod -aG docker "$USER" >/dev/null 2>&1 || true
161
+ $SUDO chgrp "$(id -gn)" /var/run/docker.sock >/dev/null 2>&1 || true
162
+ $SUDO chmod 660 /var/run/docker.sock >/dev/null 2>&1 || true
163
+ fi
164
+ if docker info >/dev/null 2>&1; then
165
+ echo "docker daemon ready"
113
166
  else
114
- echo "WARNING: no apt-get; cannot install docker for the studio session"
167
+ echo "WARNING: docker daemon not reachable after install"
115
168
  fi
116
169
  fi
117
- # Start the daemon: systemd where available, else a detached dockerd.
118
- # Check for the socket (not `docker info`) so a permission problem on the
119
- # socket is not mistaken for a stopped daemon and does not spawn a second
120
- # dockerd next to the systemd unit.
121
- if command -v systemctl >/dev/null 2>&1; then
122
- $SUDO systemctl enable --now docker >/dev/null 2>&1 || true
123
- fi
124
- if [ ! -S /var/run/docker.sock ] && command -v dockerd >/dev/null 2>&1; then
125
- echo "Starting dockerd..."
126
- $SUDO dockerd >/dev/null 2>&1 &
127
- fi
128
- for _ in $(seq 1 15); do
129
- [ -S /var/run/docker.sock ] && break
130
- sleep 1
131
- done
132
- # The daemon socket is root:docker mode 0660. The studio agent runs as the
133
- # (possibly non-root) SSH user and reuses this very session, so `usermod`
134
- # membership alone would only apply to a later login. Grant the socket to
135
- # the job user's own group for the current session instead — least
136
- # privilege, never world-writable. The studio container itself is started
137
- # with --security-opt no-new-privileges and without the host socket mounted,
138
- # so the web app inside it cannot reach this daemon.
139
- if [ "$(id -u)" -ne 0 ]; then
140
- $SUDO usermod -aG docker "$USER" >/dev/null 2>&1 || true
141
- $SUDO chgrp "$(id -gn)" /var/run/docker.sock >/dev/null 2>&1 || true
142
- $SUDO chmod 660 /var/run/docker.sock >/dev/null 2>&1 || true
143
- fi
144
- if docker info >/dev/null 2>&1; then
145
- echo "docker daemon ready"
146
- else
147
- echo "WARNING: docker daemon not reachable after install"
148
- fi
149
170
  fi
150
171
 
151
172
  # ── 2. manifest (from the tools bucket) ────────────────────────────────────
@@ -213,6 +234,34 @@ else
213
234
  exit 1
214
235
  fi
215
236
 
237
+ # ── 3b. Apptainer image wrapper (local copy before mount) ─────────────────
238
+ # Job images are mounted over FUSE (mountpoint-s3). Apptainer mounts them via
239
+ # squashfuse with a hard-coded 10s timeout, which concurrent job startup
240
+ # routinely exceeds. The wrapper copies the image to node-local storage first
241
+ # and is installed into the SDK bin dir that `job run` puts first on PATH
242
+ # (`<OMICSLAB_HOME>/.omicslab/bin`). Idempotent; re-installed at every job
243
+ # start so an SDK upgrade refreshes the baked real-binary path.
244
+ if [ -x "${OMICSLAB_HOME}/.pixi/envs/default/bin/apptainer" ]; then
245
+ if ! "${PIXI_BIN}" run python - <<'PY'
246
+ import os
247
+
248
+ from omicslab.job._run._apptainer import install_apptainer_wrapper
249
+ from omicslab.job._run._env import find_sdk_root
250
+
251
+ root = find_sdk_root()
252
+ home = os.path.join(root, ".omicslab")
253
+ wrapper = install_apptainer_wrapper(
254
+ os.path.join(home, "bin"),
255
+ sdk_root=root,
256
+ cache_dir=os.path.join(home, "cache", "images"),
257
+ )
258
+ print(f"Apptainer image wrapper: {wrapper or 'not installed'}")
259
+ PY
260
+ then
261
+ echo "WARNING: could not install the Apptainer image wrapper"
262
+ fi
263
+ fi
264
+
216
265
  # ── 4. studio direct access: allow binding the privileged port 443 ─────────
217
266
  # A studio session's in-VM TLS proxy binds 0.0.0.0:443 so
218
267
  # {job_id}.<studio-domain> resolves straight to this host. An unprivileged
@@ -0,0 +1 @@
1
+ __version__ = "2.8.0"
@@ -194,6 +194,11 @@ def run_job(
194
194
  "--no-report",
195
195
  help="Skip API reporting (writes status/log locally; for testing)",
196
196
  ),
197
+ isolation: str = typer.Option(
198
+ "none",
199
+ "--isolation",
200
+ help="Per-job isolation: 'none' or 'strict' (shared runners).",
201
+ ),
197
202
  ):
198
203
  """Execute a job synchronously and self-report its lifecycle.
199
204
 
@@ -206,6 +211,12 @@ def run_job(
206
211
  """
207
212
  from datetime import datetime as _dt
208
213
 
214
+ from ..job._run._sandbox import disable_dumpable
215
+
216
+ # The real job token is read into this process next. Block same-uid
217
+ # ptrace/memory reads before that happens.
218
+ disable_dumpable()
219
+
209
220
  kind = "studio" if studio else "analysis"
210
221
 
211
222
  if not work_dir:
@@ -403,7 +414,13 @@ def run_job(
403
414
  else:
404
415
  from ..job._run.analysis import run_analysis
405
416
 
406
- exit_code = run_analysis(id, params_dict, on_log=_post_log, job_dir=job_dir)
417
+ exit_code = run_analysis(
418
+ id,
419
+ params_dict,
420
+ on_log=_post_log,
421
+ job_dir=job_dir,
422
+ isolation=isolation,
423
+ )
407
424
  except Exception as e:
408
425
  logger.exception("Job %s failed", id)
409
426
  error(f"Execution failed: {e}")
@@ -411,13 +428,41 @@ def run_job(
411
428
 
412
429
  cancel_flag.set()
413
430
  if client is not None:
414
- status = (
415
- "cancelled"
416
- if (cancelled.is_set() or exit_code == 130)
417
- else ("completed" if exit_code == 0 else "failed")
431
+ from ..job._run._proc import TIMEOUT_EXIT_CODE
432
+
433
+ elapsed = int((_dt.now() - start).total_seconds())
434
+ try:
435
+ time_limit = max(int(params_dict.get("time") or 0), 0)
436
+ except (TypeError, ValueError):
437
+ time_limit = 0
438
+ try:
439
+ deadline_epoch = float(params_dict.get("deadline_epoch") or 0)
440
+ except (TypeError, ValueError):
441
+ deadline_epoch = 0
442
+ if deadline_epoch > 0:
443
+ # The cloud allocation starts when the VM becomes active, before
444
+ # this process. Use the backend-staged absolute deadline so a
445
+ # signal at the real boundary is classified as a timeout.
446
+ time_limit = max(int(deadline_epoch - start.timestamp()), 0)
447
+ # A SIGTERM/SLURM kill at the allocation boundary is a timeout, not a
448
+ # user cancellation. The SDK's own watchdog exits 124; a runner whose
449
+ # SLURM limit fires first exits with 130/137/143 at (or just before)
450
+ # the requested runtime (SLURM's clock starts at dispatch).
451
+ timeout_signal_grace = 60
452
+ timed_out = exit_code == TIMEOUT_EXIT_CODE or (
453
+ time_limit > 0
454
+ and elapsed >= max(time_limit - timeout_signal_grace, 0)
455
+ and exit_code in (130, 137, 143)
418
456
  )
457
+ if cancelled.is_set() or (exit_code == 130 and not timed_out):
458
+ status = "cancelled"
459
+ elif timed_out:
460
+ status = "timeout"
461
+ elif exit_code == 0:
462
+ status = "completed"
463
+ else:
464
+ status = "failed"
419
465
  payload = {"status": status}
420
- elapsed = int((_dt.now() - start).total_seconds())
421
466
  payload["running_time"] = elapsed
422
467
  try:
423
468
  client.post(f"/jobs/{id}/status/", json_data=payload)