@ship.zone/runner 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/mod.ts CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env -S deno run --allow-env --allow-net --allow-read --allow-write --allow-run
1
+ #!/usr/bin/env -S deno run --allow-all
2
2
 
3
3
  export * from './ts/index.ts';
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ship.zone/runner",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "The isolated OCI job runner for ship.zone CI/CD",
5
5
  "homepage": "https://code.foss.global/ship.zone/runner",
6
6
  "bugs": {
@@ -55,7 +55,7 @@
55
55
  "third-party-licenses.md"
56
56
  ],
57
57
  "scripts": {
58
- "build": "deno task check && deno task bundle && tsrust",
58
+ "build": "deno task check && deno task bundle && deno run --allow-read=dist_npm/mod.js scripts/verify-npm-entrypoint.ts && tsrust",
59
59
  "test": "deno task test && cargo test --manifest-path rust/Cargo.toml"
60
60
  }
61
61
  }
package/readme.md CHANGED
@@ -68,7 +68,7 @@ import { ShipRunner } from '@ship.zone/runner';
68
68
  Without an import-map entry, use the npm package directly:
69
69
 
70
70
  ```ts
71
- import { ShipRunner } from 'npm:@ship.zone/runner@0.2.0';
71
+ import { ShipRunner } from 'npm:@ship.zone/runner';
72
72
  ```
73
73
 
74
74
  For development in this repository, install dependencies and build the npm bundle plus the static
@@ -84,12 +84,34 @@ The published package includes `dist_rust/runnerworkspace_linux_amd64_musl` and
84
84
  `rust/.cargo/config.toml`, and the dependency notices. `oci.workspaceHelperPath` can select an
85
85
  explicit absolute helper path for development or controlled deployments.
86
86
 
87
+ Configured, packaged, and dependency-injected helper resolver paths are source files. Runtime
88
+ verification reads the bounded regular source through one pinned file descriptor, hashes those exact
89
+ bytes, and materializes an executable mode-`0755` copy below the private mode-`0700` runner state
90
+ subdirectory as `workspace-helpers/runnerworkspace_<target>_musl_<sha256>`. Source permissions are
91
+ not changed, so package managers may install the source without executable bits. The private parent
92
+ directory is the host access boundary; mode `0755` lets capability-dropped helper containers execute
93
+ the host-owned read-only bind mount. `IOciRuntimeFacts.helperPath` reports the validated
94
+ materialized path used by host probes and OCI bind mounts, while `helperSha256` reports its content
95
+ digest. A private advisory lock serializes materialization. Existing digest paths are reused only
96
+ after their type, single-link status, mode, and digest are revalidated without mutating them; the
97
+ runner retains a bounded set for rollback, reclaims stale incomplete temporary copies, and rejects
98
+ excessive recent temporary residue. The sole immediate-recovery exception is a validated temporary
99
+ name and exact digest destination that still reference the same two-link inode after interruption;
100
+ the runner removes the temporary name under the lock, verifies the destination became single-link,
101
+ and then reuses it.
102
+
103
+ Runtime verification creates one private `.runtime-probe-owner_<id>` marker in the helper state.
104
+ Host tmpfs probes include that owner in their exact directory names, and OCI runtime probe volumes
105
+ carry the same `ship.zone.runner.runtime-probe-owner` label. This lets interrupted verification be
106
+ cleaned by the same state owner without touching unowned probes or probes from another runner. The
107
+ runner syncs both the helper-directory entry and a newly created owner marker before using them.
108
+
87
109
  ## Configure And Run
88
110
 
89
111
  Create a private runner configuration:
90
112
 
91
113
  ```sh
92
- deno run --allow-env --allow-net --allow-read --allow-write --allow-run \
114
+ deno run --allow-all \
93
115
  npm:@ship.zone/runner init \
94
116
  --control-plane https://foss.global \
95
117
  --runtime-path /usr/bin/docker
@@ -99,12 +121,16 @@ Register with a one-time bootstrap token, then start the daemon:
99
121
 
100
122
  ```sh
101
123
  SHIP_RUNNER_BOOTSTRAP_TOKEN='<one-time token>' \
102
- deno run --allow-env --allow-net --allow-read --allow-write --allow-run \
124
+ deno run --allow-all \
103
125
  npm:@ship.zone/runner register
104
- deno run --allow-env --allow-net --allow-read --allow-write --allow-run \
126
+ deno run --allow-all \
105
127
  npm:@ship.zone/runner run
106
128
  ```
107
129
 
130
+ `--allow-all` is required because Deno reserves direct `/dev/shm` access for that mode. The runner
131
+ uses `/dev/shm` for fail-closed host tmpfs verification before registration and must already be
132
+ trusted with unrestricted subprocess execution for the configured OCI runtime.
133
+
108
134
  Replace `run` with `once` to claim at most one job or `config` to print the effective configuration
109
135
  with credentials masked. Within this repository, `deno task dev -- <command>` is the equivalent
110
136
  development invocation. `SHIP_RUNNER_CONFIG` selects a config path; the default is
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@ship.zone/runner',
6
- version: '0.2.1',
6
+ version: '0.2.3',
7
7
  description: 'The isolated OCI job runner for ship.zone CI/CD'
8
8
  }
package/ts/cli.ts CHANGED
@@ -27,8 +27,7 @@ interface IParsedArguments {
27
27
  options: Map<string, string | true>;
28
28
  }
29
29
 
30
- const cliInvocation =
31
- 'deno run --allow-env --allow-net --allow-read --allow-write --allow-run npm:@ship.zone/runner';
30
+ const cliInvocation = 'deno run --allow-all npm:@ship.zone/runner';
32
31
 
33
32
  const usage = `ship.zone runner ${runnerVersion}
34
33