Commit 6ab675b
authored
Add custom guest-components build support (#12)
* Add custom guest-components build support
- Add gc_builder stage to Dockerfile.podvm_binaries.ubuntu that compiles
attestation-agent and api-server-rest from a configurable guest-components
Git repo/ref when AA_FEATURES or GUEST_COMPONENTS_REF are set.
- Extend Makefile with AA_FEATURES, GUEST_COMPONENTS_REPO, and
GUEST_COMPONENTS_REF variables to pass custom build parameters.
- Add /run tmpfs mount (80% RAM) to fstab for container image layers.
* Configure kata-agent to read policy from /run/peerpod/policy.rego
Without an explicit policy_file, kata-agent falls back to
/etc/kata-opa/default-policy.rego and ignores the initdata-provided
policy written by process-user-data. The tmpfiles rule already seeds
/run/peerpod/policy.rego with allow-all.rego at boot, and
process-user-data overwrites it when cc_init_data is present.
Made-with: Cursor
* Revert "Configure kata-agent to read policy from /run/peerpod/policy.rego"
This reverts commit 0a4d980.
* Refine mkosi.postinst for systemd unit management
- Corrected the quoting issue in rm commands for legacy mount units to ensure proper deletion.
- Added symlinks to mask unwanted systemd units that could affect vTPM measurements, enhancing security and predictability during VM boot.
This update improves the handling of systemd services related to PCR measurements and ensures a cleaner environment for the container runtime.
* Refactor custom guest-components build to use CUSTOM_GC_BINARIES
Replace hardcoded per-binary build logic with a generic
build-guest-components.sh script driven by a comma-separated
CUSTOM_GC_BINARIES variable. Adding new components (e.g.
confidential-data-hub) now requires only a new case in the
script, with no Dockerfile or Makefile changes.
Made-with: Cursor
* Fix quoting in mkosi.postinst for systemd unit removal
Corrected the escaping of backslashes in rm commands for legacy mount units to ensure proper deletion. This change enhances the reliability of the post-installation script by preventing potential issues with file removal during VM setup.
* Update Dockerfile.mkosi.ubuntu for Ubuntu 24.10 and adjust mkosi.postinst for TDX RTMR support
- Changed base image to Ubuntu 24.10, which includes systemd 256 EFI stub with TDX RTMR support.
- Updated apt sources to redirect to old-releases mirror due to the EOL status of Ubuntu 24.10.
- Clarified comments in mkosi.postinst regarding TDX RTMR support for systemd unit management.
* Enhance build scripts and Dockerfile for guest components
- Updated build-guest-components.sh to include the --locked flag for cargo builds, ensuring consistent dependency resolution.
- Added error handling in Dockerfile.podvm_binaries.ubuntu to require GUEST_COMPONENTS_REF when CUSTOM_GC_BINARIES is specified.
- Clarified Makefile with comments indicating the necessity of GUEST_COMPONENTS_REF when using custom binaries.
* Fix Dockerfile.podvm_binaries.ubuntu to ensure successful installation of binaries by appending 'true' to the loop command, preventing build failures due to non-zero exit codes from the install command.1 parent 88ba523 commit 6ab675b
6 files changed
Lines changed: 133 additions & 4 deletions
File tree
- src/cloud-api-adaptor
- podvm-mkosi
- mkosi.skeleton/etc
- podvm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
18 | 35 | | |
19 | 36 | | |
20 | 37 | | |
| |||
78 | 95 | | |
79 | 96 | | |
80 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
8 | 40 | | |
9 | 41 | | |
10 | 42 | | |
| |||
108 | 140 | | |
109 | 141 | | |
110 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
111 | 149 | | |
112 | 150 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
0 commit comments