-
Notifications
You must be signed in to change notification settings - Fork 76
98 lines (92 loc) · 3.75 KB
/
ci-basic.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
name: CI | Basic
on:
workflow_call:
inputs:
image-tag:
required: true
type: string
github-repository:
required: true
type: string
jobs:
run-ci-basic:
name: Run CI | Basic
runs-on: ubuntu-22.04
timeout-minutes: 10
container:
image: ghcr.io/${{ inputs.github-repository }}/overlaybd-ci-images:${{ inputs.image-tag }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
volumes:
- /dev:/dev
- /lib/modules:/lib/modules
- /sys/kernel/config:/sys/kernel/config
- /mnt:/var/lib/containerd
options: --privileged
steps:
- name: Start OverlayBD
working-directory: /app
shell: bash
run: |
set -x
bash start_services.sh
sleep 5s
ps axf | grep overlaybd
ps axf | grep containerd
lsmod | grep target
lsmod | grep overlay
mount | grep cgroup
cat /sys/fs/cgroup/cgroup.subtree_control
uname -a
containerd -v
runc -v
- name: CI - run overlaybd container
shell: bash
run: |
/opt/overlaybd/snapshotter/ctr rpull docker.io/overlaybd/redis:6.2.1_obd
ctr run -d --net-host --snapshotter=overlaybd docker.io/overlaybd/redis:6.2.1_obd test
ctr t ls | grep test
ctr t kill -s 9 test && sleep 5s && ctr t ls
ctr c rm test && ctr c ls
ctr i rm docker.io/overlaybd/redis:6.2.1_obd && ctr i ls
- name: CI - run overlaybd(zdfs) container
shell: bash
run: |
set -x
ctr i pull registry-1.docker.io/overlaybd/redis:7.2.3_obd_zdfsRef
if [[ ! -f /opt/overlaybd/baselayers/.commit ]]; then
ln /opt/overlaybd/baselayers/ext4_64 /opt/overlaybd/baselayers/.commit
fi
ctr run -d --net-host --snapshotter=overlaybd --snapshotter-label='containerd.io/snapshot/cri.image-ref:registry-1.docker.io/overlaybd/redis:7.2.3_obd_zdfsRef' registry-1.docker.io/overlaybd/redis:7.2.3_obd_zdfsRef test
ctr t ls | grep test
ctr t kill -s 9 test && sleep 5s && ctr t ls
ctr c rm test && ctr c ls
ctr i rm registry-1.docker.io/overlaybd/redis:7.2.3_obd_zdfsRef && ctr i ls
- name: CI - obdconv
shell: bash
run: |
ctr i pull registry.hub.docker.com/library/redis:6.2.1
/opt/overlaybd/snapshotter/ctr obdconv registry.hub.docker.com/library/redis:6.2.1 registry.hub.docker.com/overlaybd/redis:6.2.1_obd_new
ctr i ls | grep 6.2.1_obd_new
- name: CI - record trace
shell: bash
run: |
set -x
/opt/overlaybd/snapshotter/ctr rpull registry.hub.docker.com/overlaybd/redis:6.2.1_obdconv
echo "[ by record-trace ]"
/opt/overlaybd/snapshotter/ctr record-trace --runtime "io.containerd.runc.v2" --disable-network-isolation --time 15 registry.hub.docker.com/overlaybd/redis:6.2.1_obdconv registry.hub.docker.com/overlaybd/redis:6.2.1_obdconv_trace
ctr i ls | grep 6.2.1_obdconv_trace
sleep 10s # wait for tcmu device to be removed
echo "[ by label ]"
touch /tmp/trace_file
ctr run -d --snapshotter=overlaybd --snapshotter-label containerd.io/snapshot/overlaybd/record-trace=yes --snapshotter-label containerd.io/snapshot/overlaybd/record-trace-path=/tmp/trace_file registry.hub.docker.com/overlaybd/redis:6.2.1_obdconv demo
sleep 1s
ls -l /tmp/ | grep trace_file.lock
sleep 15s
ctr t ls | grep demo
ctr t kill -s 9 demo && sleep 5s && ctr t ls
ctr c rm demo && ctr c ls
sleep 1s
ls -l /tmp/ | grep trace_file.ok
ctr i ls