Repository navigation
Do not review: CI test #585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
da39e86
feat(minimal2): add --network and --ingress flags to activate
norrietaylor 52c4821
feat(minvmd): spawn host gvproxy + per-PTask vsock shuttle bridge
norrietaylor 6b8c726
feat(minimald): shuttle OwnIp PTask taps to host gvproxy on DM1/3/4
norrietaylor 5031d29
Merge branch 'main' into feat/activate-network-ingress-flags
norrietaylor 1299c3c
chore: add justfile recipes to bring up minimal2 -> minvmd -> minimald
norrietaylor 03decd1
feat(mctx,minimald): scaffold a default minimal.toml for empty sessions
norrietaylor bf53b37
feat(minimald,minvmd): guest root-netns egress via host gvproxy shuttle
norrietaylor 6d02dde
refactor(mctx): make minimal.toml scaffolding a self-contained tempor…
norrietaylor e1236db
Merge branch 'feat/activate-network-ingress-flags' of https://github.…
norrietaylor caa4092
feat(minimald): apply own-IP ingress over the gvproxy control channel…
norrietaylor 482be01
fix(minimald,minimal2): make the in-sandbox interactive attach work (…
norrietaylor a71d96a
fix(minvmd,minimald): grow VM RAM and exec the shell at /usr/bin/bash
norrietaylor 73395f6
fix(minimald): mount devpts so the in-sandbox session PTY works
norrietaylor b9ad4f3
chore(minimald): devpts ptmx instance fix + session exit-code logging
norrietaylor 9b9af44
fix(minimald): make the in-sandbox session shell work in the minvmd g…
norrietaylor a1d8399
style(minimald): rustfmt the ingress control-channel code
norrietaylor 6a92e82
feat(minimald): start the host-side proxies in-VM and publish them on…
norrietaylor 72d8055
docs(spec-networking): add the full-session-path CLI test plan + runner
norrietaylor 455722d
fix(minimald): recover host routing from a poisoned registry lock
norrietaylor 5161676
fix(minimald): bind in-VM proxies on 0.0.0.0 and expose only bound ports
norrietaylor df19d9b
perf(minimald): fence the blocking scaffold clone with block_in_place
norrietaylor 66a9133
chore(minimald): log routine session exits at debug
norrietaylor a4b703e
fix(minvmd): fail own-ip boot when the gvproxy binary is missing
norrietaylor 9da27a0
fix(minimald): adapt netns test to the ControlChannel ingress API
norrietaylor 2b55134
docs(minimald,minvmd): drop references to the superseded host-shuttle PR
norrietaylor bac5b31
style(minvmd): rustfmt the switch-socket setup line
norrietaylor 95b3213
style(minimald): derive SwitchTransport Default
norrietaylor dcecd6a
fix(minimald): mark ControlChannel non_exhaustive
norrietaylor cb5b868
fix(minvmd): tolerate a failed gvproxy spawn on non-own-IP boots
norrietaylor 8e9fd7a
fix(minvmd): accept case-insensitive truthy MINVMD_VM_OWN_IP
norrietaylor 1192223
fix(minimald): log fatal proxy accept-loop errors
norrietaylor 460ee62
refactor(minimald): drop the duplicate non-zero session-exit log
norrietaylor c479def
fix(minimald): keep rustls optional to avoid a dual crypto-provider p…
norrietaylor ceec7cf
feat(sandbox2): add a Network abstraction for per-sandbox networking
norrietaylor 9e0a8b4
refactor(minimald,minvmd): disambiguate the two GvproxySwitch types
norrietaylor 62fe1c4
feat(minimald): move own-IP switch wiring into a sandbox2 Network impl
norrietaylor c6c2b53
feat(sandbox2): apply the configured Network in the generic run path
norrietaylor 03b0be6
refactor(minvmd): remove the dead PtaskAttachment lease path
norrietaylor e85edbb
refactor(minimald-rpc,minimald,minvmd): unify the gvproxy switch prim…
norrietaylor a261d89
fix(minvmd,minimal2): make VM bring-up timeouts and guest RAM configu…
norrietaylor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| //! TEMPORARY: scaffolding a default `minimal.toml` for empty session workspaces. | ||
| //! | ||
| //! This is a stop-gap. A session whose workspace has no `minimal.toml` (the | ||
| //! workspace-upload gap) cannot build a [`crate::Context`], so [`minimald`] | ||
| //! writes a default shell-stack one here on first attach. Remove this module | ||
| //! once sessions receive their project files (including a real `minimal.toml`) | ||
| //! and minimald no longer needs to fabricate one. | ||
| //! | ||
| //! [`generate_mfile`] below is a deliberate COPY of | ||
| //! `minimal::cmd_init::generate_mfile` (and its `DEFAULT_PKGS` / | ||
| //! `DEFAULT_PKGS_BRANCH` / `FALLBACK_STACK` constants). It is duplicated rather | ||
| //! than shared on purpose: this whole module is temporary, so keeping it | ||
| //! self-contained means deleting one file removes the workaround cleanly, | ||
| //! without unpicking a refactor of `cmd_init`. Keep the two in sync only if it | ||
| //! is cheap to; otherwise let this copy lag — it is on its way out. | ||
|
|
||
| use std::path::{Path, PathBuf}; | ||
| 8BD0 td> |
|
|
| use common::SpecOrigin; | ||
| use common::repo_spec::Repo; | ||
|
|
||
| use crate::{Config, Context, Error}; | ||
|
|
||
| /// TEMPORARY (see module docs): default upstream package source. | ||
| const DEFAULT_PKGS: &str = "https://github.com/gominimal/pkgs"; | ||
| /// TEMPORARY (see module docs): branch tracked for [`DEFAULT_PKGS`]. | ||
| const DEFAULT_PKGS_BRANCH: &str = "main"; | ||
| /// TEMPORARY (see module docs): stack used when no matcher applies. | ||
| const FALLBACK_STACK: &str = "shell"; | ||
|
|
||
| /// TEMPORARY (see module docs): resolve the latest [`DEFAULT_PKGS_BRANCH`] | ||
| /// commit and write a default shell `minimal.toml` into `repo_dir`, returning | ||
| /// the written path. Used to bootstrap a session workspace that has none. | ||
| pub fn scaffold_default_mfile( | ||
| config: &Config, | ||
| repo_dir: impl AsRef<Path>, | ||
| ) -> Result<PathBuf, Error> { | ||
| let (mut vcs, _cache, _stdlib) = Context::sub_setup(config)?; | ||
| let (_dir, rev) = vcs.checkout_of( | ||
| DEFAULT_PKGS, | ||
| checkouts::GitRef::Branch(DEFAULT_PKGS_BRANCH.to_string()), | ||
| )?; | ||
|
|
||
| let origin = SpecOrigin::Repo(Repo::Git { | ||
| url: DEFAULT_PKGS.to_string(), | ||
| rev, | ||
| tracking: Some(common::repo_spec::GitRef::Branch( | ||
| DEFAULT_PKGS_BRANCH.to_string(), | ||
| )), | ||
| }); | ||
|
|
||
| let content = generate_mfile(None, &origin); | ||
| let path = repo_dir.as_ref().join(mfile::MFILE_NAME); | ||
| std::fs::write(&path, &content) | ||
| .map_err(|e| Error::IO("writing scaffolded minimal.toml", path.clone(), e))?; | ||
| Ok(path) | ||
| } | ||
|
|
||
| /// TEMPORARY (see module docs): a verbatim copy of | ||
| /// `minimal::cmd_init::generate_mfile`. Renders a `minimal.toml` for the given | ||
| /// upstream `origin`; `matched_stack` falls back to the `shell` stack here since | ||
| /// minimald does no project auto-detection. | ||
| fn generate_mfile( | ||
| matched_stack: Option<(String, Vec<String>, Vec<String>)>, | ||
| origin: &SpecOrigin, | ||
| ) -> String { | ||
| // Fall back to the "shell" stack if no project-specific matcher hit. | ||
| let (stack_name, build_packages, runtime_packages) = matched_stack | ||
| .map(|h| (h.0, h.1, h.2)) | ||
| .unwrap_or_else(|| (FALLBACK_STACK.to_string(), vec![], vec![])); | ||
|
|
||
| let mut content = String::new(); | ||
| content.push_str("# Generated by `minimal init`\n\n"); | ||
|
|
||
| // [upstream] | ||
| content.push_str("[upstream] # Source of software & tooling\n"); | ||
| match &origin { | ||
| SpecOrigin::Repo(Repo::Git { url, rev, tracking }) => { | ||
| content.push_str(&format!("repo = \"{}\"\n", url)); | ||
| if let Some(common::repo_spec::GitRef::Branch(b)) = tracking { | ||
| content.push_str(&format!("bran 10000 ch = \"{}\"\n", b)); | ||
| } | ||
| content.push_str(&format!("locked_commit = \"{}\"\n", rev,)); | ||
| } | ||
| SpecOrigin::LocalDir { given, .. } => { | ||
| content.push_str(&format!("dir = \"{}\"\n", given.to_str().unwrap())) | ||
| } | ||
| SpecOrigin::Inline => unreachable!(), | ||
| } | ||
| content.push('\n'); | ||
|
|
||
| content.push_str("[stack]\n"); | ||
| content.push_str(&format!("use = \"{}\"\n", stack_name)); | ||
| if !build_packages.is_empty() { | ||
| content.push_str(&format!( | ||
| "build_packages = [{}]\n", | ||
| build_packages | ||
| .into_iter() | ||
| .map(|s| format!("\"{}\"", s)) | ||
| .collect::<Vec<_>>() | ||
| .join(", ") | ||
| )); | ||
| } | ||
| if !runtime_packages.is_empty() { | ||
| content.push_str(&format!( | ||
| "runtime_packages = [{}]\n", | ||
| runtime_packages | ||
| .into_iter() | ||
| .map(|s| format!("\"{}\"", s)) | ||
| .collect::<Vec<_>>() | ||
| .join(", ") | ||
| )); | ||
| } | ||
|
|
||
| content.push('\n'); | ||
|
|
||
| content.push_str("[defaults]\n"); | ||
| content.push_str("state_key = \"dev\"\n"); | ||
| content.push('\n'); | ||
| content.push_str("[tasks.shell]\n"); | ||
| content.push_str("interactive = true\n"); | ||
| content.push_str("packages = [\"base\"]\n"); | ||
| content.push_str("exec = \"bash --noprofile -l\"\n"); | ||
| content | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.