forked from mayadata-io/cstor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
177 lines (174 loc) · 6.58 KB
/
.gitlab-ci.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
stages:
- build
- baseline
build-cstor-0:
stage: build
only:
refs:
- /^(v[0-9][.][0-9][.]x|develop)?$/
before_script:
- echo $HOME
- export BRANCH=${CI_COMMIT_REF_NAME}
- echo $BRANCH
- export COMMIT=${CI_COMMIT_SHORT_SHA}
- echo $FIO_SRCDIR
- apt-get update
- apt-get install --yes sudo git-core
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install --yes -qq gcc-6 g++-6
- sudo apt-get install --yes -qq build-essential autoconf libtool gawk alien fakeroot linux-headers-$(uname -r) libaio-dev
- sudo apt-get install --yes -qq zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev libjson-c-dev
- sudo apt-get install --yes -qq lcov libjemalloc-dev libelf-dev net-tools bc kmod linux-modules-4.15.0-1025-gcp
# packages for tests
- sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio
- sudo apt-get install --yes -qq libgtest-dev cmake
# packages for debugging
- sudo apt-get install --yes gdb
# use gcc-6 by default
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-6 /usr/bin/gcc
- sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-6 /usr/bin/g++
- echo "CSTOR"
- echo $COMMIT
- pushd .
- cd /usr/src/gtest
- sudo cmake CMakeLists.txt
- sudo make -j4
- sudo cp *.a /usr/lib
- popd
- cd ..
# we need fio repo to build zfs replica fio engine
- git clone https://github.com/axboe/fio
- cd fio
- git checkout fio-3.7
- ./configure
- sudo make -j4
- cd ..
- git clone https://github.com/openebs/spl
- cd spl
- git checkout spl-0.7.9
- sudo sh autogen.sh
- ./configure
- cd ..
# Build libcstor for uzfs feature
- git clone https://github.com/openebs/libcstor.git
- cd libcstor
- sh autogen.sh
- ./configure --enable-debug --with-zfs-headers=$PWD/../cstor/include --with-spl-headers=$PWD/../cstor/lib/libspl/include
- sudo make -j4
- sudo make install
- sudo ldconfig
# return to cstor code
- sh autogen.sh
script:
- make -j4
- cd ../cstor
- sh autogen.sh
- echo $PWD
- ./configure --with-config=user --enable-code-coverage=yes --enable-debug --enable-uzfs=yes --with-jemalloc --with-fio=$PWD/../fio --with-libcstor=$PWD/../libcstor/include
- make -j4
- make cstyle
- export FIO_SRCDIR=$PWD/../fio
- echo $FIO_SRCDIR
# - sudo bash ./print_debug_info.sh &
# - bash ./tests/cbtest/script/test_uzfs.sh -T all
- ./build_image.sh
build-cstor-1:
stage: build
only:
refs:
- /^(v[0-9][.][0-9][.]x|develop)?$/
before_script:
- echo $HOME
- export BRANCH=${CI_COMMIT_REF_NAME}
- echo $BRANCH
- export COMMIT=${CI_COMMIT_SHORT_SHA}
- echo $FIO_SRCDIR
- apt-get update
- apt-get install --yes sudo git-core
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install --yes -qq gcc-6 g++-6
- sudo apt-get install --yes -qq build-essential autoconf libtool gawk alien fakeroot linux-headers-$(uname -r) libaio-dev
- sudo apt-get install --yes -qq zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev libjson-c-dev
- sudo apt-get install --yes -qq lcov libjemalloc-dev libelf-dev net-tools bc kmod linux-modules-4.15.0-1025-gcp
# packages for tests
- sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio
- sudo apt-get install --yes -qq libgtest-dev cmake
# packages for debugging
- sudo apt-get install --yes gdb
# use gcc-6 by default
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-6 /usr/bin/gcc
- sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-6 /usr/bin/g++
- echo "CSTOR"
- echo $COMMIT
- pushd .
- cd /usr/src/gtest
- sudo cmake CMakeLists.txt
- sudo make -j4
- sudo cp *.a /usr/lib
- popd
- cd ..
# we need fio repo to build zfs replica fio engine
- git clone https://github.com/axboe/fio
- cd fio
- git checkout fio-3.7
- ./configure
- sudo make -j4
- cd ..
- git clone https://github.com/openebs/spl
- cd spl
- git checkout spl-0.7.9
- sudo sh autogen.sh
- ./configure
- make --no-print-directory -s pkg-utils pkg-kmod
- sudo dpkg -i *.deb
- cd ..
# Build libcstor for uzfs feature
- git clone https://github.com/openebs/libcstor.git
- cd libcstor
- sh autogen.sh
- ./configure --enable-debug --with-zfs-headers=$PWD/../cstor/include --with-spl-headers=$PWD/../cstor/lib/libspl/include
- sudo make -j4
- sudo make install
- sudo ldconfig
# return to cstor code
- cd ../cstor
script:
- sh autogen.sh
- ./configure --enable-code-coverage=yes --enable-debug
- make --no-print-directory -s pkg-utils pkg-kmod
- sudo dpkg -i *.deb
- make cstyle
- sudo /sbin/modprobe zfs
- /sbin/ztest
baseline-image:
stage: baseline
only:
refs:
- /^(v[0-9][.][0-9][.]x|develop)?$/
image: atulabhi/kops:v10
before_script: []
script:
- pwd
- apt-get update
- apt-get install --yes git-core
- git config --global user.name "OpenEBS CI Bot"
- git config --global user.email openebscibot@openebs.io
- export BRANCH=${CI_COMMIT_REF_NAME}
- echo $BRANCH
- export COMMIT=${CI_COMMIT_SHORT_SHA}
- echo $COMMIT
- git clone https://github.com/$REPO/e2e-infrastructure.git
- if [[ "$BRANCH" == "develop" ]] ; then git checkout master ; else git checkout $BRANCH ; fi
- cd e2e-infrastructure/baseline
- ansible-playbook commit-writer.yml --extra-vars "branch=$BRANCH repo=$CI_PROJECT_NAME commit=$COMMIT"
- git status
- git add baseline
- git status
- git commit -m "updated $CI_PROJECT_NAME commit:$COMMIT"
- git push https://$user:$pass@github.com/$REPO/e2e-infrastructure.git --all
- if [[ "$BRANCH" == "develop" ]] ; then export INFRA="master" ; else export INFRA=$BRANCH ; fi
# - curl -X POST -F variable[INFRA_BRANCH]=$INFRA -F token=$PACKET -F ref=k8s-ultimate https://gitlab.openebs.ci/api/v4/projects/27/trigger/pipeline
# - curl -X POST -F variable[INFRA_BRANCH]=$INFRA -F token=$PACKET -F ref=k8s-penultimate https://gitlab.openebs.ci/api/v4/projects/27/trigger/pipeline
# - curl -X POST -F variable[INFRA_BRANCH]=$INFRA -F token=$PACKET -F ref=k8s-antepenultimate https://gitlab.openebs.ci/api/v4/projects/27/trigger/pipeline