You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b107c09
Browse filesBrowse the repository at this point in the historyBrowse files
sandbox: record the network's options and build its policy at each start
The sandbox's network was `host::sandbox::SandboxNetwork`, one of the
old config types: `sandbox_network` returned it, the launch carried it,
and `config.json` stored it in the serde form of the old plan's network,
from which `start` read it back. `nvx-rs run` and `start` converted it
into the `NetworkConfig` of `host::config` that their VMs take.
`sandbox_network` now returns that `NetworkConfig`, after the checks
that `SandboxNetwork::new` made: the guest network, and that OpenVMM's
options can express the policy, with `host::network::openvmm_arguments`.
The configuration records the CLI's own network options in place of the
policy, as a `NetworkRecord`: `--net`, `--network-egress`,
`--network-ingress`, `--host-loopback`, `--network-proxy` and the
`--host-loopback-forward` options as given, and the egress rules in
OpenVMM's form, as the rule options gave them or a policy file compiled
them, so that no start reads that file again. Each start, and the
configuration that `sandbox run` writes and reads back, rebuilds the
options with the parser's own receiver and builds the network from them
with `sandbox_network`, as provision did. `provision` and `sandbox run`
pass the record in `ProvisionConfig`, beside the other options that
provision records. The checks of the network, their order and their
messages do not change. The record requires every field, an option
that was not given as `null`, and `Config::new` builds the network as
it reads the record, so a record whose options the parser or
`sandbox_network` refuses fails as `sandbox configuration is
malformed` when read, as the old plan's network did.
The record changes form, so the configuration moves to format 10.
Nothing in this workstream is deployed, so format 9 is refused rather
than migrated, as format 8 was, and the refusal of an unsupported format
now also says to deprovision the sandbox and provision it again.
This is the second step of SL3.10b, whose split was approved once its
measured scope came to about ten times its estimate: SL3.10d moves the
launch off `SandboxLaunch`, `SandboxSettings` and `SandboxUpper`.
Tests: the CLI's lifecycle cases of a network with a policy file, host
loopback and forwards, and of a proxy-only network, check the new
record, and their starts still launch OpenVMM with the same network
options; `old_configuration_formats_are_refused_without_migration`
refuses a format-9 configuration with the advice, which it lacked
before; the format checks of `malformed_configuration`,
`configurations_of_every_format_start_and_exec` and the
`sandbox-ram-upper` scenario take format 10, as does the fake `nvx-rs`
of that scenario's tests, whose old format is now 9, and that of the
`sandbox-gpt-layer` scenario's tests;
`malformed_configuration` also refuses network records without a
field, of a gateway address, with another egress or with a broken rule
as malformed, all of which the record would otherwise read or refuse
later; and the restore test of `run`'s network options takes the
`NetworkConfig` directly. The case matrix's row of the
`sandbox-ram-upper` scenario says that it checks format 10.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: doc/acceptance-case-matrix.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -340,7 +340,7 @@ suite in its shards, and the public sandbox scenarios in its guest and sandbox j
340
340
|`sandbox-gpt-layer`| kept | The [cold cells](#cold-boots) of a GPT disk, over a scratch upper and over a RAM upper, through `run`, and `provision` and `start`|
341
341
|`sandbox-lifecycle`| kept | A [cold cell](#cold-boots): the EROFS layer over a scratch upper, through `provision` and `start`, which also reattach to the VM from a new process for each command |
342
342
|`sandbox-proxy-only`| kept | Its proxy-only network, over the EROFS layer and a scratch upper; it is no [cold cell](#cold-boots) of its own |
343
-
|`sandbox-ram-upper`| kept | A [cold cell](#cold-boots): the EROFS layer over a RAM upper, through `run`, and `provision` and `start`|
343
+
|`sandbox-ram-upper`| kept | A [cold cell](#cold-boots): the EROFS layer over a RAM upper, through `run`, and `provision` and `start`. Since SL3.10c, it checks that `provision` records the configuration's format 10|
344
344
|`scratch-snapshot`| kept ||
345
345
|`smp`| kept ||
346
346
|`smp-lapic`| kept | Runs only when a run names it |
Copy file name to clipboardExpand all lines: nvx-rs/README.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2879,15 +2879,16 @@ The state directory is the directory of the sandbox's
2879
2879
sandbox shares, and `config.json` is the CLI's own record beside them. It also
2880
2880
records the [distro binding](#distro-bindings) and the
2881
2881
[scratch binding](#checked-handoff) of the sandbox, and its network as the
2882
-
typed `SandboxNetwork`, in the serde form of the plan's network. The typed
2883
-
configuration names one EROFS or GPT image by path and identity, and a scratch
2884
-
upper by path or a RAM upper with its cap from 1 through 90 percent, 50 by
2885
-
default. `nvx-rs` refuses earlier configuration formats rather than migrating
2886
-
them:
2882
+
network options from which each `start` builds the policy again, as `provision`
2883
+
built it. The typed configuration names one EROFS or GPT image by path and
2884
+
identity, and a scratch upper by path or a RAM upper with its cap from 1 through
2885
+
90 percent, 50 by default. `nvx-rs` refuses earlier configuration formats, such
2886
+
as format 9, rather than migrating them, and says to deprovision the sandbox and
2887
+
provision it again:
2887
2888
2888
2889
| File | Contents |
2889
2890
| --- | --- |
2890
-
|`config.json`| The provisioned sandbox, in format 9 only: `image` holds its format, path and identity; `upper` is tagged as scratch with its path or RAM with `max_memory_percent`. `distro_binding` binds the image, and `scratch_binding` binds scratch or is `null` for RAM. The export and network are typed, `null` when absent. A sandbox that `snapshot restore` provisioned also records its snapshot's name under `source_snapshot`, the absolute path of the snapshot's store under `source_store`, and the program and arguments of the workload that each restore runs under `workload`; one that boots cold records none of them. An atomic pretty-JSON write uses mode 0600, and start reads the same strict typed fields without a legacy reader. |
2891
+
| `config.json` | The provisioned sandbox, in format 10 only: `image` holds its format, path and identity; `upper` is tagged as scratch with its path or RAM with `max_memory_percent`. `distro_binding` binds the image, and `scratch_binding` binds scratch or is `null` for RAM. The export is typed, `null` when absent. `network`, `null` without `--net`, holds `--net`, `--network-egress`, `--network-ingress`, `--host-loopback`, `--network-proxy`, each `null` when not given, and the `--host-loopback-forward` options, as given, with the egress rules in OpenVMM's form, from a policy file's compile if one was given. A sandbox that `snapshot restore` provisioned also records its snapshot's name under `source_snapshot`, the absolute path of the snapshot's store under `source_store`, and the program and arguments of the workload that each restore runs under `workload`; one that boots cold records none of them. An atomic pretty-JSON write uses mode 0600, and start reads the same strict typed fields without a legacy reader. |
2891
2892
|`sandbox.lock`| The store's lock, which serializes the lifecycle transitions |
2892
2893
|`exec.lock`| The exec lock, which an `exec` holds from before it finds the running VM until its workload ends, so that one `exec` at a time runs in the sandbox; it stays from the first `exec` until `deprovision`|
2893
2894
|`launch.json`| The store's journal of a start in progress, or of one that was interrupted |
0 commit comments