Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move boot script to cloud init #62

Closed
wants to merge 2 commits into from

Conversation

RamLavi
Copy link
Collaborator

@RamLavi RamLavi commented Mar 28, 2024

This PR moves the service introduced on customize-vm and run on every boot - to run under cloud-int service.
This reduces complexity and produces the same result.

@RamLavi RamLavi marked this pull request as draft March 28, 2024 13:20
RamLavi added 2 commits March 28, 2024 15:25
Currently the VM guests are configured on a service added on the
customize-vm script created in the image building process.
There is no real need for the script to run on that context, and it is
easier to manage if it runs as part of the cloud-init context.
This commits:
- copies the script to a checkup function.
- adds the boot script to the vmi-under-test VM
- mounts the script with the correct permissions.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
Currently the VM guests are configured on a service added on the
customize-vm script created in the image building process.
There is no real need for the script to run on that context, and it is
easier to manage if it runs as part of the cloud-init context.
This commits:
- Runs the boot script on the cloud-init context.
- Removes it from the images customize-vm scripts.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
@RamLavi RamLavi force-pushed the move_bootscript_cloudinit branch from 0095444 to f5f2818 Compare March 28, 2024 13:26
@RamLavi
Copy link
Collaborator Author

RamLavi commented Apr 1, 2024

CI fails because there is no mechanism to wait for the VMI to be ready now (RT kernel args are not updated when the test runs):

make e2e-test
mkdir -p /home/ralavi/go/src/github.com/kiagnose/kubevirt-realtime-checkup/_go-cache
podman run --rm \
	-v /home/ralavi/go/src/github.com/kiagnose/kubevirt-realtime-checkup:/go/src/github.com/kiagnose/kubevirt-realtime-checkup:Z \
	-v /home/ralavi/go/src/github.com/kiagnose/kubevirt-realtime-checkup/_go-cache:/root/.cache/go-build:Z \
	-v /home/ralavi/.kube/sno03-cnvqe2-rdu2:/root/.kube:Z,ro \
	--workdir /go/src/github.com/kiagnose/kubevirt-realtime-checkup \
	-e KUBECONFIG=/root/.kube/kubeconfig \
	-e TEST_NAMESPACE=realtime-checkup-1 \
	-e TEST_CHECKUP_IMAGE=quay.io/ramlavi/kubevirt-realtime-checkup:devel \
	-e VM_UNDER_TEST_CONTAINER_DISK_IMAGE=quay.io/ramlavi/kubevirt-realtime-checkup-vm:latest \
	docker.io/library/golang:1.20.12 \
	go test -v ./tests/... -test.v -test.timeout=1h -ginkgo.v -ginkgo.timeout=1h 
=== RUN   TestTests
Running Suite: Tests Suite - /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests
========================================================================================
Random Seed: 1711872064

Will run 1 of 1 specs
------------------------------
[BeforeSuite] 
/go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests/tests_suite_test.go:39
[BeforeSuite] PASSED [0.002 seconds]
------------------------------
Checkup execution should complete successfully
/go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests/checkup_test.go:80
  [FAILED] in [It] - /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests/checkup_test.go:90 @ 03/31/24 08:13:33.539
• [FAILED] [750.513 seconds]
Checkup execution [It] should complete successfully
/go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests/checkup_test.go:80

  [FAILED] checkup failed: {
  	"spec.param.oslatDuration": "10m",
  	"spec.param.oslatLatencyThresholdMicroSeconds": "45",
  	"spec.param.vmUnderTestContainerDiskImage": "quay.io/ramlavi/kubevirt-realtime-checkup-vm:latest",
  	"spec.param.vmUnderTestTargetNodeName": "",
  	"spec.timeout": "15m",
  	"status.completionTimestamp": "2024-03-31T08:13:24Z",
  	"status.failureReason": "oslat Max Latency measured 50.04ms exceeded the given threshold 45µs",
  	"status.result.oslatMaxLatencyMicroSeconds": "50040",
  	"status.result.vmUnderTestActualNodeName": "cnv-qe-infra-28.cnvqe2.lab.eng.rdu2.redhat.com",
  	"status.startTimestamp": "2024-03-31T08:01:08Z",
  	"status.succeeded": "false"
  }
  In [It] at: /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests/checkup_test.go:90 @ 03/31/24 08:13:33.539
------------------------------

Summarizing 1 Failure:
  [FAIL] Checkup execution [It] should complete successfully
  /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests/checkup_test.go:90

Ran 1 of 1 Specs in 750.515 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 0 Skipped
--- FAIL: TestTests (750.52s)
FAIL
FAIL	github.com/kiagnose/kubevirt-realtime-checkup/tests	750.523s
FAIL
make: *** [Makefile:70: e2e-test] Error 1

This will be fixed on the following PR.

@RamLavi RamLavi marked this pull request as ready for review April 1, 2024 12:25
Copy link
Member

@orelmisan orelmisan left a comment

Choose a reason for hiding this comment

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

I approve the PR before seeing that it failed.
Please re-add the commits that introduce the readiness probe.

@RamLavi RamLavi mentioned this pull request Apr 1, 2024
@RamLavi
Copy link
Collaborator Author

RamLavi commented Apr 1, 2024

I approve the PR before seeing that it failed. Please re-add the commits that introduce the readiness probe.

closing in favor of #63 that will hold all commits above and the probe ones

@RamLavi RamLavi closed this Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants