microvms 0.2.0__tar.gz → 0.3.0__tar.gz

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.
Files changed (63) hide show
  1. {microvms-0.2.0 → microvms-0.3.0}/Cargo.lock +59 -3
  2. {microvms-0.2.0 → microvms-0.3.0}/PKG-INFO +1 -1
  3. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/Cargo.toml +2 -2
  4. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/sandbox.rs +25 -6
  5. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/session/mod.rs +3 -1
  6. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/Cargo.toml +2 -2
  7. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/microvms.pyi +1 -1
  8. {microvms-0.2.0 → microvms-0.3.0}/protocol/Cargo.toml +1 -1
  9. {microvms-0.2.0 → microvms-0.3.0}/pyproject.toml +1 -1
  10. {microvms-0.2.0 → microvms-0.3.0}/Cargo.toml +0 -0
  11. {microvms-0.2.0 → microvms-0.3.0}/README.md +0 -0
  12. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/README.md +0 -0
  13. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/proptest-regressions/cost.txt +0 -0
  14. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/constants.rs +0 -0
  15. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/control/artifact.rs +0 -0
  16. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/control/connector.rs +0 -0
  17. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/control/fake.rs +0 -0
  18. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/control/image.rs +0 -0
  19. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/control/microvm.rs +0 -0
  20. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/control/mod.rs +0 -0
  21. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/control/ops.rs +0 -0
  22. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/control/token.rs +0 -0
  23. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/control/transport.rs +0 -0
  24. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/cost.rs +0 -0
  25. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/error.rs +0 -0
  26. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/hooks.rs +0 -0
  27. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/lib.rs +0 -0
  28. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/region.rs +0 -0
  29. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/session/exec.rs +0 -0
  30. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/session/files.rs +0 -0
  31. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/session/http.rs +0 -0
  32. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/session/proxy.rs +0 -0
  33. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/session/sse.rs +0 -0
  34. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/src/sizing.rs +0 -0
  35. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/tests/live_pagination.rs +0 -0
  36. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/tests/live_versions.rs +0 -0
  37. {microvms-0.2.0 → microvms-0.3.0}/microvms-core/tests/turmoil_client.rs +0 -0
  38. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/README.md +0 -0
  39. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/examples/typed_usage.py +0 -0
  40. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/py.typed +0 -0
  41. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/src/cost.rs +0 -0
  42. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/src/errors.rs +0 -0
  43. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/src/exec.rs +0 -0
  44. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/src/hooks.rs +0 -0
  45. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/src/lib.rs +0 -0
  46. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/src/region.rs +0 -0
  47. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/src/runtime.rs +0 -0
  48. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/src/sandbox.rs +0 -0
  49. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/src/session.rs +0 -0
  50. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/tests/conftest.py +0 -0
  51. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/tests/test_cost.py +0 -0
  52. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/tests/test_errors.py +0 -0
  53. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/tests/test_exec.py +0 -0
  54. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/tests/test_region.py +0 -0
  55. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/tests/test_session.py +0 -0
  56. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/tests/test_smoke.py +0 -0
  57. {microvms-0.2.0 → microvms-0.3.0}/microvms-py/tests/test_stubs.py +0 -0
  58. {microvms-0.2.0 → microvms-0.3.0}/protocol/README.md +0 -0
  59. {microvms-0.2.0 → microvms-0.3.0}/protocol/src/exec.rs +0 -0
  60. {microvms-0.2.0 → microvms-0.3.0}/protocol/src/fs.rs +0 -0
  61. {microvms-0.2.0 → microvms-0.3.0}/protocol/src/health.rs +0 -0
  62. {microvms-0.2.0 → microvms-0.3.0}/protocol/src/hook.rs +0 -0
  63. {microvms-0.2.0 → microvms-0.3.0}/protocol/src/lib.rs +0 -0
@@ -769,6 +769,16 @@ dependencies = [
769
769
  "syn 2.0.119",
770
770
  ]
771
771
 
772
+ [[package]]
773
+ name = "bstr"
774
+ version = "1.13.1"
775
+ source = "registry+https://github.com/rust-lang/crates.io-index"
776
+ checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f"
777
+ dependencies = [
778
+ "memchr",
779
+ "serde_core",
780
+ ]
781
+
772
782
  [[package]]
773
783
  name = "bumpalo"
774
784
  version = "3.20.3"
@@ -1560,6 +1570,19 @@ dependencies = [
1560
1570
  "wasm-bindgen",
1561
1571
  ]
1562
1572
 
1573
+ [[package]]
1574
+ name = "globset"
1575
+ version = "0.4.20"
1576
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1577
+ checksum = "07c34a9410465b45bd9787443bc7370f37735bad04b0f0cd57ff1a3186c98988"
1578
+ dependencies = [
1579
+ "aho-corasick",
1580
+ "bstr",
1581
+ "log",
1582
+ "regex-automata",
1583
+ "regex-syntax",
1584
+ ]
1585
+
1563
1586
  [[package]]
1564
1587
  name = "gloo-timers"
1565
1588
  version = "0.3.0"
