verifiers 0.3.2.dev49__py3-none-any.whl → 0.3.2.dev51__py3-none-any.whl

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.
@@ -37,9 +37,9 @@ INSTALL = r"""
37
37
  set -e
38
38
  export PATH="/var/tmp/vf-node/bin:$PATH"
39
39
  prefix="$VF_PRIME_AGENT_DIR/$PRIME_AGENT_COMMIT"
40
- [ -x "$prefix/bin/prime-agent" ] && exit 0
40
+ [ -x "$prefix/bin/prime-agent" ] && [ -f "$HOME/.prime/agent/kernel-venv/.bootstrap-version" ] && exit 0
41
41
  export NPM_CONFIG_PREFIX="$prefix"
42
- export PRIME_AGENT_BOOTSTRAP_KERNEL_ON_INSTALL=0
42
+ export PRIME_AGENT_BOOTSTRAP_KERNEL_ON_INSTALL=1
43
43
  release_url="$VF_PRIME_AGENT_GITHUB_RELEASE_URL/v$PRIME_AGENT_RELEASE_VERSION"
44
44
  agent_tarball="prime-agent-$PRIME_AGENT_RELEASE_VERSION.tgz"
45
45
  ai_tarball="prime-agent-ai-$PRIME_AGENT_RELEASE_VERSION.tgz"
@@ -84,6 +84,7 @@ repacked="$(npm pack "$download_dir/package-root/package" \
84
84
  PRIME_AGENT_BOOTSTRAP_TOOLS_ON_INSTALL=1 npm install -g \
85
85
  --no-fund --no-audit --loglevel=error --progress=false \
86
86
  "$download_dir/repacked/$repacked"
87
+ [ -f "$HOME/.prime/agent/kernel-venv/.bootstrap-version" ]
87
88
  """
88
89
 
89
90
 
@@ -27,6 +27,7 @@ from verifiers.v1.runtimes.base import (
27
27
  RuntimeProcess,
28
28
  )
29
29
  from verifiers.v1.runtimes.limiters import creation_limiter
30
+ from verifiers.v1.utils.aio import run_shielded
30
31
 
31
32
  logger = logging.getLogger(__name__)
32
33
 
@@ -128,25 +129,7 @@ class ModalRuntime(Runtime):
128
129
  creation_limiter(self.config.creates_per_sec, "modal-sandbox")
129
130
  or contextlib.nullcontext()
130
131
  ):
131
- self._sandbox = await modal.Sandbox.create.aio(
132
- "sleep",
133
- "infinity", # keep-alive entrypoint; the harness runs via `exec`
134
- app=app,
135
- name=self.name,
136
- # Clear the image's ENTRYPOINT so `sleep infinity` runs as the command
137
- # rather than as args to it — otherwise an image with its own entrypoint
138
- # (e.g. SWE task images) never starts the keep-alive and the sandbox dies.
139
- image=modal.Image.from_registry(self.config.image).entrypoint([]),
140
- workdir=self.config.workdir,
141
- env=self.env,
142
- cpu=self.config.cpu,
143
- memory=int(self.config.memory * 1024), # Modal memory is MB
144
- gpu=self.config.gpu,
145
- region=self.config.region,
146
- block_network=not self.config.network_access,
147
- timeout=24 * 60 * 60, # Maximum lifetime of any sandbox.
148
- encrypted_ports=[SERVICE_PORT],
149
- )
132
+ await run_shielded(self._create_sandbox(app))
150
133
  self.info.id = self._sandbox.object_id
151
134
  logger.info(
152
135
  "modal: sandbox %s up (image=%s)", self.info.id, self.config.image
@@ -157,6 +140,37 @@ class ModalRuntime(Runtime):
157
140
  ) as e: # provisioning failure is one rollout's problem, not the eval's
158
141
  raise SandboxError(f"modal sandbox provisioning failed: {e}") from e
159
142
 
143
+ async def _create_sandbox(self, app) -> None:
144
+ """Create the sandbox and take ownership of the handle, as one shielded step.
145
+
146
+ Modal schedules the sandbox before `Sandbox.create` returns, so a cancellation
147
+ landing between those two points leaves a sandbox that boots and bills with
148
+ `_sandbox` still unset — invisible to both `teardown` and the atexit backstop, and
149
+ alive until its 24h maximum lifetime. Assigning inside the coroutine that
150
+ `run_shielded` owns keeps the cancellation pending until the handle is ours.
151
+ """
152
+ import modal
153
+
154
+ self._sandbox = await modal.Sandbox.create.aio(
155
+ "sleep",
156
+ "infinity", # keep-alive entrypoint; the harness runs via `exec`
157
+ app=app,
158
+ name=self.name,
159
+ # Clear the image's ENTRYPOINT so `sleep infinity` runs as the command rather
160
+ # than as args to it — otherwise an image with its own entrypoint (e.g. SWE
161
+ # task images) never starts the keep-alive and the sandbox dies.
162
+ image=modal.Image.from_registry(self.config.image).entrypoint([]),
163
+ workdir=self.config.workdir,
164
+ env=self.env,
165
+ cpu=self.config.cpu,
166
+ memory=int(self.config.memory * 1024), # Modal memory is MB
167
+ gpu=self.config.gpu,
168
+ region=self.config.region,
169
+ block_network=not self.config.network_access,
170
+ timeout=24 * 60 * 60, # Maximum lifetime of any sandbox.
171
+ encrypted_ports=[SERVICE_PORT],
172
+ )
173
+
160
174
  async def expose(self, port: int) -> str | None:
