-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
7ce6ce2
commit b22f5b4
Showing
9 changed files
with
652 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## CI configurations and examples | ||
This folder holds vendors CI configurations and examples. Configurations are used to control the vendors CI behaviors, and examples are used as a reference for other vendors to be able to setup a CI of their own. | ||
|
||
### Admin list | ||
The admin list contains the list of github users and organizations that have permission to trigger the vendors CI. Only trusted users who have merge permissions should be on the list. The vendors should be responsible for how the admin list on their CI is updated, but to keep everything organized the vendors CI should at least update their admin list in response to a PR comment with the following phrase `/update-admins`. | ||
|
||
### CI Examples | ||
The examples folder contains configuration examples for vendor CI. It can be used as a reference for vendors to setup their CI. For more information on an example refer to that folder README. | ||
|
||
### Vendors CI triggers convention | ||
A vendor CI trigger phrases should follow the following convention: | ||
|
||
``` | ||
/test-<test-type>-<vendor>-<sub-test> | ||
/skip-<test-type>-<vendor>-<sub-test> | ||
``` | ||
|
||
* `test-type`: The type of test to conduct on the vendor's setups, for example: E2E. It can be replaced with `all` to test all tests types and vendors, for example `/test-all`. | ||
* `vendor`: The vendor that implemented the CI. It can be replaced with `all` to test the specified test type for all the vendors, for example `/test-e2e-all`. | ||
* `sub-test`: In case there are many tests for the `test-type`, this field specify what sub-test to run. It can be replaced with `all` to test all subtest of the vendor, for example `/test-e2e-nvidia-all`. | ||
|
||
The skip would just pass the test without running any real tests, and its triggers follows the same convention as the `test` conventions. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
admin-list: | ||
- adrianchiris | ||
- pliurh | ||
- zshi-redhat | ||
#org-list: | ||
# - <org> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Jenkins CI examples | ||
This folder holds examples for jenkins CI. | ||
|
||
### sriov-network-operator-ci.yaml | ||
This file holds an example jenkins-job-builder configuration that would be triggered on PRs by the admin list, and would simply run the `hack/run-e2e-test-kind.sh` script with `system-service` netns device switcher. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
- project: | ||
name: sriov-network-operator-github-ci | ||
jobs: | ||
- 'sriov-network-operator-ci': | ||
project: sriov-network-operator | ||
disabled_var: false | ||
concurrent: false | ||
node: <node label> | ||
git-site: https://github.com | ||
git-root: k8snetworkplumbingwg | ||
git-project: sriov-network-operator | ||
|
||
- job-template: | ||
name: 'sriov-network-operator-ci' | ||
node: '{node}' | ||
builders: | ||
- inject: | ||
properties-content: | | ||
KUBECONFIG=/etc/kubernetes/admin.conf | ||
INTERFACES_SWITCHER=system-service | ||
- run-e2e-test | ||
concurrent: false | ||
description: <!-- Managed by Jenkins Job Builder --> | ||
disabled: false | ||
project-type: freestyle | ||
properties: | ||
- build-discarder: | ||
artifact-days-to-keep: 60 | ||
artifact-num-to-keep: 100 | ||
days-to-keep: 60 | ||
num-to-keep: 100 | ||
- github: | ||
url: '{git-site}/{git-root}/{git-project}' | ||
scm: | ||
- git: | ||
branches: ["${{sha1}}"] | ||
credentials-id: '{credentials-id}' | ||
name: '{git-project}' | ||
refspec: +refs/pull/*:refs/remotes/origin/pr/* | ||
url: '{git-site}/{git-root}/{git-project}' | ||
wipe-workspace: true | ||
triggers: | ||
- github-pull-request: | ||
admin-list: | ||
- mellanox-ci | ||
allow-whitelist-orgs-as-admins: true | ||
org-list: | ||
- Mellanox | ||
auth-id: '{auth-id}' | ||
auto-close-on-fail: false | ||
build-desc-template: null | ||
cron: H/5 * * * * | ||
github-hooks: false | ||
only-trigger-phrase: true | ||
cancel-builds-on-update: true | ||
permit-all: false | ||
status-url: --none-- | ||
success-status: "Build Passed" | ||
failure-status: "Build Failed, comment `/test-e2e-all`, /test-e2e-nvidia-all, or `/test-all` to retrigger" | ||
error-status: "Build Failed, comment `/test-e2e-all`, /test-e2e-nvidia-all, or `/test-all` to retrigger" | ||
status-context: '{project} CI' | ||
trigger-phrase: ".*/test-(all|e2e-all|e2e-nvidia-all(,| |$)).*" | ||
white-list: | ||
- '*' | ||
white-list-target-branches: | ||
- master | ||
- github | ||
wrappers: | ||
- timeout: | ||
timeout: 120 | ||
fail: true | ||
- timestamps | ||
|
||
- builder: | ||
name: run-e2e-test | ||
builders: | ||
- shell: | | ||
#!/bin/bash | ||
status=0 | ||
./hack/teardown-e2e-kind-cluster.sh | ||
sleep 5 | ||
# This line is vendor specific, it should be changed according to hardware. | ||
mlnx_pci=$(lspci | grep Mellanox | grep -Ev 'MT27500|MT27520|Virt' | head -n 1 | awk '{print $1}') | ||
./hack/run-e2e-test-kind.sh 0000:${mlnx_pci} | ||
let status=$status+$? | ||
./hack/teardown-e2e-kind-cluster.sh | ||
sleep 5 | ||
exit $status | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.