-
Notifications
You must be signed in to change notification settings - Fork 34
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
Jenkins: Document Jenkins setup #32
Jenkins: Document Jenkins setup #32
Conversation
I expect this will need a touch more work - there is probably info I have missed and stuff that @chavafg might like to add. /cc @gnawux @Pennyzct @Weichen81 @nitkon - let me know if this helps, and what it is not telling you ;-) |
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 putting this together @grahamwhaley!
@klynnrif - ptal.
Jenkins_setup.md
Outdated
Kata Containers CI operates two types of CI builds: | ||
|
||
- PR builds. Builds are scheduled upon submission or change to a Pull Request on any | ||
of the repositories |
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.
Missing period.
@@ -0,0 +1,161 @@ | |||
# Kata Containers Jenkins CI setup |
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.
Could you add a table of contents for easy navigation?
export ghprbTargetBranch | ||
|
||
cd $HOME | ||
git clone https://github.com/kata-containers/tests.git |
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 need to clone into the proper go path otherwise .ci/jenkins_job_build.sh
will check itself out again to that path.
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.
Jenkins_setup.md
Outdated
> | ||
> The `export` of the `ghprb` variables for the Master builds is benign, as the Master | ||
> builds do not use the GHPRB plugin. Subsequently, the `jenkins_job_build.sh` script can | ||
> still test for the GHPRB varibles to distinguish between a PR and Master build. |
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.
Typo: "variables".
Jenkins_setup.md
Outdated
|
||
The teardown script is entered into the Jenkins Post-Build Actions dialog like: | ||
|
||
 |
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 the same pic as the build script. Do we need a new image for the teardown?
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.
heh, have the image already - did the cut/paste but forgot to update the link ;-) Fixed.
Jenkins_setup.md
Outdated
|
||
| Var | Effect | | ||
| --------- | ---------------------------------------------------------------- | | ||
| `WORKSPACE` | Must be set. Is set by Jenkins to point at the directory the script will use as its workspace (scratch area) | |
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.
Bonus points for sorting the rows ;)
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 can do - I sort of put them in the order the script evaluates them. I'll sort them, but if you think they might actually be better in order-of-use, ping back here.
Jenkins_setup.md
Outdated
|
||
## Experienced users | ||
|
||
For the more experienced Jenkins user, if you are au-fait reading Jenkins xml config files |
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.
s/xml/XML/
Jenkins_setup.md
Outdated
then you can find a backup of our Azure based Jenkins QA CI in this repository under the | ||
[jenkins sub folder](https://github.com/kata-containers/ci/tree/master/jenkins). | ||
|
||
## Other 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.
This is correct info, but I'm not sure we need to include it? If we retain it, it may be worth explaining why we switched.
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.
iirc, somebody mentioned they had CI hardware available for a non-x86 arch, but it was already using an alternative CI system (perhaps Travis) - so, I think maybe we leave this for the minute, and then get the other arch CIs up, and if we all end up on Jenkins or another CI, then we can drop it again... OK?
Happy to add a couple of details on why we moved - can you remember a couple of snippets? iirc, Travis does not support nested VMs (at least not the free-to-open-source version), and semaphore?? Did we just have speed/stability/reliability issues?
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.
Scrubbed for grammar, structure, and flow :) Thanks!
Jenkins_setup.md
Outdated
# Kata Containers Jenkins CI setup | ||
|
||
The main Continuous Integration (CI) system for Kata Containers is [Jenkins](https://jenkins.io/). | ||
This document gives an overview of how Kata Containers integrates with Jenkins, and |
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.
Lines 4-6 read a little awkward to me - suggested rewrite: This document is an overview of how Kata Containers integrates with Jenkins. It also directs you to configuration information and scripts to help you set up a Kata Containers Jenkins CI system.
Jenkins_setup.md
Outdated
PR builds are triggered from Jenkins using the [GitHub Pull Request Builder](https://plugins.jenkins.io/ghprb) (GHPRB) | ||
plugin. | ||
|
||
The GHPRB plugin is configured to be triggered via github hooks. This is the preferred method |
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 GHPRB plugin is configured to trigger through GitHub hooks. ...
Jenkins_setup.md
Outdated
The GHPRB plugin is configured to be triggered via github hooks. This is the preferred method | ||
to trigger on changes (preferred to polling). The preferred method is to integrate the CIs | ||
using the [katacontainersbot](https://github.com/katacontainersbot) user. Please discuss | ||
your requirements with the Kata Containers team who can then discuss the appropriate changes. |
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.
your requirements with the Kata Containers team who will then discuss the appropriate changes.
Jenkins_setup.md
Outdated
using the [katacontainersbot](https://github.com/katacontainersbot) user. Please discuss | ||
your requirements with the Kata Containers team who can then discuss the appropriate changes. | ||
|
||
The GHPRB triggers should be set up similar to: |
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.
Set up the GHPRB triggers similar to the following:
Jenkins_setup.md
Outdated
The GHPRB triggers should be set up similar to: | ||
 | ||
|
||
The GHPRB `Trigger Setup` further options should be set up similar to: |
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.
Set up the GHPRB Trigger Setup
further options similar to the following:
Jenkins_setup.md
Outdated
| `WORKSPACE` | Must be set. Is set by Jenkins to point at the directory the script will use as its workspace (scratch area) | | ||
| `ghprbTargetBranch` | Is set by the GHPRB Jenkins plugin. Is only set for PR builds, and is used with `ghprbPullId` to distinguish between PR and Master builds. | | ||
| `ghprbPullId` | Is used in PR builds to locate the correct branch on github to pull and build. | | ||
| `KATA_DEV_MODE` | Must not be set, or the script will not act as a CI script. KATA_DEV_MODE is a developer only option allowing the script to be run 'safely' in a development environment. | |
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.
Must not be set, or the script does not act as a CI script. ...
Jenkins_setup.md
Outdated
| `ghprbTargetBranch` | Is set by the GHPRB Jenkins plugin. Is only set for PR builds, and is used with `ghprbPullId` to distinguish between PR and Master builds. | | ||
| `ghprbPullId` | Is used in PR builds to locate the correct branch on github to pull and build. | | ||
| `KATA_DEV_MODE` | Must not be set, or the script will not act as a CI script. KATA_DEV_MODE is a developer only option allowing the script to be run 'safely' in a development environment. | | ||
| `METRICS_CI` | If set, will skip running the QA tests after the install/build phases (as the tests are not required for a metrics run). | |
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.
If set, skips running the QA tests after the install/build phases ...
Jenkins_setup.md
Outdated
| `GOPATH` | Is set to the installed Go environment | | ||
| `GOROOT` | Is set to the installed Go environment | | ||
| `PATH` | Is modified to include ${GOPATH}/bin, /usr/local/go/bin and the 'sbin' directories. | | ||
| `kata_repo` | Is set to the github repo name, as passed in to $1 of the script. | |
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.
github => GitHub
Jenkins_setup.md
Outdated
## Other CIs | ||
|
||
Formerly Kata Containers, and one of its predecessors [Clear Containers](https://github.com/clearcontainers) | ||
have used both [Travis](https://travis-ci.com/) and [SemaphoreCI](https://semaphoreci.com/) |
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.
used both Travis and SemaphoreCI
Jenkins_setup.md
Outdated
|
||
## Experienced users | ||
|
||
For the more experienced Jenkins user, if you are au-fait reading Jenkins xml config files |
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.
Lines 151-152 suggested rewrite: For the more experienced Jenkins user, if you are comfortable reading Jenkins xml config files, there is a backup of our Azure-based Jenkins QA CI in this repository under the
2570934
to
9cb006e
Compare
9cb006e
to
b1b9c20
Compare
@klynnrif @jodh-intel - updated and pushed - please re-review. |
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.
Nice! Just a few nits and suggestions.
lgtm
Jenkins_setup.md
Outdated
The Kata Containers Jenkins CI system uses Jenkins 'Freestyle Project' build jobs | ||
to perform its builds. Kata Containers CI operates two types of CI builds: | ||
|
||
- PR builds. Builds are scheduled upon submission or change to a Pull Request on any |
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 essential, but if you change the layout to something like the following:
- [PR builds](#pr-builds)
Builds are scheduled upon submission or change to a Pull Request on any of the repositories.
.. it'll render more clearly as:
-
Builds are scheduled upon submission or change to a Pull Request on any of the repositories.
I also added the links to the sections.
Jenkins_setup.md
Outdated
plugin. | ||
|
||
The GHPRB plugin is configured to trigger through GitHub hooks. This is the preferred method | ||
to trigger on changes (preferred to polling). The preferred method is to integrate the 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.
Nit: Third mention of the word "preferred" in two lines.
Jenkins_setup.md
Outdated
The GHPRB plugin is configured to trigger through GitHub hooks. This is the preferred method | ||
to trigger on changes (preferred to polling). The preferred method is to integrate the CIs | ||
using the [katacontainersbot](https://github.com/katacontainersbot) user. Please discuss | ||
your requirements with the Kata Containers team who will then discuss the appropriate changes. |
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.
s/then discuss/then make/ ?
Jenkins_setup.md
Outdated
using the [katacontainersbot](https://github.com/katacontainersbot) user. Please discuss | ||
your requirements with the Kata Containers team who will then discuss the appropriate changes. | ||
|
||
Set the GHPRB triggers similar to the following: |
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'm wondering if you made the two "Set the ..." sentences to bullets whether that would auto-indent the graphics slightly for better clarity?
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.
Ooh, testing MD changes on a branch you've already PR'd is a pain in the (fork/push) fingers :-( So, I went to have a look-see, and came across this just for you @jodh-intel :-) heh heh. The other solution involved embedded HTML, which we are not doing either... let me have a play with the bullets though...
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.
That is ✨ deep magic ✨ indeed.
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.
Bullets was the only way I could find to indent the images - but adding bullets to either the leading text or the image itself both looked a bit odd. I'll leave as is.
Jenkins_setup.md
Outdated
### Master builds | ||
|
||
Master branch builds are tracked with the Jenkins [git Source Code Management](https://plugins.jenkins.io/git) | ||
plugin. GITScm GitHub hooks are used to trigger builds. |
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.
It's pretty clear but for consistency with other docs, maybe you could take " (GITScm)" to the end of the first sentence before using that term?
Jenkins_setup.md
Outdated
|
||
| Var | Effect | | ||
| --------- | ---------------------------------------------------------------- | | ||
| `CI` | Is set by the script (unless KATA_DEV_MODE is already set) to indicate to sub-scripts that this is a CI build. | |
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.
KATA_DEV_MODE
.
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 the output var section - the script doesn't modify or set KATA_DEV_MODE
does it?
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.
oh - maybe the comment hasn't lined up with the correct table row. I just meant to render that variable in a fixed font:
s/unless KATA_DEV_MODE is/unless KATA_DEV_MODE
is/
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.
Ah, I see - got it now. Fixed, along with the one in the previous table as well.
Jenkins_setup.md
Outdated
|
||
## Experienced users | ||
|
||
For the more experienced Jenkins user, if you are au-fait reading Jenkins XML config files |
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.
Italics for au-fait as it's a foreign language term. I wonder if we should replace for simplicity though?
s/au-fait/comfortable/ ?
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.
spoil sport.... I guess I'll change it ;-)
Hi @jongwu.
I think you have now figured where the script is run from - in the Build/Execute Shell section of the Jenkins FreeStyle job setup dialog?
If is the first time integrating Jenkins with Kata Containers then it is probably most useful to start with a single 'Master' job that is tied to the runtime repository, and then use the 'Build now' option so you can check builds are working before hooking up a live PR tracking job :-) |
b1b9c20
to
2edbc57
Compare
Updates applied @jodh-intel |
Jenkins_setup.md
Outdated
| `GOPATH` | Is set to the installed Go environment | | ||
| `GOROOT` | Is set to the installed Go environment | | ||
| `kata_repo` | Is set to the GitHub repo name, as passed in to $1 of the script. | | ||
| `PATH` | Is modified to include ${GOPATH}/bin, /usr/local/go/bin and the 'sbin' directories. | |
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: could use backticks for these.
lgtm |
2edbc57
to
9792319
Compare
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
This is very well documented. Thanks @grahamwhaley
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 missed one instance of GitHub with a lowercase h. That is the only additional change. Thanks!
Jenkins_setup.md
Outdated
 | ||
|
||
|
||
### Github bandwidth and tokens |
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.
Apologies if I missed this before: Github => GitHub
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 @klynnrif , also in the ToC :-)
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.
Thank you!!!
9792319
to
0f97abb
Compare
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 - thanks!
So close... just one more ack needed. /me look at @kata-containers/ci ... ;) |
We don't have an overview of how our Jenkins CI is hung together. Add a document to both aid any new instances being set up, and to help us if we ever need to re-create the CI. Fixes: kata-containers#30 Signed-off-by: Graham whaley <graham.whaley@intel.com>
0f97abb
to
4c5f8e1
Compare
rebased to clear .gitconfig clash - and now we have the big green button.... anybody |
Looks like we need 1 more ack? |
lgtm |
docs: Add a README
Apply the doc teams review changes that got missed off PR kata-containers#32. Fixes kata-containers#34. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
We don't have an overview of how our Jenkins CI is hung
together. Add a document to both aid any new instances
being set up, and to help us if we ever need to re-create
the CI.
Fixes: #30
Signed-off-by: Graham whaley graham.whaley@intel.com