-
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
[WIP] Introduce Jenkins Job Builder for CI #344
Conversation
Hi @GabyCT @chavafg , this PR is just a draft for the idea I proposed in #343 . If you think it is worth to adopt the tool, then I can manage to finish the implementation. With this initial yaml files, the following jobs are generated:
|
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.
Hi @wainersm,
I like this idea a lot. Thanks very much for raising this!!
XML is terrible and YAML is quite the opposite imho :)
A few comments but this is a major improvement over the morass of XML spew which is frankly unreviewable.
jjb/jobs/os2node.yaml.inc
Outdated
{% elif os == "centos8" -%} | ||
centos8_azure | ||
{% else %} | ||
unknown |
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.
ooi, what happens if we hit this condition?
jjb/jobs/template.yaml
Outdated
|
||
export GOPATH=$WORKSPACE/go | ||
export GOROOT="/usr/local/go" | ||
export PATH=${{GOPATH}}/bin:/usr/local/go/bin:/usr/sbin:/usr/local/bin:${{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.
- Could you use
$GOROOT/bin
here rather than hard-coding/usr/local/go/bin
? - Should
/usr/local/bin
be "higher up" than/usr/sbin/
?
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.
To be honest I just copied the builder scripts from some of our current jobs, so I didn't pay attention to that kind of detail. I will fix it as we go.
Now that you asked, I noted that some jobs (maybe the majority?) simply clone the tests
repo and call tests/.ci/jenkins_job_build.sh
; others curl
and execute tests/.ci/ci_entry_point.sh
. So what's the ultimate entry point script for CI?
jjb/jobs/template.yaml
Outdated
export GOROOT="/usr/local/go" | ||
export PATH=${{GOPATH}}/bin:/usr/local/go/bin:/usr/sbin:/usr/local/bin:${{PATH}} | ||
|
||
cd $GOPATH/src/github.com/kata-containers/tests |
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.
cd "${{tests_repo_dir}}"
jjb/publish_jobs.sh
Outdated
# | ||
# Use this script to publish the jobs on Jenkins. | ||
# | ||
|
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.
Script isn't set -e
. How about also adding set -o nounset
?
jjb/jobs/template.yaml
Outdated
builders: | ||
- shell: | | ||
#!/bin/bash | ||
set -e |
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.
How about also adding set -o nounset
? Also, is there a way to set a variable to enable tracing to work with out standard idiom of:
[ -n "${DEBUG:-}" ] && set -o xtrace
jjb/publish_jobs.sh
Outdated
[ -n "$config_file" ] || usage | ||
|
||
readonly cmd="jenkins-jobs" | ||
command -V $cmd || echo "Needs $cmd command" |
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.
command -V "$cmd" >/dev/null
?
Ditto. @jodh-intel I'm glad that you like the idea, it will really improve the management of jobs. I will be working on addressing your initial review but there are many decisions to take. We keep talking in this PR, is it okay for you? |
This change introduces the files and scripts to use with Jenkins Job Builder to manage our CI jobs. Fixes kata-containers#343 Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
7a68787
to
aeedcaf
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.
Thanks @wainersm - a couple of comments.
btw, it helps if you add a comment to the PR once you've re-pushed so we get notified that it needs are view again ;)
I'm very keen that we switch to YAML config, particularly for Kata 2.x jobs due to the fact it's so much clearer and easier to review and understand the jobs. Can't wait to see this land!
/cc @amshinde.
@@ -0,0 +1,68 @@ | |||
--- | |||
- job-template: | |||
name: '{configuration}-nightly-x86_64' |
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 try to find a way to uses variables to avoid hard-coding architectures? Ideally, we'd be able to use this set of files for all architectures Kata runs on.
[ -d "${{tests_repo_dir}}" ] || git clone "https://${{tests_repo}}.git" "${{tests_repo_dir}}" | ||
${{GOPATH}}/src/${{tests_repo}}/.ci/install_go.sh -p -f | ||
pushd ${{tests_repo_dir}} | ||
./cmd/container-manager/manage_ctr_mgr.sh docker install -f |
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.
Ping @kata-containers/ci for more reviews. |
@jodh-intel Hi James! I'd like to let you know I didn't forget this! I am managing to get some time to resume this work, and I believe next week I will be able to. |
Thanks @wainersm ! 😄 |
Added dnm label as we now have #359. |
@wainersm - can we close this as no longer required? |
Closed in favor of #359 |
This change introduces the files and scripts to use with Jenkins
Job Builder to manage our CI jobs.
Fixes #343
Signed-off-by: Wainer dos Santos Moschetta wainersm@redhat.com