Skip to content

Commit 53371c8

Browse files
authored
Merge pull request #4598 from estesp/release-script-updates
[release/1.3] backport CRI release process via GitHub Actions
2 parents 02d93ad + 4bb1ec0 commit 53371c8

12 files changed

Lines changed: 878 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
uses: actions/checkout@v2
8282
with:
8383
path: src/github.com/containerd/containerd
84-
fetch-depth: 25
84+
fetch-depth: 100
8585

8686
- name: Checkout project repo
8787
uses: actions/checkout@v2
@@ -114,7 +114,7 @@ jobs:
114114
if [ -z "${GITHUB_COMMIT_URL}" ]; then
115115
DCO_RANGE=$(jq -r '.after + "..HEAD"' ${GITHUB_EVENT_PATH})
116116
else
117-
DCO_RANGE=$(curl ${GITHUB_COMMIT_URL} | jq -r '.[0].parents[0].sha +".."+ .[-1].sha')
117+
DCO_RANGE=$(curl ${GITHUB_COMMIT_URL} | jq -r '.[0].parents[0].sha + "..HEAD"')
118118
fi
119119
../project/script/validate/dco
120120

.github/workflows/release.yml

Lines changed: 100 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,18 @@ jobs:
6666

6767
- name: Set env
6868
shell: bash
69+
env:
70+
MOS: ${{ matrix.os }}
6971
run: |
7072
releasever=${{ github.ref }}
7173
releasever="${releasever#refs/tags/}"
74+
os=linux
75+
[[ "${MOS}" =~ "windows" ]] && {
76+
os=windows
77+
}
7278
echo "::set-env name=RELEASE_VER::${releasever}"
7379
echo "::set-env name=GOPATH::${{ github.workspace }}"
80+
echo "::set-env name=OS::${os}"
7481
echo "::add-path::${{ github.workspace }}/bin"
7582
7683
- name: Checkout containerd
@@ -79,36 +86,35 @@ jobs:
7986
repository: containerd/containerd
8087
ref: ${{ github.ref }}
8188
path: src/github.com/containerd/containerd
89+
8290
- name: Install Linux dependencies
8391
if: startsWith(matrix.os, 'ubuntu')
8492
run: |
85-
sudo apt-get update
86-
sudo apt-get install -y btrfs-tools
8793
sudo script/setup/install-seccomp
8894
working-directory: src/github.com/containerd/containerd
95+
8996
- name: HCS Shim commit
9097
id: hcsshim_commit
9198
if: startsWith(matrix.os, 'windows')
9299
shell: bash
93100
run: echo "::set-output name=sha::$(grep Microsoft/hcsshim vendor.conf | awk '{print $2}')"
94101
working-directory: src/github.com/containerd/containerd
102+
95103
- name: Checkout hcsshim source
96104
if: startsWith(matrix.os, 'windows')
97105
uses: actions/checkout@v2
98106
with:
99107
repository: Microsoft/hcsshim
100108
ref: ${{ steps.hcsshim_commit.outputs.sha }}
101109
path: src/github.com/Microsoft/hcsshim
110+
102111
- name: Make
103112
shell: bash
104-
env:
105-
MOS: ${{ matrix.os }}
106-
OS: linux
107113
run: |
108114
make build
109115
make binaries
110-
[[ "${MOS}" =~ "windows" ]] && {
111-
OS=windows
116+
rm bin/containerd-stress*
117+
[[ "${OS}" == "windows" ]] && {
112118
(
113119
bindir="$(pwd)/bin"
114120
cd ../../Microsoft/hcsshim
@@ -126,6 +132,47 @@ jobs:
126132
name: containerd-binaries-${{ matrix.os }}
127133
path: src/github.com/containerd/containerd/*.tar.gz*
128134

135+
- name: Install cri-containerd dependencies
136+
shell: bash
137+
env:
138+
RUNC_FLAVOR: runc
139+
DESTDIR: ${{ github.workspace }}/cri-release
140+
run: |
141+
mkdir ${DESTDIR}
142+
if [[ "${OS}" == "linux" ]]; then
143+
sudo install -d ${DESTDIR}/usr/local/bin
144+
sudo install -D -m 755 bin/* ${DESTDIR}/usr/local/bin
145+
sudo install -d ${DESTDIR}/opt/containerd/cluster
146+
sudo cp -r contrib/gce ${DESTDIR}/opt/containerd/cluster/
147+
sudo install -d ${DESTDIR}/etc/systemd/system
148+
sudo install -m 644 containerd.service ${DESTDIR}/etc/systemd/system
149+
echo "CONTAINERD_VERSION: '${RELEASE_VER#v}'" | sudo tee ${DESTDIR}/opt/containerd/cluster/version
150+
151+
sudo PATH=$PATH script/setup/install-seccomp
152+
USESUDO=true script/setup/install-runc
153+
script/setup/install-cni
154+
script/setup/install-critools
155+
elif [[ "${OS}" == "windows" ]]; then
156+
script/setup/install-cni-windows
157+
cp bin/* ${DESTDIR}/
158+
fi
159+
working-directory: src/github.com/containerd/containerd
160+
161+
- name: Make cri-containerd tar
162+
shell: bash
163+
run: |
164+
TARFILE="cri-containerd-cni-${RELEASE_VER#v}-${OS}-amd64.tar.gz"
165+
[[ "${OS}" == "linux" ]] && tar czf ${TARFILE} etc usr opt
166+
[[ "${OS}" == "windows" ]] && tar czf ${TARFILE} *
167+
sha256sum ${TARFILE} >${TARFILE}.sha256sum
168+
working-directory: cri-release
169+
170+
- name: Save cri-containerd binaries
171+
uses: actions/upload-artifact@v2
172+
with:
173+
name: cri-containerd-binaries-${{ matrix.os }}
174+
path: cri-release/cri-containerd-cni-*.tar.gz*
175+
129176
release:
130177
name: Create containerd Release
131178
runs-on: ubuntu-18.04
@@ -142,8 +189,12 @@ jobs:
142189
run: |
143190
_filenum=1
144191
for i in "ubuntu-18.04" "windows-2019"; do
145-
for i in `ls builds/containerd-binaries-${i}`; do
146-
echo "::set-output name=file${_filenum}::${i}"
192+
for f in `ls builds/containerd-binaries-${i}`; do
193+
echo "::set-output name=file${_filenum}::${f}"
194+
let "_filenum+=1"
195+
done
196+
for f in `ls builds/cri-containerd-binaries-${i}`; do
197+
echo "::set-output name=file${_filenum}::${f}"
147198
let "_filenum+=1"
148199
done
149200
done
@@ -176,21 +227,57 @@ jobs:
176227
asset_path: ./builds/containerd-binaries-ubuntu-18.04/${{ steps.catalog.outputs.file2 }}
177228
asset_name: ${{ steps.catalog.outputs.file2 }}
178229
asset_content_type: text/plain
179-
- name: Upload Windows containerd tarball
230+
- name: Upload Linux cri containerd tarball
180231
uses: actions/upload-release-asset@v1
181232
env:
182233
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183234
with:
184235
upload_url: ${{ steps.create_release.outputs.upload_url }}
185-
asset_path: ./builds/containerd-binaries-windows-2019/${{ steps.catalog.outputs.file3 }}
236+
asset_path: ./builds/cri-containerd-binaries-ubuntu-18.04/${{ steps.catalog.outputs.file3 }}
186237
asset_name: ${{ steps.catalog.outputs.file3 }}
187238
asset_content_type: application/gzip
188-
- name: Upload Windows sha256 sum
239+
- name: Upload Linux cri sha256 sum
189240
uses: actions/upload-release-asset@v1
190241
env:
191242
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
192243
with:
193244
upload_url: ${{ steps.create_release.outputs.upload_url }}
194-
asset_path: ./builds/containerd-binaries-windows-2019/${{ steps.catalog.outputs.file4 }}
245+
asset_path: ./builds/cri-containerd-binaries-ubuntu-18.04/${{ steps.catalog.outputs.file4 }}
195246
asset_name: ${{ steps.catalog.outputs.file4 }}
196247
asset_content_type: text/plain
248+
- name: Upload Windows containerd tarball
249+
uses: actions/upload-release-asset@v1
250+
env:
251+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
252+
with:
253+
upload_url: ${{ steps.create_release.outputs.upload_url }}
254+
asset_path: ./builds/containerd-binaries-windows-2019/${{ steps.catalog.outputs.file5 }}
255+
asset_name: ${{ steps.catalog.outputs.file5 }}
256+
asset_content_type: application/gzip
257+
- name: Upload Windows sha256 sum
258+
uses: actions/upload-release-asset@v1
259+
env:
260+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
261+
with:
262+
upload_url: ${{ steps.create_release.outputs.upload_url }}
263+
asset_path: ./builds/containerd-binaries-windows-2019/${{ steps.catalog.outputs.file6 }}
264+
asset_name: ${{ steps.catalog.outputs.file6 }}
265+
asset_content_type: text/plain
266+
- name: Upload Windows cri containerd tarball
267+
uses: actions/upload-release-asset@v1
268+
env:
269+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
270+
with:
271+
upload_url: ${{ steps.create_release.outputs.upload_url }}
272+
asset_path: ./builds/cri-containerd-binaries-windows-2019/${{ steps.catalog.outputs.file7 }}
273+
asset_name: ${{ steps.catalog.outputs.file7 }}
274+
asset_content_type: application/gzip
275+
- name: Upload Windows cri sha256 sum
276+
uses: actions/upload-release-asset@v1
277+
env:
278+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
279+
with:
280+
upload_url: ${{ steps.create_release.outputs.upload_url }}
281+
asset_path: ./builds/cri-containerd-binaries-windows-2019/${{ steps.catalog.outputs.file8 }}
282+
asset_name: ${{ steps.catalog.outputs.file8 }}
283+
asset_content_type: text/plain

containerd.service

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Type=notify
1111
Delegate=yes
1212
KillMode=process
1313
Restart=always
14+
RestartSec=5
1415
# Having non-zero Limit*s causes performance problems due to accounting overhead
1516
# in the kernel. We recommend using cgroups to do container-local accounting.
1617
LimitNPROC=infinity
@@ -19,6 +20,7 @@ LimitNOFILE=1048576
1920
# Comment TasksMax if your systemd version does not supports it.
2021
# Only systemd 226 and above support this version.
2122
TasksMax=infinity
23+
OOMScoreAdjust=-999
2224

2325
[Install]
2426
WantedBy=multi-user.target

0 commit comments

Comments
 (0)