Add OCI Windows machine images - #429
Conversation
65c40f2 to
dd4f0b7
Compare
| test -r /ci/windows/base.raw | ||
| test -r /ci/windows/persona.qcow2 | ||
| qemu-img info --output=json /ci/windows/persona.qcow2 \ | ||
| | jq -e '.format == "qcow2" and .["backing-filename-format"] == "raw"' >/dev/null |
There was a problem hiding this comment.
double check for potential concurrency in test running issues
| @@ -0,0 +1,21 @@ | |||
| # Windows machine images | |||
There was a problem hiding this comment.
user facing style docs can go where this is, and internal "how it works but not the structure of the code" goes in lib/**/README.md, that's more like the context for why things work as they do
|
|
||
| const ( | ||
| MachineImageWindowsBase MachineImageKind = "windows-base" | ||
| MachineImageWindowsPersona MachineImageKind = "windows-persona" |
There was a problem hiding this comment.
I'm unsure about codifying the "persona" word. is there naming here that might make more sense...? let's discuss
| return format | ||
| } | ||
|
|
||
| func (m *manager) materializeMachineImage(ref *ResolvedRef, root string, machine *MachineImage) (int64, error) { |
There was a problem hiding this comment.
I need the right lib/**/README.md to explain the processing and when it happens and why etc
| return image | ||
| } | ||
|
|
||
| func TestMachineArtifactsPullFromOCI(t *testing.T) { |
There was a problem hiding this comment.
double check for non-conflicting between concurrent test runs on the same server
| if windows { | ||
| size = 8 * 1024 * 1024 * 1024 | ||
| } else { | ||
| size = 1 * 1024 * 1024 * 1024 // 1GB default |
There was a problem hiding this comment.
explain why defaults are different
| if windows { | ||
| vcpus = 4 | ||
| } else { | ||
| vcpus = 2 | ||
| } |
| Cmd: req.Cmd, | ||
| SkipKernelHeaders: req.SkipKernelHeaders, | ||
| SkipGuestAgent: req.SkipGuestAgent, | ||
| SkipGuestAgent: req.SkipGuestAgent || windows, |
There was a problem hiding this comment.
this is temporary right? because guest agent in subsequent pr
dd4f0b7 to
a6c00b9
Compare
| if req.HotplugSize != 0 { | ||
| return fmt.Errorf("%w: Windows instances do not yet support hotplug memory", ErrInvalidRequest) | ||
| } |
There was a problem hiding this comment.
should we use Capabilities pattern for some of these situations?
summary
tests
go test -run 'TestMaterializeRejectsExternalDiskReferences|TestMaterializeWindowsBaseFormats|TestMaterializeWindowsPersona|TestValidateWindows|TestRejectWindowsSnapshotLifecycle' -v ./lib/images ./lib/instanceson deftCI=true HYPEMAN_WINDOWS_TEST_BASE=/ci/windows/base.raw HYPEMAN_WINDOWS_TEST_PERSONA=/ci/windows/persona.qcow2 go test -run TestMachineArtifactsPullFromOCI -v -timeout 20m ./lib/imageson deftCI=true HYPEMAN_WINDOWS_TEST_PERSONA=/ci/windows/persona.qcow2 go test -run 'TestWindowsImagesIntegration|TestQEMUStandbyAndRestore' -v -timeout 20m ./lib/instanceson deftnotes
Initializinguntil guest-agent readiness lands in the next phase.