The native executor: programs that are executables run as worker processes on the shared mailbox, with limits, crash reports and a process per image
$ sexc add @ajax/mesh-native- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 04:34v/# 2 versions
- drwxr-xr-x-Oct 27 04:34files/# the files of 0.1.1
- latest
- 0.1.1, published Oct 27 04:34 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-backend ^0.1.0, @ajax/mesh-loader ^0.1.0, @ajax/mesh-manifest ^0.1.0, @ajax/mesh-mailbox ^0.1.0, @ajax/mesh-shm ^0.1.0, @ajax/mesh-spawn ^0.1.0, @ajax/mesh-proc-usage ^0.1.0, @ajax/mesh-native-limits ^0.1.0, @ajax/mesh-cpuuse ^0.1.0, @ajax/mesh-log ^0.1.0, @ajax/mesh-text ^0.1.0, @ajax/mesh-abi-base ^0.1.0, @ajax/mesh-abi-backend ^0.1.0, @ajax/mesh-abi-control-block ^0.1.0, @ajax/mesh-abi-native ^0.1.0, @ajax/mesh-abi-fnv ^0.1.0, @ajax/mesh-abi-host-status ^0.1.0, @ajax/mesh-manifest-encode ^0.1.0, @ajax/mesh-check ^0.1.0, @ajax/mesh-abi-header ^0.1.0, @ajax/mesh-abi-ops ^0.1.0, @ajax/mesh-abi-program-table ^0.1.0, @ajax/mesh-abi-ring ^0.1.0, @ajax/mesh-abi-ext ^0.1.0
- dependents
- @ajax/mesh-driver, @ajax/meshd
- keywords
- mesh alphaos native executor worker process
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-native
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/mesh-native 2 3The native executor: programs that are executables (`backends = ["native"]`) run as worker processes on the shared-memory mailbox. The compiler checks the binary for this target (an ELF of this machine, executable), the identity (manifest + `source.hash` + param), the limits and GPU access; the image keeps at most one process: launch sends `run` or spawns off the driver thread, a halt keeps the process, an exit reaps it (killed after the grace), a death fails the slot with the exit status and the output's tail; outputs go to `<logs>/<name>.log` and the log. The backend is isolated and not resident, owns its halts and re-reads `reads` live. 4 5## Differences 6 7- A worker started for a launch that was released before it came up is retired at once (the Rust leaves it to the exit cleanup). 8- A missing `source.hash` says to build it with `mesh-build-programs` (the C port's tool) instead of the Rust's script. 9- GPU workers under MPS are checked through a callback (`mesh_worker_cfg.check_gpu_client`, @ajax/mesh-mps's `mesh_mps_check_native`) so this package needs no CUDA. 10 11## Ported from 12 13[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/native.rs (`Proc`, `Host`, `Worker`, `NativeBackend`, `NativeCompiler`, `check_format`, `cleanup`). 14 15## Tests 16 17`tests/lifecycle.c`: crates/mesh-worker/tests/lifecycle.rs one for one, against apps/mesh-test-worker in a real shared mailbox: spawn and `ready`, tasks, a halt that keeps the process, a stop that reaps it, a new process after a stop, warm launches under 100 ms, crashes (a panic, `exit(3)`, SIGTERM) with their status and output tail, every refusal, identities, and the memory cap (an OOM kill) and CPU cap under systemd scopes. 18 19## Licence 20 21MIT. See the repository's LICENSE.