bioengine-worker-clusters
Skill9 starsChanged 4 days agoMITView on GitHub
How to deploy and validate the BioEngine worker on the two Kubernetes sites and on the SLURM site — the exact helm surface a worker change is allowed to touch, the release and namespace names, and the measured traps that have already cost a rollback. Read BEFORE any helm upgrade, kubectl rollout, or sbatch.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bioengine-maintainerSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 56
Call the worker by its exact service id, never by listing.
- Distinctive: line 62
Keep a bogus-id control beside whatever wraps it.
- Very specific: line 63
Read the pod's log with kubectl, which does not go through Hypha at all and is therefore available exactly when the RPC path is not.
- Very specific: line 65
Read Serve health from the Ray dashboard rather than from the worker.
- Very specific: line 66
Check that the site *has* Ray pods first — in at least one external-cluster deployment kubectl get pods -A | grep -i ray matched nothing …
- Distinctive: line 96
If a cluster credential has expired, ask for a refresh.
- Very specific: line 156
RUNNINGis notworking: Check the replica logs for the thing you changed, not the status field.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
BioEngine worker — cluster deploy & validation
Scope: the two non-local run modes of the worker, external-cluster and
slurm. Single-machine validation is not covered here.
Site coordinates — kubeconfig paths, context names, jump hosts, which checkout holds each chart — are deployment-environment facts, not repo facts, so they are deliberately not in this file. Get them from the deploy environment you are working in. Everything below is true regardless of which machine you reach the cluster from.
| Mode | Site | Namespace | Release |
external-cluster | Kubernetes site A | hypha | bioengine-worker-kth |
external-cluster | Kubernetes site B | bioengine | bioengine-worker-denbi |
slurm | HPC site | — | scripts/start_hpc_worker.sh |
The two Kubernetes sites use different namespaces. Do not carry a
-n <namespace> flag from one to the other.
The blast-radius rule — read this first
Only three Helm releases are in scope for a worker change:
bioengine-worker*, turn-server, turn-credentials.
Everything else in the shared namespace (the Hypha server itself, redis, the postgres releases, and the various sibling apps) belongs to other owners. Do not upgrade, roll, scale, or "reconcile" them — not even when one of them looks like the cause. Problems with the cluster itself (node and GPU faults, wedged Ray workers, KubeRay health) are not worker problems and route to whoever owns the cluster.
kuberay-operator and the raycluster-* releases are out of scope
too, despite the worker depending on them.
Before you conclude a worker is wedged — it is usually the listing, not the worker
A worker whose management calls "stop answering" is very often a caller
stuck inside api.list_services(), which hangs against a busy workspace
while the worker is perfectly healthy. In one run on one RPC connection,
the RPC listing timed out after 75 s while get_service +
get_status by exact id answered in 0.7 s, with a bogus id
correctly refused in 0.0 s. The defect is upstream in
hypha-rpc/hypha-server, and it is intermittent — ~24 minutes
later the same listing answered in 0.05 s, and it has been seen to clear
by itself after ~25 minutes. So an RPC listing that answers today is not
evidence the bug is gone.
So, in this order, before touching anything:
- Call the worker by its exact service id, never by listing. The
resolve-by-HTTP recipe and its three silent traps (a
307with a zero-byte body that reads as "no services"; HTTP ids not being workspace-prefixed; the token being optional, where a wrong one gives 401 on a route that answers 200 with none) are in the bioengine-maintainer skill under Hypha platform invariants. Keep a bogus-id control beside whatever wraps it. - Read the pod's log with
kubectl, which does not go through Hypha at all and is therefore available exactly when the RPC path is not. - Read Serve health from the Ray dashboard rather than from the worker.
Check that the site has Ray pods first — in at least one
external-clusterdeploymentkubectl get pods -A | grep -i raymatched nothing anywhere, so Ray ran inside the worker pod and there was no separate dashboard to read.
And never conclude a service is ABSENT from a listing. The RPC and HTTP listings have been seen to disagree about which worker pod's services existed (25 entries vs 28, naming different pods) — and ~24 minutes later to agree at 25. Only an exact-id lookup can answer an absence question; asserting one from the RPC listing produced a false "production app is unreachable" report and an unnecessary escalation, and agreement on a single run does not retire the problem.
Kubernetes, both sites
- A namespace you cannot see is reported as
Forbidden, notNotFound. Sohelm list -n <wrong-namespace>returning Forbidden reads exactly like revoked RBAC, and is not. Before concluding access was taken away, checkkubectl get ns -o nameandkubectl auth can-i list pods -n <namespace>. --workspace-dir=/home/bioenginein the worker args is a path inside the container, not a namespace.- Ray runs on its own pods in
external-clustermode, so the worker pod holds no raylets. Its own resource footprint is small, and Ray's requests and limits are not this chart's concern. - The chart carries a
values-dev.yamlalongsidevalues.yaml. Use the dev values for a-devNimage, never the prod values file. - The two sites are kept in lock-step on the worker image tag. If you bump one, bump the other in the same piece of work, or say explicitly why not.
- If a cluster credential has expired, ask for a refresh; do not attempt to re-auth.
SLURM
- Entry point is
scripts/start_hpc_worker.sh. It derives the image tag frompyproject.toml— or frommainon GitHub when run outside a clone — so the image tag follows the checkout's version, and a stale checkout silently validates a stale worker. - Apptainer, not Docker. SIF builds break where the host sets
yama.ptrace_scope=2, which blocks the proot/mksquashfs path. The working path isapptainer build --sandboxto a directory image; the script accepts a sandbox directory as well as a.sif. - The worker is spun up on demand, not persistently.
Dos
- Diff the LIVE args against the chart before you roll. Revisions
have been applied out-of-band, so
values.yamlhas at times been behind the running pod — ahelm upgradethen silently reverts things nobody meant to revert. Comparekubectl get deploy -n <ns> <name> -o yamlagainst the rendered chart first, and reconcile the file before using it. - Read the
values.yamlcomments before changing a value. Both charts carry long, dated, measured rationales (liveness probe design, resource requests, why--tokenwas removed). They encode past incidents. If you are about to contradict one, say so out loud. - Keep
image.tagand the startup args as one change where the comments say they are coupled. - Record which helm revision you created, so the next reader can tell chart state from live state.
Don'ts
- Never put a token on the command line.
$(VAR)is expanded by Kubernetes at render time and lands in/proc/<pid>/cmdline, which is world-readable.HYPHA_TOKENis already injected as a pod env var from the secret, and 0.16.37+ resolves--token-file > --token > HYPHA_TOKEN. A mounted secret file does not work either: the pod runsrunAsUser: 65534with nofsGroup, secret files are root-owned mode 0400, and an unreadable--token-fileis a hard startup error. - Do not assume
--startup-applicationsprotects an app. It does the opposite of what the name suggests on restart: a worker that restarts re-adopts live Ray Serve apps at their live version, but any app listed in--startup-applicationsis force-reset to the version pinned there. A pinned-but-stale version has already rolled an app back six published releases. Before a roll, read the live versions fromget_app_statusand make the pins match. - Do not infer
disable_gpufromnum_gpus. They are independent:gpu_enabledis permission,num_gpusis what the app's manifest requests. Readgpu_enabledfromget_app_status. - Do not redeploy an app by RPC without passing
hypha_token. An app recovered from Serve state is stored withhypha_token: None, so an RPC redeploy that omits it drops a credential the running replica still holds. Formodel-runnerthis fails silently — it falls back to anonymous read-only and merely stops publishing test reports while still reporting RUNNING. - Do not
stop_app/delete_appa failed deployment while diagnosing.get_app_status(application_ids=[...])→deployments.<name>.logsis the primary signal, andstop_appdiscards it. RUNNINGis notworking. Check the replica logs for the thing you changed, not the status field.
Reporting back
Each validation writes down, per site: the image tag that actually ran, the helm revision or job id, the pod or replica name, and the specific log line or RPC result that proves the behaviour. "Deployed and healthy" is not evidence.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

