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

2.x - Introduce Jenkins Job Builder for CI #359

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

wainersm
Copy link
Contributor

@wainersm wainersm commented Dec 18, 2020

This introduces the files and scripts to use with Jenkins
Job Builder to manage our CI jobs.

As a proof of concept, it is generated only four jobs:
kata-containers-main-kernel-experimental-x86_64
kata-containers-main-kernel-vanilla-x86_64
kata-containers-main-qemu-x86_64
kata-containers-stable-2.2-qemu-x86_64

Fixes #343

Signed-off-by: Wainer dos Santos Moschetta wainersm@redhat.com

@wainersm
Copy link
Contributor Author

Hi @jodh-intel , I'm sending this PR for the 2.0-dev branch as a simplified version of #344 . I re-evaluated the approach and now I think I should start with a simple version and growing on the scope with small steps.

So this PR will only generate jobs for the kernel nightly build for 2.x (we don't have such as jobs yet, so the install script always build the kernel - consequently taking more time). Next in my list is:

  • Create a job "update-jobs" which will self-update Jenkins whatever a file in jobs-builder/* is merged on this repository
  • Generate the jobs for nightly hypervisors builds (qemu, firecracker...etc)
  • Generate the jobs for nightly images. More complicated since identifying the cache is dirty for the image files seems more complex.
  • Then work on the remain of the jobs which are triggered on pull request for kata-containers repo.

Sound as a good plan?

@wainersm
Copy link
Contributor Author

@chavafg @GabyCT Hi people! I appreciate if you could give your opinion and reviews about this proposal.

Copy link
Contributor

@chavafg chavafg left a comment

Choose a reason for hiding this comment

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

thanks @wainersm, this looks good, just a couple of comments.

jobs-builder/publish_jobs.sh Outdated Show resolved Hide resolved
jobs-builder/README.md Show resolved Hide resolved
Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks @wainersm. A few comments.

jobs-builder/README.md Outdated Show resolved Hide resolved
jobs-builder/README.md Outdated Show resolved Hide resolved
jobs-builder/README.md Outdated Show resolved Hide resolved
jobs-builder/README.md Outdated Show resolved Hide resolved
# Template default variables
#
arch: x86_64
os: ubuntu1804
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not 20.04?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The QEMU and Kernel jobs are running on Ubuntu 18.04. I don't want to change it now.

single-use: True
- timestamps
- timeout:
timeout: 5
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this in seconds? Why 5 ooi?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Increased to 180.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just realized the timeout in the yaml is in minutes but the job builder will convert to seconds.

jobs-builder/jobs/dependencies.yaml Show resolved Hide resolved
case "$flavor" in
"vanilla") export experimental_kernel=false;;
"experimental") export experimental_kernel=true;;
*) echo "Do not know $flavor flavor" && exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
*) echo "Do not know $flavor flavor" && exit 1
*) echo >&2 "ERROR: Unknown flavour: '$flavour'"; exit 1

Comment on lines +11 to +12
{% elif os == "fedora32" -%}
fedora32_azure
Copy link
Contributor

Choose a reason for hiding this comment

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

F32 goes EOL in a few months - could this be changed to F33?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we add new jobs I plan to update the os2node.yaml.inc file. For now, it is good enough for the qemu and kernel jobs.

Comment on lines +17 to +20
{% elif os == "ubuntu1804" -%}
ubuntu1804_azure
{% elif os == "ubuntu1804_ARM" -%}
arm_node && arm-ubuntu-1804
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, can this be Ubuntu 20.04?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

likewise

@jodh-intel
Copy link
Contributor

Any update on this @wainersm?

@ariel-adam
Copy link

@wainersm any updates on this PR :-)?

@jodh-intel
Copy link
Contributor

pr:
  yaml-is-better-than-xml: true
  pr-needs-update: true
  i-would-love-to-see-this-land: true
  person-to-ping: "@wainersm"

@wainersm
Copy link
Contributor Author

hey @jodh-intel I managed to resume that work! There are still small details here and there which I plan to improve on the next days.

@wainersm
Copy link
Contributor Author

Ok, now I think this is ready for review (again). As I mentioned elsewhere this is just a PoC to show the jenkins job builder capabilities.

On the version I just pushed I:

  • added a section on README.md explaining how someone could check the generated jobs on a local Jenkins instance
  • I changed jobs/dependencies.yaml for the purpose of showing the power of jinja2 templates as well as on how YAML parts can be reused
  • Likely changed other stuffs that I don't remember now :)

@wainersm
Copy link
Contributor Author

@chavafg @GabyCT I'm might be tendentious saying that but I believe we will need soon something like what is being proposed on this PR. With the "always green CI" initiative flying, we will need to have a disciplined way of managed the jobs. Using a tool like Jenkins Job Builder allow us to threat the jobs as yet another piece of source code; people will be able to review the change more properly; we can ensure that what is in the repo is what you see on the UI, and so on.

@jodh-intel I am sure you are eager for this :)

Cc @ariel-adam

Copy link
Member

@c3d c3d left a comment

Choose a reason for hiding this comment

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

Having heard about this PR today, I took a quick look. I really like the idea, but I feel I am not the right person to approve it. @GabyCT @cpmeadors would you mind giving your opinion?

Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks @wainersm !

/cc @GabyCT and @jcvenegas for input.

jobs-builder/jobs/dependencies.yaml Outdated Show resolved Hide resolved
jobs-builder/publish_jobs.sh Outdated Show resolved Hide resolved
This introduces the files and scripts to use with Jenkins
Job Builder to manage our CI jobs.

As a proof of concept, it is generated only four jobs:
  kata-containers-main-kernel-experimental-x86_64
  kata-containers-main-kernel-vanilla-x86_64
  kata-containers-main-qemu-x86_64
  kata-containers-stable-2.2-qemu-x86_64

Fixes kata-containers#343
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks @wainersm !

lgtm but let's get input from @chavafg, @GabyCT, @jcvenegas, @cpmeadors.

@jodh-intel
Copy link
Contributor

Ping y'all - this is ready to go but should really have another ack I feel.

@GabyCT GabyCT merged commit fe46d70 into kata-containers:2.0-dev Oct 25, 2021
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.

None yet

6 participants