-
Notifications
You must be signed in to change notification settings - Fork 114
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
Support Jenkins CI #163
Support Jenkins CI #163
Conversation
Another jenkins job is configured to update the admin list. It needs to be run from a PR and can be triggered using |
currently the jobs are disabled, tested them on my fork. |
@martinkennelly @adrianchiris can you guys PTAL, thanks. |
Thanks @AbdYsn ! will review this soon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this !
I still need to give vf-netns-switcher.sh
a deeper look. provided some comments/questions/nits so we can get the ball rolling :)
im thinking after this we should split the kind cluster setup from tests, this will allow to reuse this for development environment setup as well.
hack/vf-netns-switcher.sh
Outdated
done | ||
sleep $TIMEOUT | ||
done | ||
return $status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will we ever reach this point ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, removed it.
hack/vf-netns-switcher.sh
Outdated
fi | ||
|
||
variables_check | ||
let status=$status+$? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless i missed something, status is first defined here why do not use $?
directly ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are correct, done out of habit, fixed it.
187ad99
to
9b09d80
Compare
doc/testing-kind.md
Outdated
|
||
There are two modes of moving the specified SR-IOV capable PCI net device to the KIND worker namespace: | ||
|
||
* `test-suit` (default): In this mode, the E2E test suit handle the PF and its VFs switching to the test namespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe test-suite ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ci/README.md
Outdated
@@ -0,0 +1,5 @@ | |||
## Jenkins CI configurations and examples | |||
This folder holds jenkins CI configurations and examples. The configurations currently are only limited to the admin-list. The admin list contains the list of github users and organizations that have permision to trigger the Jenkins CI, it is updated on the PR by commenting `/update-admins` on it by a current admin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configurations currently are only limited to the admin-list
what does it mean ? is this information on the examples below ?
can you structure this README so we have:
- General informaiton about this folder
- Information on admin list - what it is, who should use is, how its updated
- information on the examples
- information on the format of the build triggers for e2e tests (as presented in NPWG resource mgmt meeting)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, can you have a look?
doc/testing-kind.md
Outdated
### How to test | ||
#### `test-suit` SRIOV device switcher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: test-suite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested reword : Device netns switcher mode test-suite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
doc/testing-kind.md
Outdated
cp ./hack/vf-switcher.service /etc/systemd/system/ | ||
systemctl daemon-reload | ||
``` | ||
For the service to work probably the `jq` tool is needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: probably -> properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
hack/vf-netns-switcher.sh
Outdated
|
||
get_pci_from_net_name(){ | ||
local interface_name=$1 | ||
local worker_netns="${2:-$netns}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just $2 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
6aada80
to
ca56ec9
Compare
export TEST_NETNS_PATH="${netns_path}" | ||
if [[ "${INTERFACES_SWITCHER}" == "system-service" ]];then | ||
pf="$(ls /sys/bus/pci/devices/${test_pf_pci_addr}/net)" | ||
cat <<EOF > /etc/vf-switcher/vf-switcher.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to make sure directory exists
Getting the following:
## make KinD's sysfs writable (required to create VFs) ## label KinD's control-plane-node as sriov capable node/kind-worker labeled ## label KinD worker as worker node/kind-worker labeled ./hack/run-e2e-test-kind.sh: line 112: /etc/vf-switcher/vf-switcher.yaml: No such file or directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
doc/testing-kind.md
Outdated
#### Cleaning up the `system-service` service files | ||
``` | ||
$ sudo rm -f /etc/systemd/system/vf-switcher.service | ||
$ rm -f /etc/vf-switcher/vf-switcher.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is deleted in teardown-e2e-kind-cluster.sh so i dont think you need it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
hack/run-e2e-test-kind.sh
Outdated
@@ -4,11 +4,34 @@ here="$(dirname "$(readlink --canonicalize "${BASH_SOURCE[0]}")")" | |||
root="$(readlink --canonicalize "$here/..")" | |||
export SRIOV_NETWORK_OPERATOR_IMAGE="${SRIOV_NETWORK_OPERATOR_IMAGE:-sriov-network-operator:latest}" | |||
export SRIOV_NETWORK_CONFIG_DAEMON_IMAGE="${SRIOV_NETWORK_CONFIG_DAEMON_IMAGE:-origin-sriov-network-config-daemon:latest}" | |||
export KUBECONFIG="${KUBECONFIG:-${HOME}/.kube/config}" | |||
INTERFACES_SWITCHER="${INTERFACES_SWITCHER:-"test-suit"}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suit -> suite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
hack/run-e2e-test-kind.sh
Outdated
@@ -4,11 +4,34 @@ here="$(dirname "$(readlink --canonicalize "${BASH_SOURCE[0]}")")" | |||
root="$(readlink --canonicalize "$here/..")" | |||
export SRIOV_NETWORK_OPERATOR_IMAGE="${SRIOV_NETWORK_OPERATOR_IMAGE:-sriov-network-operator:latest}" | |||
export SRIOV_NETWORK_CONFIG_DAEMON_IMAGE="${SRIOV_NETWORK_CONFIG_DAEMON_IMAGE:-origin-sriov-network-config-daemon:latest}" | |||
export KUBECONFIG="${KUBECONFIG:-${HOME}/.kube/config}" | |||
INTERFACES_SWITCHER="${INTERFACES_SWITCHER:-"test-suit"}" | |||
SUPPORTED_INTERFACE_SWTICHER_MODES=("test-suit", "system-service") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suit -> suite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ef2664b
to
a9a625a
Compare
ci/README.md
Outdated
@@ -0,0 +1,23 @@ | |||
## CI configurations and examples | |||
This folder holds vendors CIes configurations and examples. Configurations are used to control the vendors CIes behaviors, and examples are used as a reference for other vendors to be able to setup a CI of their own. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first time seeing "CIes", can you just use CI throughout this file (or CIs)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, changed it to Vendors CI
b60185a
to
10974b1
Compare
* `sub-test`: In case there are many tests for the `test-type`, this field specify what sub-test to run. | ||
|
||
In addition to the convention, all vendors CI should be triggered on the general phrase `/test-all` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are a couple of things that are unclear to me.
can you elaborate on the expected CI behaviour when <sub-test>
is not provided in test/skip and when both <vendor>
and <sub-test>
are not provided in test/skip ?
also what is the expected behaviour with skip in general ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing would happen, essentially a job gets triggered on a specific trigger phrase, if you replace one section with all
all the tests for that section will get triggered.
To elaborate, consider a test called e2e-nvidia-cx5
, if you want to test it, you should comment one of the following:
/test-e2e-nvidia-cx5
/test-e2e-nvidia-all
/test-e2e-all
/test-all
For the skip, it would be a separate job which gets triggered on the /skip
phrases and the same trigger convention as the /test
convention above. The job would just exit 0
to have a green report on the PR with the same status-context
as the test
job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see if my understanding is correct for the /test
and /skip
usage:
- comment
/test-e2e-nvidia-all
, it runs on all sub-tests (e.g. cx-5 and cx-6). - assume cx-5 sub-test fails, the PR is blocked due to CI failure
- then comment
skip-e2e-nvidia-cx5
, it updates the CI failure to green (success) - the PR is unblocked due to the above
skip
comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sub-test
is used to specify the device
model, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite, the patch should be analyze, and determined whether it should be tested or not against the vendor CI. If it should then the /test
is used to trigger the job and merge will be blocked until the CI is green (either by retesting the test, or uploading a new patchset), ideally the CI would only fail because of a change in the patch and logs should be provided to be able to debug why the patch failed.
Only when it is determined that there is no need to test this test against this patch, then the /skip
should be used to pass the test.
well it is not just device
, it can also be other stuff, say openshift
, kind
, and baremetal
can also be added as a sub-test
. A note here is that another github workflow will be added after this patch is merged to comment available CI triggers on PR creation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for the explanation!
I think we don't define openshift, kind or baremetal yet, right? they are just possible examples, could be well be a different type (platform for example) in the test- convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't define openshift, kind or baremetal yet, right?
right
could be well be a different type (platform for example) in the test- convention
yes
hack/teardown-e2e-kind-cluster.sh
Outdated
@@ -7,3 +7,8 @@ if ! command -v kind &> /dev/null; then | |||
fi | |||
|
|||
kind delete cluster | |||
if [[ "${INTERFACES_SWITCHER}" == "system-service" ]];then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work if you use --device-netns-switcher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, can you have a look.
b22f5b4
to
a3568f4
Compare
a3568f4
to
6b34130
Compare
testing mellanox CI: /test-all |
/test-all |
6b34130
to
9751438
Compare
/test-all |
/skip-all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI triggers work. and Nvidia CI is running.
/test-e2e-nvidia-cx5 |
It seems the CI is not triggered, maybe I need to wait until this PR is merged so that admin list takes effect? |
Is there a way to check the jenkins log? I didn't see the |
/test-all |
I assume as I am not on Admin list, I cannot run Jenkins job? |
That actually because there is no such trigger. currently because there is only a single test, and i did not want to tie it to CX5 devices, i did not add a subtest to job trigger, and it can be trigger using the |
my mistake, forgot to enable them in the CI configuration, will do that shortly |
Correct, If you want to be added to the |
Ah, I see. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you for working on this!
/test-e2e-nvidia-all |
1 similar comment
/test-e2e-nvidia-all |
/test-all |
1 similar comment
/test-all |
/test-e2e-nvidia-all |
2 similar comments
/test-e2e-nvidia-all |
/test-e2e-nvidia-all |
@zshi-redhat can you try triggering it now with any of the supported phrases? |
/test-e2e-nvidia-all |
This patch adds a Jenkins file example, it also modifies the E2E kind script to support a new mode of operation: the bash service. The modification was done to support running the scripts in a limited privilege shell.
9751438
to
1996c00
Compare
@Eoghan1232 Yes, if you want to have the admin list updated immediately. |
Checking the logs, /test-all |
@AbdYsn BIG thanks for working on it ! 🚀 |
This patch adds a Jenkins file example, it also modifies the E2E
kind script to support a new mode of operation: the bash service.
The modification was done to support running the scripts in a limited
privilege shell.