@ship.zone/runner 3.0.0 → 5.0.0
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/.smartconfig.json +19 -1
- package/changelog.md +61 -0
- package/dist_rust/runnerworkspace_linux_amd64_musl +0 -0
- package/dist_rust/runnerworkspace_linux_amd64_musl.tsrust-build.json +4 -4
- package/dist_rust/runnerworkspace_linux_arm64_musl +0 -0
- package/dist_rust/runnerworkspace_linux_arm64_musl.tsrust-build.json +4 -4
- package/dist_ts/00_commitinfo_data.js +3 -3
- package/dist_ts/api-client.d.ts +2 -1
- package/dist_ts/api-client.js +10 -2
- package/dist_ts/artifact-manager.js +1 -1
- package/dist_ts/attempt-state.js +1 -1
- package/dist_ts/cache-manager.js +1 -1
- package/dist_ts/cli-entry.js +17 -3
- package/dist_ts/cli.d.ts +7 -0
- package/dist_ts/cli.js +155 -35
- package/dist_ts/config.js +75 -22
- package/dist_ts/egress-proxy.d.ts +99 -0
- package/dist_ts/egress-proxy.js +607 -0
- package/dist_ts/errors.js +1 -1
- package/dist_ts/filesystem.js +1 -1
- package/dist_ts/index.d.ts +5 -1
- package/dist_ts/index.js +6 -2
- package/dist_ts/interfaces.d.ts +85 -31
- package/dist_ts/interfaces.js +1 -1
- package/dist_ts/log-sender.js +1 -1
- package/dist_ts/microvm-executor.d.ts +90 -0
- package/dist_ts/microvm-executor.js +1078 -0
- package/dist_ts/node-version.d.ts +11 -0
- package/dist_ts/node-version.js +43 -0
- package/dist_ts/npm-grants.d.ts +9 -0
- package/dist_ts/npm-grants.js +44 -0
- package/dist_ts/oci-registry.d.ts +73 -0
- package/dist_ts/oci-registry.js +508 -0
- package/dist_ts/plugins.d.ts +6 -2
- package/dist_ts/plugins.js +7 -3
- package/dist_ts/protocol-validator.d.ts +3 -5
- package/dist_ts/protocol-validator.js +27 -51
- package/dist_ts/redactor.js +1 -1
- package/dist_ts/registration-state.js +1 -1
- package/dist_ts/runner.d.ts +5 -5
- package/dist_ts/runner.js +47 -22
- package/dist_ts/source-workspace.js +1 -1
- package/dist_ts/spec-version.js +1 -1
- package/dist_ts/staging-scavenger.js +1 -1
- package/dist_ts/state-owner.js +4 -2
- package/dist_ts/transfer-archive.js +1 -1
- package/dist_ts/validation.js +1 -1
- package/dist_ts/vsock-protocol.d.ts +130 -0
- package/dist_ts/vsock-protocol.js +336 -0
- package/dist_ts/wire-schema.js +1 -1
- package/package.json +19 -15
- package/readme.md +106 -108
- package/rust/Cargo.lock +1 -0
- package/rust/Cargo.toml +2 -1
- package/rust/src/cpio.rs +147 -0
- package/rust/src/extfs.rs +747 -0
- package/rust/src/guest.rs +2411 -0
- package/rust/src/lib.rs +41 -0
- package/rust/src/main.rs +6 -1
- package/rust/src/oci_tar.rs +842 -0
- package/ts/00_commitinfo_data.ts +2 -2
- package/ts/api-client.ts +19 -1
- package/ts/cli-entry.ts +15 -2
- package/ts/cli.ts +172 -40
- package/ts/config.ts +100 -25
- package/ts/egress-proxy.ts +649 -0
- package/ts/index.ts +5 -1
- package/ts/interfaces.ts +97 -30
- package/ts/microvm-executor.ts +1310 -0
- package/ts/node-version.ts +49 -0
- package/ts/npm-grants.ts +49 -0
- package/ts/oci-registry.ts +649 -0
- package/ts/plugins.ts +6 -2
- package/ts/protocol-validator.ts +29 -58
- package/ts/runner.ts +48 -21
- package/ts/state-owner.ts +8 -1
- package/ts/vsock-protocol.ts +437 -0
- package/dist_ts/oci-executor.d.ts +0 -155
- package/dist_ts/oci-executor.js +0 -2238
- package/ts/oci-executor.ts +0 -2989
package/rust/src/lib.rs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
#[cfg(not(unix))]
|
|
2
2
|
compile_error!("runnerworkspace requires a Unix platform");
|
|
3
3
|
|
|
4
|
+
pub mod cpio;
|
|
5
|
+
pub mod extfs;
|
|
6
|
+
pub mod guest;
|
|
7
|
+
pub mod oci_tar;
|
|
8
|
+
|
|
4
9
|
use serde::Serialize;
|
|
5
10
|
use std::ffi::CString;
|
|
6
11
|
use std::ffi::OsString;
|
|
@@ -662,6 +667,42 @@ where
|
|
|
662
667
|
}
|
|
663
668
|
own_state(&state_directory)
|
|
664
669
|
}
|
|
670
|
+
"build-initrd" => {
|
|
671
|
+
let mut options = Options::parse(iterator)?;
|
|
672
|
+
let binary = PathBuf::from(options.take_one("--binary")?);
|
|
673
|
+
let output = PathBuf::from(options.take_one("--output")?);
|
|
674
|
+
options.finish()?;
|
|
675
|
+
let bytes = cpio::build_initrd(&binary, &output)?;
|
|
676
|
+
emit_json(&serde_json::json!({ "bytes": bytes }))
|
|
677
|
+
}
|
|
678
|
+
"build-rootfs" => {
|
|
679
|
+
let mut options = Options::parse(iterator)?;
|
|
680
|
+
let output = PathBuf::from(options.take_one("--output")?);
|
|
681
|
+
let maximum_bytes = parse_u64(options.take_one("--maximum-bytes")?)?;
|
|
682
|
+
let layers = options
|
|
683
|
+
.take_many("--layer")
|
|
684
|
+
.into_iter()
|
|
685
|
+
.map(PathBuf::from)
|
|
686
|
+
.collect::<Vec<_>>();
|
|
687
|
+
options.finish()?;
|
|
688
|
+
let layer_refs = layers.iter().map(PathBuf::as_path).collect::<Vec<_>>();
|
|
689
|
+
let root = oci_tar::apply_oci_layers(&layer_refs, maximum_bytes)?;
|
|
690
|
+
let bytes = extfs::write_ext2_image(&root, &output)?;
|
|
691
|
+
emit_json(&serde_json::json!({ "bytes": bytes }))
|
|
692
|
+
}
|
|
693
|
+
"guest-init" => {
|
|
694
|
+
let mut options = Options::parse(iterator)?;
|
|
695
|
+
let unix_socket = options.take_one("--unix-socket").ok().map(PathBuf::from);
|
|
696
|
+
let workspace = options.take_one("--workspace").ok().map(PathBuf::from);
|
|
697
|
+
options.finish()?;
|
|
698
|
+
match (unix_socket, workspace) {
|
|
699
|
+
(Some(sock), Some(ws)) => guest::serve_unix_socket(&sock, &ws),
|
|
700
|
+
(None, None) => guest::run_pid1(),
|
|
701
|
+
_ => Err(Error::new(
|
|
702
|
+
"guest-init requires both --unix-socket and --workspace or neither",
|
|
703
|
+
)),
|
|
704
|
+
}
|
|
705
|
+
}
|
|
665
706
|
_ => Err(Error::new("unknown command")),
|
|
666
707
|
}
|
|
667
708
|
}
|
package/rust/src/main.rs
CHANGED
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
|
|
4
4
|
|
|
5
5
|
fn main() {
|
|
6
|
-
|
|
6
|
+
let result = if runnerworkspace::guest::invoked_as_pid1() {
|
|
7
|
+
runnerworkspace::guest::run_pid1()
|
|
8
|
+
} else {
|
|
9
|
+
runnerworkspace::run(std::env::args_os().skip(1))
|
|
10
|
+
};
|
|
11
|
+
if let Err(error) = result {
|
|
7
12
|
eprintln!("runnerworkspace: {error}");
|
|
8
13
|
std::process::exit(error.exit_code());
|
|
9
14
|
}
|