@bijectionhq/pack-compute/launcher is
the customer-run endpoint (POST /runs, POST /runs/<run>/cancel). It
authenticates the installation’s bearer, deduplicates launches by their key,
refuses launches for runs it was told to cancel, and hands the run, with its
secret in BIJECTION_CONTEXT, to a provider:
Spark runs as a Databricks job, a Kubernetes job or on Ray, through the
matching provider. Configure the worker entrypoint and runtime on the cluster,
and register the function name and contract digest on both the launcher and the
worker.
Keep a launch journal
PasssqliteLaunchStore("/state/launches.db") from
@bijectionhq/pack-compute/launcher-sqlite on Node.js, on a persistent volume
with SQLite locking and durable commits, one journal per launcher identity.
Configure the same acknowledgement horizon on the receiver (retention) and the
launcher. The journal keeps 1,024 records and 24 hours of resolved replay by
default; exact retries reuse the stored answer, and saturation answers a
transient refusal. memoryStore() is for development.
Ray, Kubernetes and Databricks recover a lost response by reading back a
matching existing job, as long as the provider retains the original submission
and protects its identity and metadata. An absent job keeps the launch
unresolved.
Serve the worker side
A worker answers the run through the callback route with its attempt ID and secret, postingprogress, reply or fail. Use serveRun(handler, { contractDigest }) from @bijectionhq/pack-compute/worker in TypeScript, or the
Python worker; an inline provider is
inline(handler, { contractDigest }) from @bijectionhq/pack-compute/launcher.
Each compares its installed digest with the launch before calling the handler.
Provision it
Provision the launcher, the worker and their credentials in your own infrastructure, and keep the worker’s authority scoped to the task it accepts. Seal the launcher’s bearer on the installation under the secret path the pool’s binding names as itscredential (bijection secret set <path>).
A compute mount’s worker pools are slots,
<compute>.pools.<name>, of the worker@1 protocol. No host offers
worker@1 today, so bind each pool to your own launcher with workerPool.aws
or workerPool.gcp from @bijectionhq/pack-compute in the installation’s bindings file: the launcher’s HTTPS url, the credential that
holds its bearer, and the account, region or project its workers run in. An unbound pool is
refused at deploy with PlacementUnavailable (NotOffered). When a host
offers managed workers, unbound pools become managed with no code change.