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

vmi-under-test: Log in to serial console #40

Merged
merged 7 commits into from
Dec 12, 2023
Merged

Conversation

RamLavi
Copy link
Collaborator

@RamLavi RamLavi commented Dec 3, 2023

Try to log in to the VMI serial console, in order to perform the necessary commands required to perform the checkup.

The console code is based Kiagnose/kubevirt-dpdk-checkup's console package [0]

[0] https://github.com/kiagnose/kubevirt-dpdk-checkup/tree/614adcb89fab7518d8c8a513c61dab99e1a8fd2b/pkg/internal/checkup/executor/console

@RamLavi
Copy link
Collaborator Author

RamLavi commented Dec 3, 2023

getting error:

2023/12/03 09:15:08 kubevirt-realtime-checkup failed: admission webhook "virtualmachineinstances-create-validator.kubevirt.io" denied the request: spec.domain.memory.hugepages must be requested when NUMA topology strategy is set in spec.domain.cpu.numa.guestMappingPassthrough

@RamLavi RamLavi force-pushed the login branch 2 times, most recently from 8fd9ad1 to 1c13882 Compare December 4, 2023 09:08
@RamLavi RamLavi requested a review from orelmisan December 4, 2023 09:10
@RamLavi
Copy link
Collaborator Author

RamLavi commented Dec 4, 2023

Passed on CNV4.14 cluster:

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/kiagnose/kubevirt-realtime-checkup-vm:main \
	docker.io/library/golang:1.19.4-bullseye \
	go test -v ./tests/...
=== RUN   TestTests
Running Suite: Tests Suite - /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests
========================================================================================
Random Seed: 1701680940

Will run 1 of 1 specs
•

Ran 1 of 1 Specs in 101.987 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestTests (101.99s)
PASS
ok  	github.com/kiagnose/kubevirt-realtime-checkup/tests	101.999s

checkup logs:

$ oc logs -f job/rt-checkup
2023/12/04 09:09:07 kubevirt-realtime-checkup starting...
2023/12/04 09:09:07 Using the following config:
2023/12/04 09:09:07 	"vmUnderTestTargetNodeName": ""
2023/12/04 09:09:07 	"vmUnderTestContainerDiskImage": "quay.io/kiagnose/kubevirt-realtime-checkup-vm:main"
2023/12/04 09:09:07 	"oslatDuration": "10m0s"
2023/12/04 09:09:07 	"oslatLatencyThresholdMicroSeconds": "45µs"
2023/12/04 09:09:07 Waiting for VMI "realtime-checkup-1/rt-vmi-9jm2s" to boot...
2023/12/04 09:10:08 VMI "realtime-checkup-1/rt-vmi-9jm2s" had successfully booted
2023/12/04 09:10:08 Login to VMI under test...
2023/12/04 09:10:31 Trying to delete VMI: "realtime-checkup-1/rt-vmi-9jm2s"
2023/12/04 09:10:31 Waiting for VMI "realtime-checkup-1/rt-vmi-9jm2s" to be deleted...
2023/12/04 09:10:36 VMI "realtime-checkup-1/rt-vmi-9jm2s" was deleted successfully

@orelmisan
Copy link
Member

Could you please rebase?
I want to see if the go bump in #44 had caused issues.

@RamLavi
Copy link
Collaborator Author

RamLavi commented Dec 6, 2023

Change: Rebase.

@RamLavi
Copy link
Collaborator Author

RamLavi commented Dec 6, 2023

Passed on CNV4.15 cluster:

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/kiagnose/kubevirt-realtime-checkup-vm:main \
	docker.io/library/golang:1.20.12 \
	go test -v ./tests/...
=== RUN   TestTests
Running Suite: Tests Suite - /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests
========================================================================================
Random Seed: 1701857697

Will run 1 of 1 specs
•

Ran 1 of 1 Specs in 117.075 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestTests (117.08s)
PASS
ok  	github.com/kiagnose/kubevirt-realtime-checkup/tests	117.088s

checkup logs:

