Repository navigation
v0.1.6
This release adds local pools that run their commands in a docker container, a host-set pod_env for RunPod pods, [compat.flock] pools shared with flock(1) callers, and priority.aging so a normal caller no longer waits behind the high lane indefinitely. It also makes exec plugin providers on macOS need experimental_remote, as on Linux, makes the Sprites network policy end in a deny-all rule (Sprites jobs stay refused in this release), and fixes a supervisor-kill window and several status and sweep details.
Added
- Local pools can run their commands in a docker container (OrbStack on a Mac).
pools.<p>.container = { image, runtime = "docker", mounts, cpus, memory }(host file only) keeps admission, slots, groups, FIFO and the time limit as they are, and runs the admitted command asdocker runwith the work tree mounted at the same path as the working directory; the exit status is the command's. Each container is namedbitc-<ticket id>(unique per run, so runs that share a--namenever remove each other's) and labelledbitc.job,bitc.pool,bitc.stateandbitc.ticket, and bitc force-removes it at the time limit, on INT, TERM or HUP, onbitc cancel, and when bitc is SIGKILLed (a guard process on a lifeline pipe, on Linux and macOS).bitc sweepand the next admission remove orphaned containers by label, and a sweep error aborts the sweep: nothing more is deleted (containers removed earlier in it stay removed) andbitc sweepexits 69 after the rest of its work. Every removal is by full container id (from the cidfile ordocker ps --no-trunc), never by name; docker runs with bitc's own environment, and an env value docker's env file cannot hold (line break, NUL, invalid UTF-8, 64 KiB or more) is 78 naming the key. The container gets a minimal environment, not the host's, in a 0600--env-filethat bitc removes when the run ends (its values never reach docker's command line). A missing docker CLI, or docker failing before the container exists, is exit 69; a badcontainertable is 78. See docs/containers.md (#60). [providers.runpod] pod_env = { NAME = "value" }adds host-set variables to the RunPod pod's environment at create. Host file only (a repository file that sets it is refused), at most 16 entries; names match^[A-Z][A-Z0-9_]{0,63}$and may not bePATH,HOME,SHELL,USER,PUBLIC_KEY,JUPYTER_PASSWORD,WGETRC,XDG_CONFIG_HOME,IFS,SYSTEM_WGETRC,OPENSSL_CONF,OPENSSL_MODULES,SSLKEYLOGFILE,GLIBC_TUNABLES,HOSTALIASES,RES_OPTIONS,TMPDIR,ENV,BASH_ENV,LOCALDOMAINorPS4, start withBITC_,RUNPOD_,LD_,SSH_,SSL_,GIT_,GO,CGO_,CURL_orMALLOC_, or end with_PROXY; values are at most 256 bytes, with no control character and no{{. A value under a name containingTOKEN,KEY,SECRET,PASS,AUTHorCREDjoins the run's redaction list from 8 bytes; any other value joins only at 16 bytes or more and when it does not start with/. Shorter values stay out so flags and counts such asTOKENIZERS_PARALLELISM=falseare not rewritten in every history line. The ownership tag and the otherBITC_keys cannot be set, the job does not receive the entries, andbitc config explainshows the names with<redacted>(#47).[compat.flock.<pool>]lets bitc share a pool with shell callers built on ONE lock file (theflock heavy.lock cmd, gate and slot-file shape), so bitc, live shell holders and bareflockcallers exclude each other in both directions. Keyslock,gate, aslottemplate with{n}andexclusive(default false;truefor a bench pool that takes the gate and the lock exclusive). Status and doctor do not show shell holders of these pools; a busy legacy lock endsSTARVED <pool> (legacy pool: <path> busy). Time-boxed like[compat](spec 12.2) (#33).- A runbook and example script for sampling
bitc status --jsonon a timer, with daily files and a retention bound (#43). - A host key
priority.aging(default5m;0sturns aging off). A normal caller that has waited this long queues with the high tickets by arrival time instead of behind all of them (#56). bitc status --jsonmarks a normal waiter that has waitedpriority.agingwith"aged": true(absent otherwise;classstaysnormal), and the text view shows its class asnormal (aged)(#106).
Changed
bitc statuslists a pool's waiters in the order admission will take them (effective class, then wait start), not in ticket-name order (#106).- By default a normal caller no longer waits behind the high lane for more than 5m: once its ticket is that old it passes the priority lane and queues by arrival with the high tickets, and an aged caller also passes the legacy high marker of a
[compat]pool. Setpriority.aging = "0s"for the old behaviour (#56).
Fixed
- The status JSON schema (
docs/status.schema.json) now marks a waiter'swaited_sas optional, since reports made before it existed lack it. - A remote job could be reported lost before its command started when the host read the agent's identity file while it was being written; the file is now written atomically and a partly written one counts as not yet written.
- The Sprites probe kit no longer takes a delete that answers 404 as proof a Sprite is gone: it checks the listing after every delete the client answers as done (a 2xx or a 404), so a Sprite still running keeps counting toward the spend cap and the one-Sprite rule, and a Sprite that cannot be confirmed gone is a loud failure.
- The Sprites probe kit now reports a kit Sprite the listing shows with its whole name in another case as a leftover and never deletes it (the pre-run sweep stops the run), instead of missing it in its 404 check and its sweeps; its lists now read the whole org, so a Sprite of another organization anywhere in the listing makes them fail.
- The Sprites probe kit no longer takes a 404 on deleting an odd-named Sprite as proof it is gone when the listing shows the part after the kit prefix in another case, and never confirms such a 404 for a name outside ASCII.
- The Sprites probe kit's DeleteSprite needs a Sprite the run knows, a failed create of a re-used name keeps the earlier record, and ApplyBuildPolicies refuses a LimitMB outside 1..16384.
- A command run under a hold no longer outlives a supervisor killed before the hold recorded the command's process group: the command now starts only after it is recorded.
- The agent refuses a slot account uid or gid above 2147483647, since it uses them as int.
- The reference plugin's fake API refuses a job id that is not a plain id and serves only the result files it documents.
- The manual
privilegedworkflow now tests the commit of the branch it is dispatched on, and no longer takes a ref to check out. - The Sprites probe kit's typed calls now go through the run's Sprite book: a typed write, GetSprite or FSRead needs a live Sprite of the run, ListCheckpoints and GetCheckpoint need a Sprite the run created, Run and Exec refuse a MaxRunAfterDisconnect above 30 seconds, a restore after the kit deleted its Sprite is counted as a live Sprite again, and a raw table write's body may carry only the keys and values the probes use.
- The Sprites probe kit's fallback delete no longer takes a 404 as proof a Sprite is gone: after the 404 it lists the kit's Sprites and matches the name exactly, and a Sprite still listed (or a list that fails) is an error, so the one-live slot is not freed while the Sprite still runs.
- The Sprites probe kit's raw requests are now default-deny for writes: only a config or label update of a live Sprite of the run and its privileges and resources policies may be written, reads under a Sprite need a live Sprite of the run, and a refused request fails the probe that sent it instead of looking like an answer.
- The Sprites probe kit's fallback delete, used for a name the client refuses, now sends the name escaped once as a single path segment (including
;and,) through its own request rather than the raw request. It used to escape it twice, so the server could answer 404 for a Sprite that was still live and the kit took it as deleted. - The Sprites probe kit's raw request now sends a path only when each segment after
/v1/is plain letters, digits,.,_,~or-; anything else, such as%, a control byte or an empty segment, is refused and nothing is sent. - The Sprites probe kit's raw request refuses a path containing
;and sends nothing, as it already does for?and#. - The Sprites probe kit's one-live-Sprite guard now cleans a raw request's path and ignores its case before refusing a create, so a spelling such as
/v1//sprites,/v1/./spritesor/v1/Spritesis refused too (#74). - A remote tool URL with whitespace or a control character is now refused when the config is loaded (exit 78), as the agent URL is.
- An agent URL with whitespace or a control character is now refused when the config is loaded (exit 78). The download and install stubs also single-quote the expected sha256, as the build stub does.
- The download and install stubs pass the agent URL to curl and wget exactly as configured: it is single-quoted for sh, so a $ or a backtick in it is not expanded.
- The start stubs no longer pass the deploy key or the RunPod API key to the tools they run (the agent download, its checksum, and the build stub's checkout and build): both are unset before the stub's first command and given back only to the agent they exec (#73).
- The build agent's start stub no longer leaves the deploy key in the environment of the checkout and the build: it unsets BITC_DEPLOY_KEY before it writes the key file and gives the key back only to the agent it execs (#73).
statuson macOS saysmemory: not used on macOS (no memory admission)instead ofmemory: unreadable (/proc/meminfo), andstatus --jsongainsmemory.applies(false off Linux) (#49).bitc statustext prints each holder on one line: control characters in its command (a newline in abash -cscript, a tab, CR, ESC) are escaped as\n,\t,\r,\x1b, and a very long command is shortened with[truncated];--jsonkeeps the exact argv (#50).- Every Sprites network policy bitc sets now ends in a catch-all deny rule (
{domain: "*", action: "deny"}) after the allowed domains, so a domain not on the list is refused instead of allowed by the platform default; no domains means deny-all, and a*allow or deny supplied by a caller is refused. The policy is read back and must match exactly, rules and order, with no other field, or the job does not proceed and the Sprite can no longer be exec'd or attached; the probe kit's raw API call cannot change a network policy. Sprites jobs stay refused in this release: this only makes the policy itself correct (#6). - The Sprites refusal message,
docs/providers.mdand the README no longer say the network policy leaves egress open (it now ends in a deny-all rule; Sprites jobs stay refused, and enabling them is still tracked in #6), anddocs/providers.mdlists every refusedpod_envname.
Security
- On macOS an exec plugin provider now needs
[host] experimental_remote = true, as on Linux. In 0.1.5 a[providers.<type>]table with apluginpin (a remote provider with spend accounting) loaded and ran on macOS without the flag, although remote providers are off by default everywhere. Without it the load is now refused with exit 78 and the usual message (plus the cleanup line forsweep,doctor --remoteand a host with leftovers). The built-inssh,runpodandspritestables stay refused on macOS whatever the flag says.
Known issues
- macOS builds still refuse the built-in remote providers (
ssh,runpodandsprites, exit 78); only exec plugins run there (behind[host] experimental_remote = truesince 0.1.6). macOS as a client to the built-in remote providers (#4) is planned for a later release. - On macOS, bitc never removes the private plugin copies under
<state>/plugins/<type>/bin/, so a copy of each plugin version bitc has run stays there until you delete it. A bitc that is already running when its binary is replaced in place starts the new binary as its plugin shim; restart long-running bitc processes after an upgrade. - Sprites jobs stay refused (exit 78) in this release; the egress policy is now correct, and enabling Sprites jobs is tracked in #6.
Install
Assets for linux and darwin, amd64 and arm64: bitc_0.1.6_<os>_<arch>.tar.gz (binary, LICENSE, README) and the bare bitc_0.1.6_<os>_<arch>, with sha256 sums in checksums.txt. Check an install with bitc version (expect bitc 0.1.6 (commit ec1d158) ... release=true).
Known issue (Linux, container pools): in 0.1.6 the container orphan sweep could, rarely, remove a live run's container, because one read of /proc/locks can miss a held lock while other locks change; fixed on main (#122) and in the next release, and until then it only affects pools with a container table.