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

[traffic-gen-in-vm] Add trex config files #149

Merged
merged 3 commits into from
Jul 19, 2023

Conversation

RamLavi
Copy link
Collaborator

@RamLavi RamLavi commented Jul 19, 2023

This PR adds config files to the trex package, that will be consumed in the checkup's traffic-gen configmap.
These files are going to be consumed by the trex VMI in later PRs.

@RamLavi RamLavi changed the title Add config files [traffic-gen-in-vm] Add config files Jul 19, 2023
@RamLavi
Copy link
Collaborator Author

RamLavi commented Jul 19, 2023

$  TEST_NAMESPACE=dpdk-checkup-ns-1 NETWORK_ATTACHMENT_DEFINITION_NAME=dpdk-sriovnetwork-ns-1 RUNTIME_CLASS_NAME=performance-profile-1 make TEST_IMAGE=quay.io/ramlavi/kubevirt-dpdk-checkup:latest TRAFFIC_GEN_IMAGE_URL=quay.io/kiagnose/kubevirt-dpdk-checkup-traffic-gen:traffic-gen-in-vm VM_CONTAINER_DISK_IMAGE_URL=quay.io/kiagnose/kubevirt-dpdk-checkup-vm:traffic-gen-in-vm test/e2e
docker run --rm \
           --volume /home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup:/home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup:Z \
           --volume /home/ralavi/.kube:/root/.kube:Z,ro \
           --workdir /home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup \
           -e KUBECONFIG=/root/.kube/kubeconfig \
           -e TEST_IMAGE=quay.io/ramlavi/kubevirt-dpdk-checkup:latest \
           -e TEST_NAMESPACE=dpdk-checkup-ns-1 \
           -e NETWORK_ATTACHMENT_DEFINITION_NAME=dpdk-sriovnetwork-ns-1 \
           -e TRAFFIC_GEN_IMAGE_URL=quay.io/kiagnose/kubevirt-dpdk-checkup-traffic-gen:traffic-gen-in-vm \
           -e VM_CONTAINER_DISK_IMAGE_URL=quay.io/kiagnose/kubevirt-dpdk-checkup-vm:traffic-gen-in-vm \
           docker.io/library/golang:1.20.6 go test ./tests/... -test.v -test.timeout=1h -ginkgo.v -ginkgo.timeout=1h
=== RUN   TestKubevirtDpdkCheckup
Running Suite: KubevirtDpdkCheckup Suite - /home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup/tests
==============================================================================================================
Random Seed: 1689765054

Will run 1 of 1 specs
------------------------------
[BeforeSuite] 
/home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup/tests/test_suite_test.go:60
[BeforeSuite] PASSED [0.002 seconds]
------------------------------
Execute the checkup Job should complete successfully
/home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup/tests/checkup_test.go:79
• [143.181 seconds]
------------------------------

Ran 1 of 1 Specs in 143.184 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestKubevirtDpdkCheckup (143.18s)
PASS
ok  	github.com/kiagnose/kubevirt-dpdk-checkup/tests	143.206s

@RamLavi RamLavi requested a review from orelmisan July 19, 2023 11:31
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.

Have you tried to run TRex with the files generated by the PR?

pkg/internal/checkup/trex/configfiles.go Show resolved Hide resolved
pkg/internal/checkup/trex/configfiles_test.go Show resolved Hide resolved
pkg/internal/checkup/trex/configfiles.go Outdated Show resolved Hide resolved
pkg/internal/checkup/trex/configfiles.go Outdated Show resolved Hide resolved
}
}

func (t Configs) GetTrexCfgFile() string {
Copy link
Member

Choose a reason for hiding this comment

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

nit:
Please consider other verbs like Generate or Create.

Same for the other functions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

DONE

pkg/internal/checkup/configmap/configmap_test.go Outdated Show resolved Hide resolved
@RamLavi
Copy link
Collaborator Author

RamLavi commented Jul 19, 2023

Change: Review fixes

@RamLavi
Copy link
Collaborator Author

RamLavi commented Jul 19, 2023

$  TEST_NAMESPACE=dpdk-checkup-ns-1 NETWORK_ATTACHMENT_DEFINITION_NAME=dpdk-sriovnetwork-ns-1 make TEST_IMAGE=quay.io/ramlavi/kubevirt-dpdk-checkup:latest TRAFFIC_GEN_IMAGE_URL=quay.io/kiagnose/kubevirt-dpdk-checkup-traffic-gen:traffic-gen-in-vm VM_CONTAINER_DISK_IMAGE_URL=quay.io/kiagnose/kubevirt-dpdk-checkup-vm:traffic-gen-in-vm test/e2e
docker run --rm \
           --volume /home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup:/home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup:Z \
           --volume /home/ralavi/.kube:/root/.kube:Z,ro \
           --workdir /home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup \
           -e KUBECONFIG=/root/.kube/kubeconfig \
           -e TEST_IMAGE=quay.io/ramlavi/kubevirt-dpdk-checkup:latest \
           -e TEST_NAMESPACE=dpdk-checkup-ns-1 \
           -e NETWORK_ATTACHMENT_DEFINITION_NAME=dpdk-sriovnetwork-ns-1 \
           -e TRAFFIC_GEN_IMAGE_URL=quay.io/kiagnose/kubevirt-dpdk-checkup-traffic-gen:traffic-gen-in-vm \
           -e VM_CONTAINER_DISK_IMAGE_URL=quay.io/kiagnose/kubevirt-dpdk-checkup-vm:traffic-gen-in-vm \
           docker.io/library/golang:1.20.6 go test ./tests/... -test.v -test.timeout=1h -ginkgo.v -ginkgo.timeout=1h
=== RUN   TestKubevirtDpdkCheckup
Running Suite: KubevirtDpdkCheckup Suite - /home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup/tests
==============================================================================================================
Random Seed: 1689768882

Will run 1 of 1 specs
------------------------------
[BeforeSuite] 
/home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup/tests/test_suite_test.go:60
[BeforeSuite] PASSED [0.002 seconds]
------------------------------
Execute the checkup Job should complete successfully
/home/ralavi/go/src/github.com/kiagnose/kubevirt-dpdk-checkup/tests/checkup_test.go:79
• [243.674 seconds]
------------------------------

Ran 1 of 1 Specs in 243.677 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestKubevirtDpdkCheckup (243.68s)
PASS
ok  	github.com/kiagnose/kubevirt-dpdk-checkup/tests	243.697s

@RamLavi RamLavi changed the title [traffic-gen-in-vm] Add config files [traffic-gen-in-vm] Add trex config files Jul 19, 2023
Currently the trex package is only used on the executor package. In
preparation of expanding its use to the higher level checkup package,
moving trex package to be under it.

Signed-off-by: Ram Lavi <[email protected]>
The trex application needs some configuration files in order to run [1].
These configuration files iare represented by template files that need
to be configured with the checkup's config parameter input.

Introducing a new file that contains the config file templates and
returns the outputted files for future use in later commits.

[1] https://github.com/kiagnose/kubevirt-dpdk-checkup/tree/630d0497b2ba17a91245b93e37719ce50be4ddaa/traffic-gen/templates

Signed-off-by: Ram Lavi <[email protected]>
@RamLavi RamLavi merged commit 221e65f into kiagnose:traffic-gen-in-vm Jul 19, 2023
4 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