-
Notifications
You must be signed in to change notification settings - Fork 295
145 lines (122 loc) · 4.69 KB
/
integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Integration Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
integration:
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: Set up Go 1.19.10
uses: actions/setup-go@v1
with:
go-version: 1.19.10
id: go
- name: Setup environment
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
- name: Install docker
shell: bash
run: |
arch=$(dpkg --print-architecture)
# Workarounds for error "Failed to fetch https://packagecloud.io/github/git-lfs/ubuntu/dists/trusty/InRelease"
# TODO: remove it after the issue fixed in git-lfs.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157
sudo apt-get update
# Install prereqs
sudo apt-get install -y \
conntrack iptables iproute2 ethtool socat util-linux mount ebtables udev kmod \
libseccomp2
# Install docker.
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl socat \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=$arch] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-cache madison docker-ce
sudo apt-get install docker-ce docker-ce-cli containerd.io
# Restart docker daemon.
sudo service docker restart
- name: Install ginkgo
run: |
go install github.com/onsi/ginkgo/v2/ginkgo@latest
ginkgo version
sudo cp $(command -v ginkgo) /usr/local/bin
- name: Check out cri-tools
uses: actions/checkout@v2
with:
repository: kubernetes-sigs/cri-tools
path: src/sigs.k8s.io/cri-tools
ref: 5fd98895f3bbf8a3ba2d25e93fa95ba1e2ae0923
- name: Build cri-tools
working-directory: src/sigs.k8s.io/cri-tools
run: |
make critest crictl
find $(pwd)/build/bin -type f -exec mv {} /usr/local/bin \;
- name: Checkout cri-dockerd
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
path: src/github.com/Mirantis/cri-dockerd
- name: Build cri-dockerd
working-directory: src/github.com/Mirantis/cri-dockerd
run: |
go build
sudo mv ./cri-dockerd /usr/local/bin
- name: Start cri-dockerd and run critest
working-directory: src/sigs.k8s.io/cri-tools
shell: bash
run: |
set -x
export LANG=C
export LC_ALL=C
# Install nsenter
docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter
# Start cri-dockerd first
logs_dir="${{ github.workspace }}/logs"
mkdir -p $logs_dir
sudo /usr/local/bin/cri-dockerd --log-level warn --network-plugin="" >$logs_dir/cri-dockerd.log 2>&1 &
# Wait a while for cri-dockerd starting.
sleep 10
# Run e2e test cases
# Skip reopen container log test because docker doesn't support it.
# Skip runtime should support execSync with timeout because docker doesn't
# support it.
# Skip apparmor test as we don't enable apparmor yet in this CI job, or selinux
sudo /usr/local/bin/critest -runtime-endpoint=unix:///var/run/cri-dockerd.sock -ginkgo.skip="runtime should support apparmor|runtime should support reopening container log|runtime should support execSync with timeout|runtime should support selinux|.*should support propagation.*"
- name: Run benchmark
working-directory: src/sigs.k8s.io/cri-tools
shell: bash
run: |
set -o errexit
set -o nounset
set -o pipefail
set -x
export LANG=C
export LC_ALL=C
# Run benchmark test cases
sudo /usr/local/bin/critest -runtime-endpoint=unix:///var/run/cri-dockerd.sock -benchmark
- name: Dump docker logs
if: always()
run: |
mkdir -p ${{ github.workspace }}/logs
sudo journalctl -eu docker | sudo tee ${{ github.workspace }}/logs/docker.log
ls -atrl ${{ github.workspace }}/logs
- name: Upload logs
if: always()
uses: actions/upload-artifact@v1
with:
name: logs
path: logs