feat: release Dever 0.1.5 with direct workers and long transactions
This commit is contained in:
1 parent
89629c2197
commit
a900d7e8db
153 files changed
+3676
-3708
No files matched your search
@@ -204,6 +204,115 @@ fn ecosystem_inputs(author: &Path, workspace: &Path) {
|
||||
fs::write(config, serde_json::to_vec(&settings).unwrap()).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "requires explicit native and zero-Lib ecosystem packs; uses an owned root installation and daemon"]
|
||||
fn signed_zero_lib_ecosystems_run_and_build_in_the_current_container() {
|
||||
let workspace = inputs::workspace();
|
||||
let author = TemporaryDirectory::new();
|
||||
let key = author_inputs(author.path(), &workspace);
|
||||
ecosystem_inputs(author.path(), &workspace);
|
||||
let machine = machine_temporary_directory(&workspace);
|
||||
let layout = Layout::new(machine.path());
|
||||
layout.initialize().unwrap();
|
||||
let version = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
|
||||
let release = layout.downloads().join(version.as_str());
|
||||
packaging::create(author.path(), &release).unwrap();
|
||||
install_release(&layout, &version, &key);
|
||||
fs::remove_dir_all(&release).unwrap();
|
||||
drop(author);
|
||||
let core = layout.versions().join(version.as_str()).join("dever-core");
|
||||
let mut daemon = daemon::TestDaemon::start_with_executable(
|
||||
&layout,
|
||||
&workspace.join("target/native-release-inputs/bin/deverd"),
|
||||
);
|
||||
let deployments = TemporaryDirectory::new();
|
||||
let mut programs = Vec::new();
|
||||
for ecosystem in ECOSYSTEMS {
|
||||
let project = TemporaryDirectory::new();
|
||||
let (extension, source) = match ecosystem {
|
||||
"pip" => (
|
||||
"py",
|
||||
"import gzip\nasync def probe(payload, setting):\n return {\"okay\": gzip.decompress(gzip.compress(b'dever')) == b'dever'}\n",
|
||||
),
|
||||
"npm" => (
|
||||
"mjs",
|
||||
"import {createHash} from 'node:crypto';\nexport async function probe() { return {okay:createHash('sha256').update('dever').digest().length === 32}; }\n",
|
||||
),
|
||||
"go" => ("go", include_str!("../../ecosystem-release/probe.go")),
|
||||
_ => unreachable!(),
|
||||
};
|
||||
write(project.path(), "config/setting.json", "{}");
|
||||
write(
|
||||
project.path(),
|
||||
"module/sample/worker/port.dever",
|
||||
"probe() (okay: Bool) fails app.ProbeResult\n",
|
||||
);
|
||||
write(
|
||||
project.path(),
|
||||
"module/sample/worker/app.dever",
|
||||
"type ProbeResult { error Unavailable(message: Text) }\nprobe() (okay: Bool) { okay = port.probe() }\n",
|
||||
);
|
||||
write(
|
||||
project.path(),
|
||||
"module/sample/worker/api.dever",
|
||||
"cmd probe = app.probe\n",
|
||||
);
|
||||
write(
|
||||
project.path(),
|
||||
"module/sample/worker/adapter.dever",
|
||||
format!("external {ecosystem} \"worker/probe.{extension}\" {{}}\n"),
|
||||
);
|
||||
write(
|
||||
project.path(),
|
||||
&format!("module/sample/worker/worker/probe.{extension}"),
|
||||
source,
|
||||
);
|
||||
command(Command::new(&core).arg("check").arg(project.path()));
|
||||
command(Command::new(&core).args(["lib", "add"]).arg(project.path()));
|
||||
assert_response(command(
|
||||
Command::new(&core).arg("run").arg(project.path()).args([
|
||||
"--",
|
||||
"sample.worker.probe",
|
||||
"{}",
|
||||
]),
|
||||
));
|
||||
let destination = deployments.path().join(ecosystem);
|
||||
write(&destination, "config/setting.json", "{}");
|
||||
let program = destination.join("program");
|
||||
command(
|
||||
Command::new(&core)
|
||||
.arg("build")
|
||||
.arg(project.path())
|
||||
.arg("--output")
|
||||
.arg(&program),
|
||||
);
|
||||
programs.push((ecosystem, destination, program));
|
||||
}
|
||||
daemon.stop();
|
||||
for (ecosystem, destination, program) in programs {
|
||||
assert_response(command(
|
||||
Command::new(program)
|
||||
.current_dir(destination)
|
||||
.args(["sample.worker.probe", "{}"]),
|
||||
));
|
||||
eprintln!(
|
||||
"{ecosystem}: signed runtime, managed execution and source-free standalone execution passed"
|
||||
);
|
||||
}
|
||||
retain_candidate(
|
||||
&layout,
|
||||
&version,
|
||||
"ecosystems",
|
||||
&json!({
|
||||
"format":"dever-zero-lib-release-acceptance-v1",
|
||||
"platform":"linux-x86_64", "version":version.as_str(),
|
||||
"checks":{"signed_install":true,"managed_ecosystems":3,"standalone_ecosystems":3,"source_projects_removed":true},
|
||||
"third_party_packages":"not_run", "host_language_absence":"not_verified",
|
||||
"gpu":"not_run", "public_release":"not_published"
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
fn application(root: &Path, ecosystem: &str) {
|
||||
let (extension, source) = match ecosystem {
|
||||
"pip" => ("py", include_str!("../../ecosystem-release/probe.py")),
|
||||
@@ -389,10 +498,10 @@ fn signed_ecosystems_build_and_run_without_system_language_installations() {
|
||||
nonroot_standalone(&isolated.path().join(ecosystem), &programs[ecosystem]),
|
||||
);
|
||||
}
|
||||
write(&workspace, "target/closure-sandbox-ecosystem-release-acceptance.json", serde_json::to_vec_pretty(&json!({
|
||||
write(&workspace, "target/closure-process_runtime-ecosystem-release-acceptance.json", serde_json::to_vec_pretty(&json!({
|
||||
"format":"dever-ecosystem-release-acceptance-v1", "platform":"linux-x86_64",
|
||||
"runtimes":runtimes,"programs":programs,"standalone_nonroot":standalone_nonroot,
|
||||
"checks":{"signed_install":true,"locked_runtimes":3,"managed_check_run_build":3,"standalone_isolated_root":3,"standalone_nonroot":3,"shared_compile_entries":3,"python_stdlib_paths_in_bundle":true,"os_sandbox":true,"offline_build_receipt_replay":true},
|
||||
"checks":{"signed_install":true,"locked_runtimes":3,"managed_check_run_build":3,"standalone_isolated_root":3,"standalone_nonroot":3,"shared_compile_entries":3,"python_stdlib_paths_in_bundle":true,"direct_workers":true,"offline_build_receipt_replay":true},
|
||||
"os_baseline":"explicit Linux GNU OS libraries and named device nodes inside an owned root",
|
||||
"runtime_pack_provenance":"test author signed the exact pip/npm packs bound to the completed source builds; maker determinism is verified separately",
|
||||
"third_party_packages":{"pip":"simplejson@3.20.1 _speedups C extension","npm":"bufferutil@4.0.9 build/Release addon"}, "other_platforms":"not_run", "public_release":"not_published"
|
||||
|
||||
Reference in new issue
Block a user