Skip to content

Use the k8s values file on Hawk by default, so sandbox pods get #72's requests - #79

Merged
bunny-baxter merged 2 commits into
mainfrom
sandbox-values-on-k8s
Oct 9, 2026
Merged

bunny-baxter merged 2 commits into
mainfrom
sandbox-values-on-k8s

Conversation

@bunny-baxter

@bunny-baxter bunny-baxter commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem

#72 added ephemeral-storage requests for the sandbox pods, but put them only in the k8s values file. Every task defaults to sandbox_backend="docker", and no Hawk config overrides it (bloom68 included). Hawk accepts the compose file by converting it to chart values, and compose has no way to express an ephemeral-storage request. So the requests never reached a pod.

Evidence from bloom68-alv3junt54xqrybd:

  • The runner log shows Hawk loading /tmp/leanopenproblems_sandbox/0.1.11rc11/fc_488aade228ec/corpus/compose.yaml.
  • Running Hawk's converter on that compose file gives both services limits/requests: memory: 32Gi and no ephemeral-storage request.
  • PodReplacedError restarts continued through the run. Erdos23 alone restarted 4 times.

The comparator's runtimeClassName: CLUSTER_DEFAULT pin was dropped the same way. That run still landed on runc, but only because the deployment sets no sandbox_runtime_class_name.

Change

  • sandbox_backend now defaults to None, which resolves to k8s when HAWK_JOB_ID is set and docker otherwise. An explicit value still wins.
    • Hawk's runner Job sets HAWK_JOB_ID unconditionally (api/helm_chart/templates/job.yaml), in the same env block as HAWK_RUNNER_PATCH_SANDBOX=true, the flag that turns on its docker→k8s conversion. hawk local sets neither and runs docker sandboxes as-is, so it keeps docker.
    • An earlier revision keyed on KUBERNETES_SERVICE_HOST. That would also have switched local-Docker runs from inside any other pod (a dev pod, a CI job), so it was changed after review.
  • Applies to all six tasks, including apn_redteam_collatz and apn_math_software_test. Their helpers now branch on the resolved backend that get_sandbox_config returns.
  • Tests and local runs are unaffected: they call get_compose_file, which asks for docker explicitly.
  • New tests/test_sandbox_backend.py.

Testing

  • uv run mypy: clean.
  • The fast pytest suite: 202 passed.
  • Built with the bloom68 args, apn_erdos resolves to ('docker', .../compose.yaml) by default, still docker with only KUBERNETES_SERVICE_HOST set, and ('k8s', .../values.yaml) with HAWK_JOB_ID set.
  • Checked that Hawk's K8sSandboxEnvironmentValues model keeps the ephemeral-storage key when it parses and dumps the values file.

Before relying on it

🤖 Generated with Claude Code

bunny-baxter and others added 2 commits October 8, 2026 15:14
… requests

#72 added ephemeral-storage requests to the k8s values file, but every task
defaulted to sandbox_backend="docker" and no Hawk config overrode it (bloom68
included). Hawk accepted the compose file by auto-converting it to chart
values, and that conversion has nowhere to put an ephemeral-storage request,
so the bloom68 run (bloom68-alv3junt54xqrybd) created its sandbox pods with
no request at all. The runner log confirms Hawk loaded
.../corpus/compose.yaml, and the PodReplacedError restarts continued.

The comparator's runtimeClassName: CLUSTER_DEFAULT pin was dropped the same
way. That run still got runc, because the deployment sets no default runtime
class, but the pin only held by luck.

sandbox_backend now defaults to None, meaning: k8s inside a Kubernetes pod
(KUBERNETES_SERVICE_HOST is set), docker everywhere else. An explicit value
still wins. The red-team and software-test helpers branch on the resolved
backend that get_sandbox_config returns, rather than on the raw argument.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KUBERNETES_SERVICE_HOST also flips the default for someone running inspect
eval with local Docker from inside some other pod (a dev pod, a CI job), who
would silently get the k8s backend. HAWK_JOB_ID is what we actually mean.
Hawk's runner Job sets it unconditionally, in the same env block as
HAWK_RUNNER_PATCH_SANDBOX=true, the flag that enables the docker->k8s
conversion. `hawk local` sets neither, and runs docker sandboxes as-is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@edkins edkins left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge if a test run comes out ok

@bunny-baxter

Copy link
Copy Markdown
Contributor Author

Did some test runs using some easy OEIS problems, looks ok! https://viewer.hawk.hawkbench.com/eval-set/sandbox-values-smoke-gubh336kj77bspyc

@bunny-baxter
bunny-baxter merged commit 3d11d09 into main Oct 9, 2026
14 checks passed
@bunny-baxter
bunny-baxter deleted the sandbox-values-on-k8s branch October 9, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants