Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ members = ["crates/*"]
default-members = [".", "crates/*"]

[workspace.package]
version = "4.1.1"
version = "4.1.2"
edition = "2024"
rust-version = "1.89"
license = "LicenseRef-EXA-SL-1.0"
repository = "https://github.com/execution-associates/isb"
homepage = "https://github.com/execution-associates/isb"

[workspace.dependencies]
isb-core = { path = "crates/isb-core", version = "=4.1.1" }
isb-server = { path = "crates/isb-server", version = "=4.1.1" }
isb-apps = { path = "crates/isb-apps", version = "=4.1.1" }
isb-daemon = { path = "crates/isb-daemon", version = "=4.1.1" }
isb-tui = { path = "crates/isb-tui", version = "=4.1.1" }
isb-egress = { path = "crates/isb-egress", version = "=4.1.1" }
isb-core = { path = "crates/isb-core", version = "=4.1.2" }
isb-server = { path = "crates/isb-server", version = "=4.1.2" }
isb-apps = { path = "crates/isb-apps", version = "=4.1.2" }
isb-daemon = { path = "crates/isb-daemon", version = "=4.1.2" }
isb-tui = { path = "crates/isb-tui", version = "=4.1.2" }
isb-egress = { path = "crates/isb-egress", version = "=4.1.2" }

serde = { version = "1", features = ["derive"] }
serde_json = "1"
Expand Down
45 changes: 28 additions & 17 deletions crates/isb-core/src/ipam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,24 +635,35 @@ pub fn check(
only: Option<&str>,
report: &mut dyn FnMut(&str),
) -> Result<Vec<Finding>> {
let mut nets: BTreeMap<String, Subnet> = client
.get("/1.0/networks?recursion=1")?
.as_array()
.into_iter()
.flatten()
.filter_map(|n| Some((n["name"].as_str()?.to_string(), Subnet::from_network(n)?)))
.collect();
let instances = list(client)?;
if let Some(p) = only {
let mine = |i: &Value| i["project"].as_str() == Some(p);
let used: BTreeSet<&str> = instances
.iter()
.filter(|i| mine(i))
.filter_map(|i| i["expanded_devices"].as_object())
.flat_map(|d| d.values().filter_map(|n| n["network"].as_str()))
.collect();
let used: BTreeSet<String> = used.into_iter().map(String::from).collect();
nets.retain(|n, _| used.contains(n));
// Only the bridges isb's instances are on, one by one: listing every
// network with `recursion=1` takes incusd seconds per call (each one's
// state from the host), and a host has an egress bridge per sandbox.
let mut used: BTreeSet<&str> = BTreeSet::new();
for i in &instances {
let project = i["project"].as_str().unwrap_or("default");
if OrgId::from_incus_project(project).is_none() || only.is_some_and(|p| p != project) {
continue;
}
let devs = i["expanded_devices"].as_object().into_iter().flatten();
used.extend(
devs.filter(|(_, d)| d["type"] == "nic")
.filter_map(|(_, d)| d["network"].as_str()),
);
}
let mut nets: BTreeMap<String, Subnet> = BTreeMap::new();
for n in used
.into_iter()
.filter(|n| !n.starts_with(crate::egress::plumb::NET_PREFIX))
{
let path = format!("/1.0/networks/{}", encode_segment(n));
if let Some(s) = client
.get_opt(&path)?
.as_ref()
.and_then(Subnet::from_network)
{
nets.insert(n.to_string(), s);
}
}
let mut findings = Vec::new();
for (network, subnet) in &nets {
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ it; relative paths resolve against that directory.
When it starts, the server writes one hello line:

```json
{"isb": "4.1.1", "protocol": 1}
{"isb": "4.1.2", "protocol": 1}
```

A client checks `protocol` and refuses versions it does not know.
Expand Down Expand Up @@ -205,7 +205,7 @@ All take `files` (default `./isb.yaml` plus `./isb.override.yaml` if present),
## Example session

```text
<- {"isb":"4.1.1","protocol":1}
<- {"isb":"4.1.2","protocol":1}
-> {"id":1,"method":"sandbox.ensure","params":{"spec":{"name":"web","image":"dev-base","cpus":2}}}
<- {"id":1,"event":"progress","data":"web: creating from dev-base"}
<- {"id":1,"event":"progress","data":"web: starting"}
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "isb-sdk"
version = "4.1.1"
version = "4.1.2"
description = "Python SDK for isb: declarative incus sandboxes (containers and VMs)"
readme = "README.md"
license = "MIT AND LicenseRef-EXA-SL-1.0"
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/src/isb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async def main():
from ._util import Duration
from .volumes import Volumes

__version__ = "4.1.1"
__version__ = "4.1.2"

__all__ = [
"PROTOCOL",
Expand Down
6 changes: 3 additions & 3 deletions sdk/python/tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ async def test_death_fails_pending_requests(self) -> None:
path = fake_server(
self.tmp.name,
"""\
echo '{"isb":"4.1.1","protocol":1}'
echo '{"isb":"4.1.2","protocol":1}'
read line
echo "boom" >&2
exit 3
Expand All @@ -243,7 +243,7 @@ async def test_close_fails_pending(self) -> None:
path = fake_server(
self.tmp.name,
"""\
echo '{"isb":"4.1.1","protocol":1}'
echo '{"isb":"4.1.2","protocol":1}'
cat >/dev/null
""",
)
Expand All @@ -261,7 +261,7 @@ async def test_events_and_out_of_order_replies(self) -> None:
path = fake_server(
self.tmp.name,
"""\
echo '{"isb":"4.1.1","protocol":1}'
echo '{"isb":"4.1.2","protocol":1}'
read a
read b
echo 'not json'
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/typescript/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/typescript/npm/linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@execution-associates/isb-linux-arm64",
"version": "4.1.1",
"version": "4.1.2",
"description": "The static isb binary for Linux arm64 (aarch64-unknown-linux-musl), used by @execution-associates/isb",
"license": "SEE LICENSE IN LICENSE",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/typescript/npm/linux-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@execution-associates/isb-linux-x64",
"version": "4.1.1",
"version": "4.1.2",
"description": "The static isb binary for Linux x64 (x86_64-unknown-linux-musl), used by @execution-associates/isb",
"license": "SEE LICENSE IN LICENSE",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions sdk/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@execution-associates/isb",
"version": "4.1.1",
"version": "4.1.2",
"description": "TypeScript SDK for isb: declarative incus sandboxes (containers and VMs)",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -51,8 +51,8 @@
"prepack": "bun run build"
},
"optionalDependencies": {
"@execution-associates/isb-linux-arm64": "4.1.1",
"@execution-associates/isb-linux-x64": "4.1.1"
"@execution-associates/isb-linux-arm64": "4.1.2",
"@execution-associates/isb-linux-x64": "4.1.2"
},
"devDependencies": {
"@biomejs/biome": "^2.2.0",
Expand Down
Loading