@@ -2180,20 +2203,23 @@ dependencies = [
2180
2203
 
2181
2204
  [[package]]
2182
2205
  name = "microvms-cli"
2183
- version = "0.2.0"
2206
+ version = "0.3.0"
2184
2207
  dependencies = [
2185
2208
  "cargo_metadata",
2186
2209
  "clap",
2210
+ "globset",
2187
2211
  "microvms-core",
2188
2212
  "ratatui",
2189
2213
  "serde",
2190
2214
  "serde_json",
2215
+ "tar",
2191
2216
  "tokio",
2217
+ "toml",
2192
2218
  ]
2193
2219
 
2194
2220
  [[package]]
2195
2221
  name = "microvms-core"
2196
- version = "0.2.0"
2222
+ version = "0.3.0"
2197
2223
  dependencies = [
2198
2224
  "aws-config",
2199
2225
  "aws-credential-types",
@@ -2232,7 +2258,7 @@ dependencies = [
2232
2258
 
2233
2259
  [[package]]
2234
2260
  name = "microvms-protocol"
2235
- version = "0.2.0"
2261
+ version = "0.3.0"
2236
2262
  dependencies = [
2237
2263
  "schemars",
2238
2264
  "serde",
@@ -3555,6 +3581,15 @@ dependencies = [
3555
3581
  "serde_core",
3556
3582
  ]
3557
3583
 
3584
+ [[package]]
3585
+ name = "serde_spanned"
3586
+ version = "1.1.1"
3587
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3588
+ checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26"
3589
+ dependencies = [
3590
+ "serde_core",
3591
+ ]
3592
+
3558
3593
  [[package]]
3559
3594
  name = "serde_urlencoded"
3560
3595
  version = "0.7.1"
@@ -4106,6 +4141,21 @@ dependencies = [
4106
4141
  "tokio",
4107
4142
  ]
4108
4143
 
4144
+ [[package]]
4145
+ name = "toml"
4146
+ version = "1.1.4+spec-1.1.0"
4147
+ source = "registry+https://github.com/rust-lang/crates.io-index"
4148
+ checksum = "3aace63f4bbcdfc2c965b059de67119c89c4017a70d633be6c104910f67056f5"
4149
+ dependencies = [
4150
+ "indexmap",
4151
+ "serde_core",
4152
+ "serde_spanned",
4153
+ "toml_datetime",
4154
+ "toml_parser",
4155
+ "toml_writer",
4156
+ "winnow",
4157
+ ]
4158
+
4109
4159
  [[package]]
4110
4160
  name = "toml_datetime"
4111
4161
  version = "1.1.1+spec-1.1.0"
@@ -4136,6 +4186,12 @@ dependencies = [
4136
4186
  "winnow",
4137
4187
  ]
4138
4188
 
4189
+ [[package]]
4190
+ name = "toml_writer"
4191
+ version = "1.1.2+spec-1.1.0"
4192
+ source = "registry+https://github.com/rust-lang/crates.io-index"
4193
+ checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2"
4194
+
4139
4195
  [[package]]
4140
4196
  name = "tower"
4141
4197
  version = "0.5.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microvms
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: Programming Language :: Rust
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "microvms-core"
3
- version = "0.2.0"
3
+ version = "0.3.0"
4
4
  edition.workspace = true
5
5
  license.workspace = true
6
6
  repository.workspace = true
@@ -29,7 +29,7 @@ categories = ["api-bindings", "virtualization"]
29
29
  # alternative is a client that redefines `Phase`, `Outcome`, and the SSE event
30
30
  # payloads locally, which is precisely the drift the protocol crate was extracted to
31
31
  # make impossible. A field renamed in `protocol/` must break this crate's build.
32
- protocol = { package = "microvms-protocol", version = "0.2.0", path = "../protocol" }
32
+ protocol = { package = "microvms-protocol", version = "0.3.0", path = "../protocol" }
33
33
  # The error taxonomy's Display impls. 2.x rather than 1.x: `#[error]` on an enum
34
34
  # with `#[from]` is the same surface, and the 2.0 line is what receives fixes.
35
35
  thiserror = "2.0.19"
@@ -424,6 +424,13 @@ pub struct Sandbox {
424
424
  image: Option<Image>,
425
425
  microvm: Option<Microvm>,
426
426
  session: Option<Session>,
427
+ /// A backend for the session [`Sandbox::run`] builds, or `None` for the real HTTP one.
428
+ ///
429
+ /// The daemon-side sibling of `with_control_plane`'s transport seam: a test that
430
+ /// scripts the control plane can launch, but the session `run` then builds would dial
431
+ /// a real endpoint. This lets the same test script the daemon too. Never set in
432
+ /// production — `Session::builder` picks reqwest when no backend is given.
433
+ session_backend: Option<crate::session::SharedBackend>,
427
434
 
428
435
  // ── the symspec's five variables ─────────────────────────────────────────
429
436
  lifecycle: Lifecycle,
@@ -483,6 +490,7 @@ impl Sandbox {
483
490
  image: None,
484
491
  microvm: None,
485
492
  session: None,
493
+ session_backend: None,
486
494
  lifecycle: Lifecycle::Pending,
487
495
  token_installed: false,
488
496
  image_exists: false,
@@ -494,6 +502,16 @@ impl Sandbox {
494
502
  }
495
503
  }
496
504
 
505
+ /// Routes the session [`Sandbox::run`] builds through `backend` instead of real HTTP.
506
+ ///
507
+ /// The daemon-side half of the test seam `with_control_plane` opens: scripting the
508
+ /// control plane gets a test through the launch, and this gets it through everything
509
+ /// the launched session then does — uploads, execs, downloads — without a daemon.
510
+ pub fn with_session_backend(mut self, backend: crate::session::SharedBackend) -> Self {
511
+ self.session_backend = Some(backend);
512
+ self
513
+ }
514
+
497
515
  // ── the symspec's five variables, readable ───────────────────────────────
498
516
 
499
517
  /// The lifecycle state, which is the symspec's `vm_state`.
@@ -729,12 +747,13 @@ impl Sandbox {
729
747
  control: Arc::clone(&self.control),
730
748
  microvm_id: id,
731
749
  });
732
- self.session = Some(
733
- Session::builder(endpoint, agent_token)
734
- .with_minter(minter)
735
- .with_port(self.control.port())
736
- .build()?,
737
- );
750
+ let mut builder = Session::builder(endpoint, agent_token)
751
+ .with_minter(minter)
752
+ .with_port(self.control.port());
753
+ if let Some(backend) = &self.session_backend {
754
+ builder = builder.with_backend(Arc::clone(backend));
755
+ }
756
+ self.session = Some(builder.build()?);
738
757
  Ok(self.session.as_mut().expect("just assigned"))
739
758
  }
740
759
 
@@ -37,7 +37,9 @@ use std::sync::Arc;
37
37
  use std::time::Duration;
38
38
 
39
39
  pub use exec::{EndReason, ExecHandle, ExecResult, StreamEnd, StreamOptions, mint_exec_id};
40
- pub use http::{ChunkSource, HttpBackend, HttpRequest, HttpResponse, OpenStream, ReqwestBackend};
40
+ pub use http::{
41
+ ChunkSource, HttpBackend, HttpRequest, HttpResponse, OpenStream, ReqwestBackend, SharedBackend,
42
+ };
41
43
  pub use proxy::{
42
44
  Clock, DEFAULT_AGENT_PORT, DEFAULT_REFRESH_AFTER, MAX_TOKEN_LIFETIME, PROXY_AUTH_HEADER,
43
45
  PROXY_PORT_HEADER, ProxyAuth, ProxyToken, TokenMinter, TokioClock, WS_AUTH_SUBPROTOCOL_PREFIX,
@@ -24,13 +24,13 @@ crate-type = ["cdylib", "rlib"]
24
24
  # (BIND-1): a binding that depended on the CLI would be a binding whose surface
25
25
  # is whatever the CLI happened to expose, and the CLI is a consumer of this same
26
26
  # core rather than a layer above it.
27
- microvms-core = { version = "0.2.0", path = "../microvms-core" }
27
+ microvms-core = { version = "0.3.0", path = "../microvms-core" }
28
28
  # The wire types the session surface already answers with (`Health`, `Phase`,
29
29
  # `Outcome`, `ExitEvent`). Not a new dependency in substance: `microvms-core`'s
30
30
  # public signatures return these, so a binding that mapped them without naming
31
31
  # the crate would have to re-declare their fields — which is exactly the drift
32
32
  # `protocol` was extracted to make impossible (ARCH-2).
33
- protocol = { package = "microvms-protocol", version = "0.2.0", path = "../protocol" }
33
+ protocol = { package = "microvms-protocol", version = "0.3.0", path = "../protocol" }
34
34
  # No `extension-module` feature. It is deprecated, and enabling it disables
35
35
  # libpython linking for *every* target in the workspace, which breaks
36
36
  # `cargo test` and `cargo build -p microvms-py` with undefined `_PyExc_*`
@@ -1393,7 +1393,7 @@ def session_constants() -> dict:
1393
1393
  # `microvms_core::VERSION`, added by the module's `#[pymodule_init]`. The **core's**
1394
1394
  # version and not this crate's: what a caller needs to know is which client they are
1395
1395
  # talking through.
1396
- __version__: Final[str] = "0.2.0"
1396
+ __version__: Final[str] = "0.3.0"
1397
1397
 
1398
1398
  class MicrovmError(Exception):
1399
1399
  """
@@ -5,7 +5,7 @@
5
5
  # source files that name it: the rename is a manifest concern and does not reach
6
6
  # the code.
7
7
  name = "microvms-protocol"
8
- version = "0.2.0"
8
+ version = "0.3.0"
9
9
  edition.workspace = true
10
10
  license.workspace = true
11
11
  repository.workspace = true
@@ -10,7 +10,7 @@ build-backend = "maturin"
10
10
 
11
11
  [project]
12
12
  name = "microvms"
13
- version = "0.2.0"
13
+ version = "0.3.0"
14
14
  description = "Python bindings over microvms-core: the MicroVMs client with every trap closure"
15
15
  requires-python = ">=3.9"
16
16
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes