Skip to content

Commit bf2c816

Browse files
ppennaCopilot
andcommitted
guest: delete the Alpine one-shot container helpers
SL7.8b deleted the old layered init, whose container launcher was the only caller of the Alpine one-shot container helpers: nvx-container-launch ran a workload's container through nvx-container-enter, which staged Alpine's musl loader and setpriv in the container's root. The shell /init now runs only nvx-init for a layered root, or the managed agent with its own root, so nothing runs them any more. Delete guest/alpine/nvx-container-enter and nvx-container-launch, and so guest/alpine, which held nothing else, with every inventory that names them or the directory: - build.py no longer installs them in the Alpine initramfs, nor lists guest/alpine among the Alpine guest's customization files; - the Alpine guest's source directories are guest/common alone, as Azure Linux's are, in build_constants.py and in the guest_sources of SOURCE-MANIFEST.json, which release.py checks against them; - release.py's source-tree check no longer requires the entry helper; - the Alpine artifacts' CI cache key no longer hashes guest/alpine; - check-quality's ShellCheck and shfmt lists, and their copies in the setup guide, no longer name them; - the project structure no longer describes guest/alpine, nor, since SL7.8b deleted the init agent, an agent among guest/common's scripts. Tests: the fixture manifest of test_nvx_tools.py's release tests drops guest/alpine from the Alpine guest_sources, and the CI change-detection test drops its case of guest/alpine/nvx-container-enter, a deleted file; its guest/common/init case still covers the guests' inputs. Part of #1123 (SL7.8c). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8ae0617 commit bf2c816

11 files changed

Lines changed: 11 additions & 156 deletions

File tree

‎.github/actions/build-guest-artifacts/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ runs:
136136
AZURELINUX_VERSION: ${{ steps.guest-versions.outputs.azurelinux-version }}
137137
KERNEL_INPUT_HASH: ${{ hashFiles('SOURCE-MANIFEST.json', 'kernel/config-microvm', 'kernel/config-microvm.derived', 'kernel/patches/**', 'docker/Dockerfile', '.dockerignore', 'scripts/nvx_tools/build.py', 'scripts/nvx_tools/build_config.py', 'scripts/nvx_tools/build_constants.py', 'scripts/nvx_tools/kconfig.py', 'scripts/nvx_tools/kernel_config.py', 'scripts/nvx_tools/kernel_features.py') }}
138138
DEBUG_KERNEL_INPUT_HASH: ${{ hashFiles('SOURCE-MANIFEST.json', 'kernel/config-microvm', 'kernel/config-microvm-debug', 'kernel/patches/**', 'docker/Dockerfile', '.dockerignore', 'scripts/nvx_tools/build.py', 'scripts/nvx_tools/build_config.py', 'scripts/nvx_tools/build_constants.py', 'scripts/nvx_tools/kconfig.py', 'scripts/nvx_tools/kernel_config.py', 'scripts/nvx_tools/kernel_features.py') }}
139-
ALPINE_INPUT_HASH: ${{ hashFiles('SOURCE-MANIFEST.json', 'guest/common/**', 'guest/alpine/**', 'docker/Dockerfile', '.dockerignore', 'scripts/nvx_tools/build.py', 'scripts/nvx_tools/build_config.py', 'scripts/nvx_tools/build_constants.py', 'scripts/nvx_tools/common.py', 'scripts/nvx_tools/elf.py', 'scripts/nvx_tools/guest_binaries.py', 'scripts/nvx_tools/guests.py') }}
139+
ALPINE_INPUT_HASH: ${{ hashFiles('SOURCE-MANIFEST.json', 'guest/common/**', 'docker/Dockerfile', '.dockerignore', 'scripts/nvx_tools/build.py', 'scripts/nvx_tools/build_config.py', 'scripts/nvx_tools/build_constants.py', 'scripts/nvx_tools/common.py', 'scripts/nvx_tools/elf.py', 'scripts/nvx_tools/guest_binaries.py', 'scripts/nvx_tools/guests.py') }}
140140
UBUNTU_INPUT_HASH: ${{ hashFiles('SOURCE-MANIFEST.json', 'guest/common/**', 'guest/ubuntu/**', 'ubuntu/**', 'docker/Dockerfile', '.dockerignore', 'scripts/nvx_tools/build.py', 'scripts/nvx_tools/build_config.py', 'scripts/nvx_tools/build_constants.py', 'scripts/nvx_tools/common.py', 'scripts/nvx_tools/elf.py', 'scripts/nvx_tools/guest_binaries.py', 'scripts/nvx_tools/guests.py', 'scripts/nvx_tools/ubuntu.py') }}
141141
AZURELINUX_INPUT_HASH: ${{ hashFiles('SOURCE-MANIFEST.json', 'guest/common/**', 'azurelinux/**', 'docker/Dockerfile', '.dockerignore', 'scripts/nvx_tools/azurelinux.py', 'scripts/nvx_tools/build.py', 'scripts/nvx_tools/build_config.py', 'scripts/nvx_tools/build_constants.py', 'scripts/nvx_tools/common.py', 'scripts/nvx_tools/elf.py', 'scripts/nvx_tools/guest_binaries.py', 'scripts/nvx_tools/guests.py') }}
142142
run: |

