Skip to content

Commit 621ecf9

Browse files
committed
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>
1 parent fc4c7c3 commit 621ecf9

File tree

2 files changed

+17
-26
lines changed

2 files changed

+17
-26
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

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

Jenkinsfile

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ pipeline {
33
label "master"
44
}
55
options {
6-
timeout(time: 3, unit: "HOURS")
6+
timeout(time: 4, unit: "HOURS")
77
}
88
environment {
99
GO111MODULE="on"
1010
REG="cloud-native-image-registry.westus.cloudapp.azure.com/"
1111
RUNC_VERSION="v1.0.0-rc92"
1212
CRIO_VERSION="v1.19.0"
1313
GOLANGCI_LINT_VERSION="v1.30.0"
14-
BUILDAH_VERSION="v1.15.0"
1514
GO_VERSION="1.15.3"
1615
GO_TAR="go${GO_VERSION}.linux-amd64.tar.gz"
1716
GOROOT="/usr/local/go"
@@ -31,7 +30,7 @@ pipeline {
3130
}
3231
stage("Build && Publish") {
3332
agent {
34-
label "xenial-intel-device-plugins"
33+
label "bionic-intel-device-plugins"
3534
}
3635
stages {
3736
stage("Get requirements") {
@@ -42,27 +41,19 @@ pipeline {
4241
sh "mkdir -p $GOPATH/src/github.com/intel $GOPATH/bin"
4342
sh "cp -rf ${env.WORKSPACE} $REPO_DIR"
4443
sh "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin ${GOLANGCI_LINT_VERSION}"
45-
sh "sudo apt-get update"
46-
sh "sudo apt-get -y install e2fslibs-dev libfuse-dev libgpgme11-dev libdevmapper-dev libglib2.0-dev libprotobuf-dev libusb-1.0-0-dev"
47-
sh "mkdir -p ${GOPATH}/src/github.com/containers"
48-
dir(path: "${GOPATH}/src/github.com/containers") {
49-
sh "git clone --single-branch --depth 1 -b $BUILDAH_VERSION https://github.com/containers/buildah"
50-
}
51-
dir(path: "${GOPATH}/src/github.com/containers/buildah") {
52-
sh 'make buildah TAGS=""'
53-
sh "sudo cp buildah /usr/local/bin"
54-
sh "sudo mkdir -p /etc/containers"
55-
sh "sudo mkdir -p /etc/cni/net.d"
56-
sh "sudo mkdir -p /opt/cni/bin"
57-
sh "sed -i -e 's/build.sh/build_linux.sh/' Makefile"
58-
sh "make install.cni.sudo"
59-
sh '''echo '[registries.search]' > registries.conf'''
60-
sh '''echo 'registries = ["docker.io"]' >> registries.conf'''
61-
sh "sudo mv registries.conf /etc/containers/registries.conf"
62-
sh "sudo curl https://raw.githubusercontent.com/kubernetes-sigs/cri-o/$CRIO_VERSION/test/policy.json -o /etc/containers/policy.json"
63-
sh "sudo curl -L https://github.com/opencontainers/runc/releases/download/$RUNC_VERSION/runc.amd64 -o /usr/bin/runc"
64-
sh "sudo chmod +x /usr/bin/runc"
65-
}
44+
sh '''#!/usr/bin/env bash
45+
. /etc/os-release
46+
REPOURL=http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${ID^}_${VERSION_ID}
47+
echo "deb ${REPOURL} /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
48+
wget -nv ${REPOURL}/Release.key -O - | sudo apt-key add -
49+
'''
50+
sh "sudo apt-get update -qq"
51+
sh "sudo apt-get -qq -y install libusb-1.0-0-dev buildah make gcc pkg-config"
52+
sh "sudo curl https://raw.githubusercontent.com/cri-o/cri-o/${CRIO_VERSION}/test/policy.json -o /etc/containers/policy.json"
53+
sh "sudo curl https://raw.githubusercontent.com/cri-o/cri-o/${CRIO_VERSION}/test/registries.conf -o /etc/containers/registries.conf"
54+
sh "sudo sed -i -e 's/quay/docker/' /etc/containers/registries.conf"
55+
sh "sudo curl -L https://github.com/opencontainers/runc/releases/download/$RUNC_VERSION/runc.amd64 -o /usr/bin/runc"
56+
sh "sudo chmod +x /usr/bin/runc"
6657
}
6758
}
6859
stage("make go-mod-tidy") {

0 commit comments

Comments
 (0)