Skip to content

Commit 14277c6

Browse files
authored
Merge pull request #4613 from dmcgowan/update-test-scripts
Update test build script to push containerd variant
2 parents 71ed61e + 3a6009c commit 14277c6

3 files changed

Lines changed: 112 additions & 3 deletions

File tree

test/build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ trap cleanup EXIT
4242

4343
set -x
4444
latest=$(readlink ./releases/cri-cni-containerd.tar.gz)
45-
cp releases/${latest} ${BUILDDIR}/cri-containerd.tar.gz
46-
cp releases/${latest}.sha256sum ${BUILDDIR}/cri-containerd.tar.gz.sha256
45+
tarball=$(echo ${latest} | sed -e 's/cri-containerd-cni/containerd-cni/g' | sed -e 's/-linux-amd64/.linux-amd64/g')
46+
cp releases/${latest} ${BUILDDIR}/${tarball}
47+
cp releases/${latest}.sha256sum ${BUILDDIR}/${tarball}.sha256
4748

4849
# Push test tarball to Google cloud storage.
4950
VERSION=$(git describe --match 'v[0-9]*' --dirty='.m' --always)
50-
PUSH_VERSION=true VERSION=${VERSION} BUILD_DIR=${BUILDDIR} ${ROOT}/test/push.sh
51+
PUSH_VERSION=true DEPLOY_DIR='containerd' TARBALL=${tarball} VERSION=${VERSION} BUILD_DIR=${BUILDDIR} ${ROOT}/test/push.sh

test/e2e_node/gci-init.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# Copyright The containerd Authors.
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# This script is used to do extra initialization on GCI.
18+
19+
mount /tmp /tmp -o remount,exec,suid
20+
#TODO(random-liu): Stop docker and remove this docker thing.
21+
usermod -a -G docker jenkins
22+
#TODO(random-liu): Change current node e2e to use init script,
23+
# so that we don't need to copy this code everywhere.
24+
mkdir -p /var/lib/kubelet
25+
mkdir -p /home/kubernetes/containerized_mounter/rootfs
26+
mount --bind /home/kubernetes/containerized_mounter/ /home/kubernetes/containerized_mounter/
27+
mount -o remount, exec /home/kubernetes/containerized_mounter/
28+
wget https://storage.googleapis.com/kubernetes-release/gci-mounter/mounter.tar -O /tmp/mounter.tar
29+
tar xvf /tmp/mounter.tar -C /home/kubernetes/containerized_mounter/rootfs
30+
mkdir -p /home/kubernetes/containerized_mounter/rootfs/var/lib/kubelet
31+
mount --rbind /var/lib/kubelet /home/kubernetes/containerized_mounter/rootfs/var/lib/kubelet
32+
mount --make-rshared /home/kubernetes/containerized_mounter/rootfs/var/lib/kubelet
33+
mount --bind /proc /home/kubernetes/containerized_mounter/rootfs/proc
34+
mount --bind /dev /home/kubernetes/containerized_mounter/rootfs/dev
35+
rm /tmp/mounter.tar

test/e2e_node/init.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#cloud-config
2+
3+
write_files:
4+
- path: /etc/systemd/system/containerd-installation.service
5+
permissions: 0644
6+
owner: root
7+
content: |
8+
# installed by cloud-init
9+
[Unit]
10+
Description=Download and install containerd binaries and configurations.
11+
After=network-online.target
12+
13+
[Service]
14+
Type=oneshot
15+
RemainAfterExit=yes
16+
ExecStartPre=/bin/mkdir -p /home/containerd
17+
ExecStartPre=/bin/mount --bind /home/containerd /home/containerd
18+
ExecStartPre=/bin/mount -o remount,exec /home/containerd
19+
ExecStartPre=/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/containerd/configure.sh http://metadata.google.internal/computeMetadata/v1/instance/attributes/containerd-configure-sh
20+
ExecStartPre=/bin/chmod 544 /home/containerd/configure.sh
21+
ExecStart=/home/containerd/configure.sh
22+
23+
[Install]
24+
WantedBy=containerd.target
25+
26+
- path: /etc/systemd/system/containerd.service
27+
permissions: 0644
28+
owner: root
29+
content: |
30+
# installed by cloud-init
31+
[Unit]
32+
Description=containerd container runtime
33+
Documentation=https://containerd.io
34+
After=containerd-installation.service
35+
36+
[Service]
37+
Restart=always
38+
RestartSec=5
39+
Delegate=yes
40+
KillMode=process
41+
OOMScoreAdjust=-999
42+
LimitNOFILE=1048576
43+
# Having non-zero Limit*s causes performance problems due to accounting overhead
44+
# in the kernel. We recommend using cgroups to do container-local accounting.
45+
LimitNPROC=infinity
46+
LimitCORE=infinity
47+
TasksMax=infinity
48+
ExecStartPre=/sbin/modprobe overlay
49+
ExecStart=/home/containerd/usr/local/bin/containerd
50+
51+
[Install]
52+
WantedBy=containerd.target
53+
54+
- path: /etc/systemd/system/containerd.target
55+
permissions: 0644
56+
owner: root
57+
content: |
58+
[Unit]
59+
Description=Containerd
60+
61+
[Install]
62+
WantedBy=multi-user.target
63+
64+
runcmd:
65+
# Stop the existing containerd service if there is one. (for Docker 18.09+)
66+
- systemctl is-active containerd && systemctl stop containerd
67+
- systemctl daemon-reload
68+
- systemctl enable containerd-installation.service
69+
- systemctl enable containerd.service
70+
- systemctl enable containerd.target
71+
- systemctl start containerd.target
72+
# Start docker after containerd is running. (for Docker 18.09+)
73+
- systemctl is-active docker || systemctl start docker

0 commit comments

Comments
 (0)