public inbox for kernelci@lists.linux.dev
 help / color / mirror / Atom feed
* proposal to build Debian images for every test suite (pull #24/kernelci-build-staging)
@ 2018-05-07 11:06 Ana Guerrero Lopez
  2018-05-07 23:09 ` [kernelci] " khilman
  0 siblings, 1 reply; 12+ messages in thread
From: Ana Guerrero Lopez @ 2018-05-07 11:06 UTC (permalink / raw)
  To: kernelci

[-- Attachment #1: Type: text/plain, Size: 4943 bytes --]


Hi everybody,

I'll add the information from this email in the README.md of the pull
request but it's difficult to discuss over GitHub, so I thought a mail
could make things easier.

At https://github.com/kernelci/kernelci-build-staging/pull/24I have
sent a proposal to build easily Debian images for every test suite
in arm64, armhf, x86 and x86_64.

The code has two parts, on one side, jenkins shared libraries that
are not included in the pull request: 
https://github.com/ana/kernelci-jenkins-libs
And on the other side, what's in the pull request: three small Jenkinsfiles
with the parameters for every job and the files to create the debian
image with debos.


While the shared libraries could be in the same repository that the
Jenkinsfile, I have created a separate repository for several reasons:

     * shared libraries must follow this directory structure
https://jenkins.io/doc/book/pipeline/shared-libraries/#directory-structure

     * if there are more shared libraries used in kernelci, it's good to
     have all of them in a separate repository, so they can be used
     from different git repositories or even from different branches
     *  You can add the shared library directly to the jenkins server
configuration  and use the in the pipeline syntax checker directly
     when playing/testing with the pipelines.

However, if the plan is to have all the Jenkinsfile in the same git
repository, then having an external repository for the shared libraries
is probably a bad idea.

The pull requests includes three things: three jenkinsfiles, debos files
and two Dockerfiles.

The jenkinsfiles are the smallest possible since all the code creating
the pipeline is in the shared library. There are two parts: one with the
job name - that will be used by the resulting images, the destination arches
and the run-time dependencies that need to be added to the image.
There is also the debos file name but this should be removed if we always
use the same debos configuration.
The second part "build_test_suite" is for building the test suite code.
This is on purpose a shell script that must create a cpio.gz tarball
with the name rootfs-built-${NAME}-${ARCH}.cpio.gz
The idea is to be able to add and modify quickly test suites without
knowing too much about jenkins.

The debos files are under the debos directory. I'm not going to enter into
details here, as said in the pull request: debos is a wrapper using
debootstrap and qemu that makes easier to create images and to tweak them
with a set of pre-defined actions [0] following the list of actions
specified listed in a YAML file (debos/stretch.yaml).
debos is the standard tool in collabora for creating images, it's still
young and we're adding new features and fixing bugs as they appear in
our projects.

[0] https://godoc.org/github.com/go-debos/debos/actions

About the two dockerfiles: Dockerfile_debos that's a debian
base image with debos installed and Dockerfile_debian that provides
a debian container with the build dependencies to build the test suites.
As mentioned in the pull request, this second dockerfile should be updated
to have the container installing the required build dependencies for every
test suite.

Combining all the elements above, every jenkinsfile creates a pipeline
with 3 stages for every one of the arches where it runs:
1) debos creates a stripped down debian image installing the runtime
dependencies for running the test suite (listed in extra_packages)
2) build the test suites (shell script build_test_suite)
3) merge the results of the two previous stages and create the final image.

In the case of Jenkinsfile_basic, given that build_test_suite is empty,
it only runs the stage 1. There is a missing stage 4 that would be 
uploading
the final images to kerneci.org

I hope this helps to understand my pull request, especially for those
less familiar with jenkins pipelines.

Finally, a few comment for people who are more familiar with jenkins
pipelines. As you might know, there is a lot of ways to create jenkins
pipelines and my proposal isn't the most common used way for what
I have seen although it's based in an example from jenkinsci at:
https://github.com/jenkinsci/pipeline-examples/tree/master/global-library-examples/global-function

I chose this approach because I found it's the easiest for people for
adding new images for test suites without having to know a lot of about
jenkins.
In case, you're curious, I worked first in an approach using declarative
pipelines with small functions for every step. For example, the jenkinsfile
for building the igt test suite:
https://gitlab.collabora.com/ana/kernelci-build-staging/blob/3557b105b04883800c6d6320a53f44e366ec43bd/Jenkinsfile
The shared functions are at 
https://gitlab.collabora.com/ana/kernelci-jenkins-libs

Cheers,
Ana






[-- Attachment #2: Type: text/html, Size: 14125 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-05-23  8:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-07 11:06 proposal to build Debian images for every test suite (pull #24/kernelci-build-staging) Ana Guerrero Lopez
2018-05-07 23:09 ` [kernelci] " khilman
2018-05-08  6:11   ` tomeu.vizoso
2018-05-10  1:04     ` Kevin Hilman
2018-05-10  6:56       ` Tomeu Vizoso
2018-05-10 15:41         ` Kevin Hilman
2018-05-11  5:23           ` Tomeu Vizoso
2018-05-16 16:46             ` Ana Guerrero Lopez
2018-05-23  8:21               ` Tomeu Vizoso
2018-05-09  0:00   ` Ana Guerrero Lopez
2018-05-10  1:15     ` Kevin Hilman
2018-05-16 15:56       ` Ana Guerrero Lopez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox