ci: update Ubuntu versions

In Jenkins, we are using Xenial (16.04) as the worker distro and
that is causing some maintenance issues. For instance, the manually
installed buildah version lacks behind Github's CI that gets
buildah from a repository.

This change moves Jenkins to Ubuntu 18.04 so we get to install
buildah from packages directly too.

While we are at it, move Github VMs to Ubuntu 20.04. This allows
us the change with both LTS versions.

Finally, increase Jenkins timeout from 3 to 4 hours to be able to
build all the demo container images without getting aborted.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
This commit is contained in:
Mikko Ylinen 2020-11-23 10:10:35 +02:00
parent fc4c7c30d4
commit 621ecf9a40
2 changed files with 17 additions and 26 deletions

View File

@ -31,7 +31,7 @@ jobs:
build:
name: Build and check device plugins
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
@ -108,7 +108,7 @@ jobs:
sudo apt-get update -qq
sudo apt-get -qq -y install buildah
echo -e '[registries.search]\nregistries = ["docker.io"]\n\n' | sudo tee /etc/containers/registries.conf
sudo curl https://raw.githubusercontent.com/kubernetes-sigs/cri-o/${CRIO_VERSION}/test/policy.json -o /etc/containers/policy.json
sudo curl https://raw.githubusercontent.com/cri-o/cri-o/${CRIO_VERSION}/test/policy.json -o /etc/containers/policy.json
# install runc
sudo curl -L https://github.com/opencontainers/runc/releases/download/${RUNC_VERSION}/runc.amd64 -o /usr/bin/runc
sudo chmod +x /usr/bin/runc

39
Jenkinsfile vendored
View File

@ -3,7 +3,7 @@ pipeline {
label "master"
}
options {
timeout(time: 3, unit: "HOURS")
timeout(time: 4, unit: "HOURS")
}
environment {
GO111MODULE="on"
@ -11,7 +11,6 @@ pipeline {
RUNC_VERSION="v1.0.0-rc92"
CRIO_VERSION="v1.19.0"
GOLANGCI_LINT_VERSION="v1.30.0"
BUILDAH_VERSION="v1.15.0"
GO_VERSION="1.15.3"
GO_TAR="go${GO_VERSION}.linux-amd64.tar.gz"
GOROOT="/usr/local/go"
@ -31,7 +30,7 @@ pipeline {
}
stage("Build && Publish") {
agent {
label "xenial-intel-device-plugins"
label "bionic-intel-device-plugins"
}
stages {
stage("Get requirements") {
@ -42,27 +41,19 @@ pipeline {
sh "mkdir -p $GOPATH/src/github.com/intel $GOPATH/bin"
sh "cp -rf ${env.WORKSPACE} $REPO_DIR"
sh "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin ${GOLANGCI_LINT_VERSION}"
sh "sudo apt-get update"
sh "sudo apt-get -y install e2fslibs-dev libfuse-dev libgpgme11-dev libdevmapper-dev libglib2.0-dev libprotobuf-dev libusb-1.0-0-dev"
sh "mkdir -p ${GOPATH}/src/github.com/containers"
dir(path: "${GOPATH}/src/github.com/containers") {
sh "git clone --single-branch --depth 1 -b $BUILDAH_VERSION https://github.com/containers/buildah"
}
dir(path: "${GOPATH}/src/github.com/containers/buildah") {
sh 'make buildah TAGS=""'
sh "sudo cp buildah /usr/local/bin"
sh "sudo mkdir -p /etc/containers"
sh "sudo mkdir -p /etc/cni/net.d"
sh "sudo mkdir -p /opt/cni/bin"
sh "sed -i -e 's/build.sh/build_linux.sh/' Makefile"
sh "make install.cni.sudo"
sh '''echo '[registries.search]' > registries.conf'''
sh '''echo 'registries = ["docker.io"]' >> registries.conf'''
sh "sudo mv registries.conf /etc/containers/registries.conf"
sh "sudo curl https://raw.githubusercontent.com/kubernetes-sigs/cri-o/$CRIO_VERSION/test/policy.json -o /etc/containers/policy.json"
sh "sudo curl -L https://github.com/opencontainers/runc/releases/download/$RUNC_VERSION/runc.amd64 -o /usr/bin/runc"
sh "sudo chmod +x /usr/bin/runc"
}
sh '''#!/usr/bin/env bash
. /etc/os-release
REPOURL=http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${ID^}_${VERSION_ID}
echo "deb ${REPOURL} /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
wget -nv ${REPOURL}/Release.key -O - | sudo apt-key add -
'''
sh "sudo apt-get update -qq"
sh "sudo apt-get -qq -y install libusb-1.0-0-dev buildah make gcc pkg-config"
sh "sudo curl https://raw.githubusercontent.com/cri-o/cri-o/${CRIO_VERSION}/test/policy.json -o /etc/containers/policy.json"
sh "sudo curl https://raw.githubusercontent.com/cri-o/cri-o/${CRIO_VERSION}/test/registries.conf -o /etc/containers/registries.conf"
sh "sudo sed -i -e 's/quay/docker/' /etc/containers/registries.conf"
sh "sudo curl -L https://github.com/opencontainers/runc/releases/download/$RUNC_VERSION/runc.amd64 -o /usr/bin/runc"
sh "sudo chmod +x /usr/bin/runc"
}
}
stage("make go-mod-tidy") {