$ oc logs -f job/rt-checkup
2023/12/06 10:15:05 kubevirt-realtime-checkup starting...
2023/12/06 10:15:05 Using the following config:
2023/12/06 10:15:05 	"vmUnderTestTargetNodeName": ""
2023/12/06 10:15:05 	"vmUnderTestContainerDiskImage": "quay.io/kiagnose/kubevirt-realtime-checkup-vm:main"
2023/12/06 10:15:05 	"oslatDuration": "10m0s"
2023/12/06 10:15:05 	"oslatLatencyThresholdMicroSeconds": "45µs"
2023/12/06 10:15:06 Waiting for VMI "realtime-checkup-1/rt-vmi-rzdv2" to boot...
2023/12/06 10:16:11 VMI "realtime-checkup-1/rt-vmi-rzdv2" had successfully booted
2023/12/06 10:16:11 Login to VMI under test...
2023/12/06 10:16:38 Trying to delete VMI: "realtime-checkup-1/rt-vmi-rzdv2"
2023/12/06 10:16:38 Waiting for VMI "realtime-checkup-1/rt-vmi-rzdv2" to be deleted...
2023/12/06 10:16:48 VMI "realtime-checkup-1/rt-vmi-rzdv2" was deleted successfully

pkg/internal/checkup/checkup.go Show resolved Hide resolved
pkg/internal/config/config.go Show resolved Hide resolved
Currently, the cloud-init data is hard-coded.
Generate the cloud-init using a function, in order to
be able to share the credentials with the component
that will log in to the VMI in a follow-up commit.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
Signed-off-by: Ram Lavi <ralavi@redhat.com>
Signed-off-by: Ram Lavi <ralavi@redhat.com>
Add a results field to the Checkup struct, in order
to store the checkup results that will be calculated in
a future commit.

Also change the `Results` method to return the new field.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
The executor package will hold the logic regarding
the execution of the DPDK traffic testing.

Expose the VMI's credentials, so they could be
consumed by `executor.New()`.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
The console package will be responsible for interfacing
with the VMI's serial console:
1. Execution of commands.
2. Login to VMI's shell.

This code is based on Kiagnose/kubevirt-dpdk-checkup's console package
[0].

[0]
https://github.com/kiagnose/kubevirt-dpdk-checkup/tree/614adcb89fab7518d8c8a513c61dab99e1a8fd2b/pkg/internal/checkup/executor/console

Signed-off-by: Ram Lavi <ralavi@redhat.com>
Signed-off-by: Ram Lavi <ralavi@redhat.com>
@RamLavi
Copy link
Collaborator Author

RamLavi commented Dec 12, 2023

Passed on CNV4.15 cluster:

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/kiagnose/kubevirt-realtime-checkup-vm:main \
	docker.io/library/golang:1.20.12 \
	go test -v ./tests/...
=== RUN   TestTests
Running Suite: Tests Suite - /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests
========================================================================================
Random Seed: 1702382246

Will run 1 of 1 specs
•

Ran 1 of 1 Specs in 107.015 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestTests (107.02s)
PASS
ok  	github.com/kiagnose/kubevirt-realtime-checkup/tests	107.027s

checkup logs:

$ oc logs -f job/rt-checkup
2023/12/12 11:57:30 kubevirt-realtime-checkup starting...
2023/12/12 11:57:30 Using the following config:
2023/12/12 11:57:30 	"vmUnderTestTargetNodeName": ""
2023/12/12 11:57:30 	"vmUnderTestContainerDiskImage": "quay.io/kiagnose/kubevirt-realtime-checkup-vm:main"
2023/12/12 11:57:30 	"oslatDuration": "1m0s"
2023/12/12 11:57:30 	"oslatLatencyThresholdMicroSeconds": "45µs"
2023/12/12 11:57:30 Waiting for VMI "realtime-checkup-1/rt-vmi-d5q6t" to boot...
2023/12/12 11:58:36 VMI "realtime-checkup-1/rt-vmi-d5q6t" had successfully booted
2023/12/12 11:58:36 Login to VMI under test...
2023/12/12 11:58:56 Trying to delete VMI: "realtime-checkup-1/rt-vmi-d5q6t"
2023/12/12 11:58:56 Waiting for VMI "realtime-checkup-1/rt-vmi-d5q6t" to be deleted...
2023/12/12 11:59:06 VMI "realtime-checkup-1/rt-vmi-d5q6t" was deleted successfully

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.

Thank you

@RamLavi RamLavi merged commit bd5d889 into kiagnose:main Dec 12, 2023
5 checks passed
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