161
175
  # Publish a server hosted IN the sandbox: Modal forwards `port` (named via
162
176
  # `encrypted_ports` at creation) to a public URL, read back from `sandbox.tunnels()`.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.2.dev49
3
+ Version: 0.3.2.dev51
4
4
  Summary: Verifiers: Environments for LLM Reinforcement Learning
5
5
  Project-URL: Homepage, https://github.com/primeintellect-ai/verifiers
6
6
  Project-URL: Documentation, https://github.com/primeintellect-ai/verifiers
@@ -110,7 +110,7 @@ verifiers/v1/harnesses/pi/harness.py,sha256=11V9d6_npjE9vEEgIG7y80kfaX1Ilfi3lbYs
110
110
  verifiers/v1/harnesses/pool/__init__.py,sha256=HTYsNiWGdiNEsSHj4xhPmshJSNb7SHjQ7d4yZQ4p3HM,127
111
111
  verifiers/v1/harnesses/pool/harness.py,sha256=TsELYhW4mMOt_laiDN6nAQJxFL3iCcKvckQWYve2XiE,3571
112
112
  verifiers/v1/harnesses/prime_agent/__init__.py,sha256=xfPC4RrlnyYWaf38tPAOZq4YL6M55lMpj5BoRLmaK8I,171
113
- verifiers/v1/harnesses/prime_agent/harness.py,sha256=VFQ3kOqfR38upCwR8nuBbdc68RYW3EKUjVeOD7cKq1c,10785
113
+ verifiers/v1/harnesses/prime_agent/harness.py,sha256=CgrKBXoelwRiSH9fzsNnz4oykz_iDJ3p5WVGBOB9AeU,10906
114
114
  verifiers/v1/harnesses/rlm/__init__.py,sha256=hwx51xTdEWzzYgMj-p4ETNcptoub3IPMDbEdJ4uB8Ns,122
115
115
  verifiers/v1/harnesses/rlm/harness.py,sha256=DX6xPBdxdXhJz-LClThAj7f1ZJ5tgN03H_WBbYhKce4,10445
116
116
  verifiers/v1/harnesses/terminus_2/__init__.py,sha256=l1pwfg1HyVDEqT9efdnFWcXqaZwtKwe7TrplkyxZSA0,166
@@ -143,7 +143,7 @@ verifiers/v1/mcp/toolset.py,sha256=G2wzNdEMGLXoQUcrwF0TartJkqokNPI3o7YUOAaaa6U,1
143
143
  verifiers/v1/runtimes/__init__.py,sha256=ppc1R_sx-aMcuJSx4t99rTSjloUXI0M6EUj676-1PeY,2862
144
144
  verifiers/v1/runtimes/base.py,sha256=SRTUNAcdW0xJIWjfS5RcijFXqdKyXmGvp2tvV58eu58,16826
145
145
  verifiers/v1/runtimes/limiters.py,sha256=C6cWDD4pwyFwUY4QFke3oiMXwydSNIfSbJSIglUC2kE,3062
146
- verifiers/v1/runtimes/modal.py,sha256=Lgc0OkQEWHVBHCqBE2ja-mxtRYGserixlO4B9b5Vwn4,12661
146
+ verifiers/v1/runtimes/modal.py,sha256=yyrqI6agpzi0lp5jR_ExqKwAq8tRgLvHVa3Sd3oh6RU,13222
147
147
  verifiers/v1/runtimes/prime.py,sha256=1IWRLKdGgscs8JmvkBdaS3au4tV0KUqv4W1gHJvOE2Q,18781
148
148
  verifiers/v1/runtimes/subprocess.py,sha256=IO82fI1wFbeTtV7T1AHSF8iTUyT9yGJFIUmCKKw6CnQ,7763
149
149
  verifiers/v1/runtimes/docker/__init__.py,sha256=K6xbJAT1F3-PtgP5Gum2UJKQ8Re1Yz90BP8Uc7Npec4,20594
@@ -189,8 +189,8 @@ verifiers/v1/utils/prime.py,sha256=UTYRjp9cbjNb6CVmBHda-1wWZAIIfxNOmTyNuT7_wL4,9
189
189
  verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
190
190
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
191
191
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
192
- verifiers-0.3.2.dev49.dist-info/METADATA,sha256=dSm6-ha_O7m2pDfdJZ6jHFqIhau1dqy-avNMf_MguOM,4153
193
- verifiers-0.3.2.dev49.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
194
- verifiers-0.3.2.dev49.dist-info/entry_points.txt,sha256=uqQje0TMsr7k6nXlWxlPs13Si0evb3pVCEDF6c-YL80,241
195
- verifiers-0.3.2.dev49.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
196
- verifiers-0.3.2.dev49.dist-info/RECORD,,
192
+ verifiers-0.3.2.dev51.dist-info/METADATA,sha256=cKIWW1CpNzPrb3lN_XMF0_E6apejzQIVk0bfd2TM4k8,4153
193
+ verifiers-0.3.2.dev51.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
194
+ verifiers-0.3.2.dev51.dist-info/entry_points.txt,sha256=uqQje0TMsr7k6nXlWxlPs13Si0evb3pVCEDF6c-YL80,241
195
+ verifiers-0.3.2.dev51.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
196
+ verifiers-0.3.2.dev51.dist-info/RECORD,,