‎.github/actions/check-quality/action.yml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ runs:
4040
python -m ruff check scripts .github/specula
4141
python -m compileall -q .github/specula
4242
${SHELLCHECK} --shell=sh \
43-
guest/common/init guest/alpine/nvx-container-enter \
44-
guest/alpine/nvx-container-launch \
43+
guest/common/init \
4544
guest/common/nvx-hostmount guest/common/nvx-identity-probe \
4645
guest/common/nvx-sandbox-smoke guest/common/nvx-snapshot \
4746
guest/common/nvx-virtio-restore-probe \
@@ -53,8 +52,7 @@ runs:
5352
python -m pyright --pythonplatform Windows
5453
python -m ruff format --check scripts .github/specula
5554
${SHFMT} -d -ln posix -i 4 -ci \
56-
guest/common/init guest/alpine/nvx-container-enter \
57-
guest/alpine/nvx-container-launch \
55+
guest/common/init \
5856
guest/common/nvx-hostmount guest/common/nvx-identity-probe \
5957
guest/common/nvx-sandbox-smoke guest/common/nvx-snapshot \
6058
guest/common/nvx-virtio-restore-probe \

‎SOURCE-MANIFEST.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"minirootfs_sha256": "41f73e3cf5fa919b8aa5ca6b30dc48f0da2720776d7423e2a7748211456fe081",
3939
"guest_sources": [
4040
"guest/common",
41-
"guest/alpine",
4241
"nvx-rs",
4342
"rust-toolchain.toml"
4443
],

