diff options
author | Daniel Stone <daniels@collabora.com> | 2016-09-05 16:44:35 +0100 |
---|---|---|
committer | Daniel Stone <daniels@collabora.com> | 2016-10-10 19:30:05 +0100 |
commit | 7dc3a92021cc017a80fc2e0cc7508961ac4e37f7 (patch) | |
tree | d3d6b72c5c04e0a2e94b6fd4ec597d99862ace09 /wayland-images |
As a start, this gives us:
- generation of base per-platform images (i.e. with toolchain)
- separate images to add build dependencies
- jobs using these separate images to build projects in containers
Initial implementations for CentOS 7, Fedora 24, Debian Jessie (8),
Ubuntu 14.04 (Trusty), and Ubuntu 16.04 (Xenial).
Fedora 24 is currently disabled in the 'all' jobs, as the container
unexpectedly takes a dive when running autoreconf.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'wayland-images')
-rw-r--r-- | wayland-images/build-image.jpl | 34 | ||||
-rw-r--r-- | wayland-images/centos-7/Dockerfile.template | 38 | ||||
-rw-r--r-- | wayland-images/debian-jessie/Dockerfile.template | 38 | ||||
-rw-r--r-- | wayland-images/fedora-24/Dockerfile.template | 38 | ||||
-rwxr-xr-x | wayland-images/gen-dockerfile.sh | 23 | ||||
-rw-r--r-- | wayland-images/ubuntu-14.04/Dockerfile.template | 39 | ||||
-rw-r--r-- | wayland-images/ubuntu-16.04/Dockerfile.template | 39 | ||||
-rw-r--r-- | wayland-images/wayland-images-all.jpl | 39 | ||||
-rw-r--r-- | wayland-images/wayland-images.jjb | 62 |
9 files changed, 350 insertions, 0 deletions
diff --git a/wayland-images/build-image.jpl b/wayland-images/build-image.jpl new file mode 100644 index 0000000..c762937 --- /dev/null +++ b/wayland-images/build-image.jpl @@ -0,0 +1,34 @@ +def img_name = "${env.PLATFORM}-wayland-${env.ARCH}" +def dir_name = "${img_name}-${STAMP}" + +stage("Generating Dockerfile") { + sh(script: "./wayland-images/gen-dockerfile.sh ${env.DOCKER_REGISTRY} ${env.PLATFORM} ${env.ARCH} ${STAMP} ${dir_name}") +} + +def img_wl + +stage("Building Wayland image") { + docker.withRegistry("${env.DOCKER_REGISTRY_URI_SCHEME}://${env.DOCKER_REGISTRY}", env.DOCKER_REGISTRY_CREDENTIALS) { + /* + * We use --no-cache, as Docker sees steps like 'apt-get update' as being + * idempotent, rather than temporally-bound. + */ + img_wl = docker.build("${img_name}:${STAMP}", "--no-cache ${dir_name}") + } +} + +stage("Pushing Wayland image") { + docker.withRegistry("${env.DOCKER_REGISTRY_URI_SCHEME}://${env.DOCKER_REGISTRY}", env.DOCKER_REGISTRY_CREDENTIALS) { + img_wl.push() + } +} + +stage("Testing Wayland build in new image") { + build(job: "wayland/build/${env.PLATFORM}-${env.ARCH}", parameters: [string(name: "STAMP", value: STAMP)], propagate: true, wait: true) +} + +stage("Promoting to latest") { + docker.withRegistry("${env.DOCKER_REGISTRY_URI_SCHEME}://${env.DOCKER_REGISTRY}", env.DOCKER_REGISTRY_CREDENTIALS) { + img_wl.push("latest") + } +} diff --git a/wayland-images/centos-7/Dockerfile.template b/wayland-images/centos-7/Dockerfile.template new file mode 100644 index 0000000..6085280 --- /dev/null +++ b/wayland-images/centos-7/Dockerfile.template @@ -0,0 +1,38 @@ +FROM @@REGISTRY@@/centos-7-base-@@ARCH@@:@@STAMP@@ +MAINTAINER Daniel Stone <daniels@collabora.com> + +# Common dependencies +RUN yum -y install \ + doxygen xmlto libxslt graphviz + +# libevdev dependencies +RUN yum -y install \ + check valgrind binutils + +# libinput dependencies +RUN yum -y install \ + mtdev-devel systemd-devel \ + libunwind-devel \ + glib-devel gtk3-devel + +# Wayland dependencies +RUN yum -y install \ + libffi-devel expat-devel libxml2-devel + +# wayland-protocols has no extra dependencies + +# Weston dependencies +RUN yum -y install \ + libxkbcommon-devel \ + pixman-devel mesa-libEGL-devel mesa-libGLES-devel \ + libdrm-devel systemd-devel mesa-libgbm-devel \ + libxcb-devel libXcursor-devel cairo-devel \ + freerdp-devel \ + libpng-devel libjpeg-turbo-devel libwebp-devel \ + colord-devel lcms2-devel \ + libva-devel \ + pango-devel \ + pam-devel dbus-devel libunwind-devel + +# Clean up after ourselves +RUN yum clean packages diff --git a/wayland-images/debian-jessie/Dockerfile.template b/wayland-images/debian-jessie/Dockerfile.template new file mode 100644 index 0000000..81b2402 --- /dev/null +++ b/wayland-images/debian-jessie/Dockerfile.template @@ -0,0 +1,38 @@ +FROM @@REGISTRY@@/debian-jessie-base-@@ARCH@@:@@STAMP@@ +MAINTAINER Daniel Stone <daniels@collabora.com> + +# Common dependencies +RUN apt-get install \ + doxygen xmlto xsltproc graphviz + +# libevdev dependencies +RUN apt-get install \ + check valgrind binutils + +# libinput dependencies +RUN apt-get install \ + libmtdev-dev libudev-dev \ + libunwind-dev \ + libglib2.0-dev libgtk-3-dev + +# Wayland dependencies +RUN apt-get install \ + libffi-dev libexpat-dev libxml2-dev + +# wayland-protocols has no extra dependencies + +# Weston dependencies +RUN apt-get install \ + libxkbcommon-dev \ + libpixman-1-dev libegl1-mesa-dev libgles2-mesa-dev \ + libdrm-dev libudev-dev libgbm-dev \ + libxcb1-dev libxcb-xfixes0-dev libxcb-composite0-dev libxcursor-dev libcairo-dev libxcb-xkb-dev \ + libfreerdp-dev \ + libpng-dev libjpeg-dev libwebp-dev \ + libcolord-dev liblcms2-dev \ + libva-dev \ + libcairo2-dev libpango1.0-dev \ + libpam0g-dev libdbus-1-dev libsystemd-dev libunwind-dev + +# Clean up after ourselves +RUN apt-get clean diff --git a/wayland-images/fedora-24/Dockerfile.template b/wayland-images/fedora-24/Dockerfile.template new file mode 100644 index 0000000..e75151d --- /dev/null +++ b/wayland-images/fedora-24/Dockerfile.template @@ -0,0 +1,38 @@ +FROM @@REGISTRY@@/fedora-24-base-@@ARCH@@:@@STAMP@@ +MAINTAINER Daniel Stone <daniels@collabora.com> + +# Common dependencies +RUN dnf -y install \ + doxygen xmlto libxslt graphviz + +# libevdev dependencies +RUN dnf -y install \ + check valgrind binutils + +# libinput dependencies +RUN dnf -y install \ + mtdev-devel systemd-devel \ + libunwind-devel \ + glib-devel gtk3-devel + +# Wayland dependencies +RUN dnf -y install \ + libffi-devel expat-devel libxml2-devel + +# wayland-protocols has no extra dependencies + +# Weston dependencies +RUN dnf -y install \ + libxkbcommon-devel \ + pixman-devel mesa-libEGL-devel mesa-libGLES-devel \ + libdrm-devel systemd-devel mesa-libgbm-devel \ + libxcb-devel libXcursor-devel cairo-devel \ + freerdp-devel \ + libpng-devel libjpeg-turbo-devel libwebp-devel \ + colord-devel lcms2-devel \ + libva-devel \ + pango-devel \ + pam-devel dbus-devel libunwind-devel + +# Clean up after ourselves +RUN dnf clean packages diff --git a/wayland-images/gen-dockerfile.sh b/wayland-images/gen-dockerfile.sh new file mode 100755 index 0000000..dc177b1 --- /dev/null +++ b/wayland-images/gen-dockerfile.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +BASEDIR=$(dirname $0) + +REGISTRY=$1 +shift +PLATFORM=$1 +shift +ARCH=$1 +shift +STAMP=$1 +shift +DEST=$1 +shift + +mkdir -p ${DEST} +sed -e "s#@@REGISTRY@@#${REGISTRY}#; s#@@ARCH@@#${ARCH}#; s#@@STAMP@@#${STAMP}#;" < \ + ${BASEDIR}/${PLATFORM}/Dockerfile.template > \ + ${DEST}/Dockerfile + +echo "Generated ${DEST}/Dockerfile from ${ARCH}/${STAMP}" diff --git a/wayland-images/ubuntu-14.04/Dockerfile.template b/wayland-images/ubuntu-14.04/Dockerfile.template new file mode 100644 index 0000000..5cad488 --- /dev/null +++ b/wayland-images/ubuntu-14.04/Dockerfile.template @@ -0,0 +1,39 @@ +FROM @@REGISTRY@@/ubuntu-14.04-base-@@ARCH@@:@@STAMP@@ +MAINTAINER Daniel Stone <daniels@collabora.com> + +# Common dependencies +RUN apt-get install \ + doxygen xmlto xsltproc graphviz + +# libevdev dependencies +RUN apt-get install \ + check valgrind binutils + +# libinput dependencies +RUN apt-get install \ + libmtdev-dev libudev-dev \ + libunwind8-dev \ + libglib2.0-dev libgtk-3-dev + +# Wayland dependencies +RUN apt-get install \ + libffi-dev libexpat-dev libxml2-dev + +# wayland-protocols has no extra dependencies + +# Weston dependencies +RUN apt-get install \ + libxkbcommon-dev \ + libpixman-1-dev libegl1-mesa-dev libgles2-mesa-dev \ + libdrm-dev libudev-dev libgbm-dev \ + libxcb1-dev libxcb-xfixes0-dev libxcb-composite0-dev libxcursor-dev libcairo-dev libxcb-xkb-dev \ + libfreerdp-dev \ + libpng-dev libjpeg-dev libwebp-dev \ + libcolord-dev liblcms2-dev \ + libva-dev \ + libcairo2-dev libpango1.0-dev \ + libpam0g-dev libdbus-1-dev libunwind8-dev \ + libsystemd-daemon-dev libsystemd-login-dev + +# Clean up after ourselves +RUN apt-get clean diff --git a/wayland-images/ubuntu-16.04/Dockerfile.template b/wayland-images/ubuntu-16.04/Dockerfile.template new file mode 100644 index 0000000..c1c5b0a --- /dev/null +++ b/wayland-images/ubuntu-16.04/Dockerfile.template @@ -0,0 +1,39 @@ +FROM @@REGISTRY@@/ubuntu-16.04-base-@@ARCH@@:@@STAMP@@ +MAINTAINER Daniel Stone <daniels@collabora.com> + +# Common dependencies +RUN apt-get install \ + doxygen xmlto xsltproc graphviz + +# libevdev dependencies +RUN apt-get install \ + check valgrind binutils + +# libinput dependencies +RUN apt-get install \ + libmtdev-dev libudev-dev \ + libunwind-dev \ + libglib2.0-dev libgtk-3-dev + +# Wayland dependencies +RUN apt-get install \ + libffi-dev libexpat-dev libxml2-dev + +# wayland-protocols has no extra dependencies + +# Weston dependencies +RUN apt-get install \ + libxkbcommon-dev \ + libpixman-1-dev libegl1-mesa-dev libgles2-mesa-dev \ + libdrm-dev libudev-dev libgbm-dev \ + libxcb1-dev libxcb-xfixes0-dev libxcb-composite0-dev libxcursor-dev libcairo-dev libxcb-xkb-dev \ + libfreerdp-dev \ + libpng-dev libjpeg-dev libwebp-dev \ + libcolord-dev liblcms2-dev \ + libva-dev \ + libcairo2-dev libpango1.0-dev \ + libpam0g-dev libdbus-1-dev libunwind-dev \ + libsystemd-dev + +# Clean up after ourselves +RUN apt-get clean diff --git a/wayland-images/wayland-images-all.jpl b/wayland-images/wayland-images-all.jpl new file mode 100644 index 0000000..5d6663c --- /dev/null +++ b/wayland-images/wayland-images-all.jpl @@ -0,0 +1,39 @@ +def expanded = [:] +def excluded = [] + +my_str = readFile(file: "base-images/base-image-axes.yaml") + +yaml = new org.yaml.snakeyaml.Yaml() +axis_config = yaml.load(my_str) +yaml = null + +/* Sadly we can't use the map.each {} iterator in pipeline scripts yet ... */ +exclusions = axis_config["exclude-from-all"] +for (int i = 0; exclusions && i < exclusions.size(); i++) { + exclusion = exclusions[i]["exclusion"] + platform = exclusion["platform"] + arch = exclusion["arch"] + excluded << "${platform}-${arch}" + println "excluding ${platform}-${arch}" +} + +platform_list = axis_config["platform"] +arch_list = axis_config["arch"] + +for (int i = 0; i < platform_list.size(); i++) { + def platform = platform_list[i] + + for (int j = 0; j < arch_list.size(); j++) { + def arch = arch_list[j] + def name = "${platform}-${arch}" + if (excluded.contains(name)) { + continue; + } + + expanded[name] = { + build(job: "docker-images/wayland-images/${name}", parameters: [string(name: 'STAMP', value: STAMP)], propagate: true, wait: true) + } + } +} + +parallel expanded diff --git a/wayland-images/wayland-images.jjb b/wayland-images/wayland-images.jjb new file mode 100644 index 0000000..308b7b7 --- /dev/null +++ b/wayland-images/wayland-images.jjb @@ -0,0 +1,62 @@ +- job-template: + name: docker-images/wayland-images/all + defaults: global + project-type: pipeline + parameters: + - string: + name: STAMP + description: 'Tag for base container image' + properties: + - inject: + properties-content: | + JOB_DEFINITION_GIT={job-definition-git} + JOB_DEFINITION_GIT_BRANCH={job-definition-git-branch} + pipeline: + script: | + node('docker') {{ + git(url: env.JOB_DEFINITION_GIT, branch: env.JOB_DEFINITION_GIT_BRANCH, poll: false) + load "wayland-images/wayland-images-all.jpl" + }} + sandbox: false + +- job-template: + name: docker-images/wayland-images/{platform}-{arch} + defaults: global + project-type: pipeline + parameters: + - string: + name: STAMP + description: "Tag for base container image" + properties: + - inject: + properties-content: | + PLATFORM={platform} + ARCH={arch} + DOCKER_REGISTRY_URI_SCHEME={docker-registry-uri-scheme} + DOCKER_REGISTRY={docker-registry} + DOCKER_REGISTRY_CREDENTIALS={docker-registry-credentials} + JOB_DEFINITION_GIT={job-definition-git} + JOB_DEFINITION_GIT_BRANCH={job-definition-git-branch} + pipeline: + # If we run a pipeline definition directly from SCM, it's always + # sandboxed, which means it can do ~nothing. Work around this by + # loading the script manually. + script: | + node('docker') {{ + git(url: env.JOB_DEFINITION_GIT, branch: env.JOB_DEFINITION_GIT_BRANCH, poll: false) + load "wayland-images/build-image.jpl" + }} + sandbox: false + +- project: + name: docker-images/wayland-images + defaults: base-image-axes + jobs: + - docker-images/wayland-images/{platform}-{arch} + - docker-images/wayland-images/all + +- defaults: + !include: base-images/base-image-axes.yaml + +- defaults: + !include: defaults.yaml |