Skip to content
Closed
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
19 changes: 18 additions & 1 deletion internal/kuberesource/resourcegen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,24 @@ func main() {
case "vault":
subResources = kuberesource.PatchRuntimeHandlers(kuberesource.Vault(*namespace), "contrast-cc")
case "gpu":
subResources = kuberesource.PatchRuntimeHandlers(kuberesource.GPU("placeholder-gpu"), "contrast-cc")
if *rawPlatform == "" {
log.Fatalf("--platform must be set to one of %v", platforms.AllStrings())
}
var platform platforms.Platform
platform, err = platforms.FromString(*rawPlatform)
if err != nil {
log.Fatalf("Error parsing platform: %v", err)
}
var deviceURI string
switch platform {
case platforms.MetalQEMUTDXGPU:
deviceURI = "nvidia.com/GB100_B200"
case platforms.MetalQEMUSNPGPU:
deviceURI = "nvidia.com/GH100_H100_PCIE"
Comment on lines +81 to +84
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still believe that this is not the right place to configure this. Rather, this should be modelled similar to the tcb-specs.json and be an input to resourcegen.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would that work with the just targets? Not saying that it isn't possible, I just wonder what the dataflow would look like.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not ideal, we could configure this with a justfile.env var for now, since we're already doing it for the nodeinstaller target config:

contrast/justfile

Lines 338 to 339 in fb4de83

sed -i 's/^default_platform=.*/default_platform="Metal-QEMU-TDX"/' justfile.env
sed -i 's/^node_installer_target_conf_type=.*/node_installer_target_conf_type="k3s"/' justfile.env

Eventually, I'd prefer this to be configured in the cluster instead of in the repo, though.

default:
log.Fatalf("platform %s does not support GPU deployments", platform)
}
subResources = kuberesource.PatchRuntimeHandlers(kuberesource.GPU(deviceURI), "contrast-cc")
default:
log.Fatalf("Error: unknown set: %s\n", set)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/by-name/OVMF-TDX/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
edk2,
nasm,
acpica-tools,
verifyACPIInsecure ? false,
withACPIVerificationInsecure ? false,
debug ? false,
}:

Expand Down Expand Up @@ -35,7 +35,7 @@ edk2.mkDerivation "OvmfPkg/IntelTdx/IntelTdxX64.dsc" {
# handoff table wasn't measured before.
./0002-SmbiosMeasurementDxe-filter-handoff-table.patch
]
++ lib.optionals verifyACPIInsecure [
++ lib.optionals withACPIVerificationInsecure [
# Skip the measurement of the guest-memory and device-dependent ACPI tables and verify
# them in the measured firmware instead.
./0003-QemuFwCfgAcpi-verify-ACPI-data-instead-of-measuring.patch
Expand Down
2 changes: 1 addition & 1 deletion packages/by-name/contrast/contrast/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ let
ovmf = OVMF-TDX.override {
# Only enable ACPI verification for the GPU build, until
# the verification is actually secure.
verifyACPIInsecure = true;
withACPIVerificationInsecure = true;
};
withGPU = true;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let
# Hardcode this to the B200 for now, since we only have a testing system with this GPU.
# When we get more heterogenous test systems, or when TDX-GPU goes into production use,
# this needs to be made configurable.
gpuFlag = if withGPU then "-g b200" else "";
gpuFlag = lib.optionalString withGPU "-g b200";
in

stdenvNoCC.mkDerivation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let
ovmf = OVMF-TDX.override {
# Only enable ACPI verification for the GPU build, until
# the verification is actually secure.
verifyACPIInsecure = withGPU;
withACPIVerificationInsecure = withGPU;
};

node-installer = ociLayerTar {
Expand Down
Loading