‎doc/project-structure.md‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ nvx/
5757
| `-- copilot-instructions.md Repository-wide Copilot instructions
5858
|-- .vscode/settings.json Shared VS Code settings
5959
|-- guest/ Guest-owned scripts
60-
| |-- common/ Shared init, agent, snapshot, and probe scripts
61-
| |-- alpine/ Alpine-control container entry scripts
60+
| |-- common/ Shared init, snapshot, and probe scripts
6261
| `-- ubuntu/ Ubuntu interactive-shell startup policy
6362
|-- ubuntu/
6463
| `-- packages.lock.json Exact supplemental Ubuntu binary package closure
@@ -234,10 +233,7 @@ starts an initramfs program named by `nvx_exec=`, `nvx-init` for a layered root,
234233
workload named by `nvx_entrypoint=`, a virtio restore probe for benchmark
235234
profiling, or the interactive shell. On an interactive boot, `init` prints a
236235
stable distribution boot marker for Alpine and Azure Linux, and
237-
`guest/ubuntu/nvx-bashrc` prints Ubuntu's. `guest/alpine` contains
238-
the container launch and entry scripts that only the Alpine initramfs installs;
239-
the entry script stages Alpine's musl loader and `setpriv` inside the
240-
workload's root.
236+
`guest/ubuntu/nvx-bashrc` prints Ubuntu's.
241237

242238
The remaining common helpers handle shutdown, virtio-fs mounting, snapshot
243239
preparation, and the guest side of the time ABI. The Rust guest binaries

‎doc/setup.md‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ Run all lint and formatting checks before submitting a change:
216216
```bash
217217
python3 -m ruff check scripts .github/specula
218218
shellcheck --shell=sh \
219-
guest/common/init guest/alpine/nvx-container-enter \
220-
guest/alpine/nvx-container-launch \
219+
guest/common/init \
221220
guest/common/nvx-hostmount guest/common/nvx-identity-probe \
222221
guest/common/nvx-sandbox-smoke \
223222
guest/common/nvx-snapshot guest/common/nvx-virtio-restore-probe \
@@ -228,8 +227,7 @@ python3 -m pyright --pythonplatform Linux
228227
python3 -m pyright --pythonplatform Windows
229228
python3 -m ruff format --check scripts .github/specula
230229
shfmt -d -ln posix -i 4 -ci \
231-
guest/common/init guest/alpine/nvx-container-enter \
232-
guest/alpine/nvx-container-launch \
230+
guest/common/init \
233231
guest/common/nvx-hostmount guest/common/nvx-identity-probe \
234232
guest/common/nvx-sandbox-smoke \
235233
guest/common/nvx-snapshot guest/common/nvx-virtio-restore-probe \
@@ -273,8 +271,7 @@ Apply the configured Python and POSIX shell formatters with:
273271
```bash
274272
python3 -m ruff format scripts .github/specula
275273
shfmt -w -ln posix -i 4 -ci \
276-
guest/common/init guest/alpine/nvx-container-enter \
277-
guest/alpine/nvx-container-launch \
274+
guest/common/init \
278275
guest/common/nvx-hostmount guest/common/nvx-identity-probe \
279276
guest/common/nvx-sandbox-smoke \
280277
guest/common/nvx-snapshot guest/common/nvx-virtio-restore-probe \

‎guest/alpine/nvx-container-enter‎

Lines changed: 0 additions & 83 deletions
This file was deleted.

‎guest/alpine/nvx-container-launch‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎scripts/nvx_tools/build.py‎

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -792,23 +792,7 @@ def _install_guest_files(
792792
root / "sbin" / "nvx-virtio-restore-probe",
793793
),
794794
]
795-
if descriptor.sandbox_control:
796-
alpine = BuildConstants.REPO_ROOT / AlpineBuildConstants.GUEST_DIRECTORY
797-
scripts.extend(
798-
[
799-
(
800-
"nvx-container-enter",
801-
alpine / "nvx-container-enter",
802-
root / "sbin" / "nvx-container-enter",
803-
),
804-
(
805-
"nvx-container-launch",
806-
alpine / "nvx-container-launch",
807-
root / "sbin" / "nvx-container-launch",
808-
),
809-
]
810-
)
811-
else:
795+
if not descriptor.sandbox_control:
812796
scripts.append(
813797
(
814798
"nvx-bashrc",
@@ -889,14 +873,7 @@ def _guest_customization_files(descriptor: GuestDescriptor) -> tuple[Path, ...]:
889873
)
890874
if path.is_file()
891875
)
892-
alpine = tuple(
893-
path
894-
for path in sorted(
895-
(BuildConstants.REPO_ROOT / AlpineBuildConstants.GUEST_DIRECTORY).iterdir()
896-
)
897-
if path.is_file()
898-
)
899-
return (*common, *alpine, *guest_binary_source_files())
876+
return (*common, *guest_binary_source_files())
900877

901878

902879
def build_initramfs(config: InitramfsBuildConfig) -> None:

‎scripts/nvx_tools/build_constants.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,7 @@ class GuestRustBuildConstants:
200200

201201
class AlpineBuildConstants:
202202
GUEST_NAME: Final = "alpine"
203-
GUEST_DIRECTORY: Final = Path("guest") / GUEST_NAME
204-
GUEST_SOURCE_DIRECTORIES: Final = (
205-
BuildConstants.COMMON_GUEST_DIRECTORY,
206-
GUEST_DIRECTORY,
207-
)
203+
GUEST_SOURCE_DIRECTORIES: Final = (BuildConstants.COMMON_GUEST_DIRECTORY,)
208204
DISTRIBUTION: Final = "Alpine Linux"
209205
VERSION: Final = "3.24.1"
210206
BRANCH: Final = "v3.24"

‎scripts/nvx_tools/release.py‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,10 +1643,6 @@ def verify_source_tree() -> None:
16431643
/ "0002-microvm-hvc-xe9.patch": "xe9 HVC patch",
16441644
BuildConstants.REPO_ROOT / "kernel" / "COPYING-LINUX": "Linux copyright notice",
16451645
BuildConstants.REPO_ROOT / "guest" / "common" / "init": "common guest init",
1646-
BuildConstants.REPO_ROOT
1647-
/ "guest"
1648-
/ "alpine"
1649-
/ "nvx-container-enter": "Alpine sandbox container helper",
16501646
UbuntuBuildConstants.PACKAGE_LOCK: "Ubuntu supplemental package lock",
16511647
OpenVMMBuildConstants.DIRECTORY / "Cargo.toml": "initialized OpenVMM submodule",
16521648
}

0 commit comments

Comments
 (0)