forked from cowsql/raft
-
Notifications
You must be signed in to change notification settings - Fork 0
277 lines (240 loc) · 8.24 KB
/
downstream.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
name: Downstream
on:
push:
tags:
- '**'
pull_request:
types: [ labeled, opened, synchronize, reopened ]
jobs:
cowsql:
if: contains(github.event.pull_request.labels.*.name, 'downstream')
runs-on: ubuntu-22.04
steps:
- name: Install apt deps
run: |
sudo apt-get update -qq
sudo apt-get install -qq automake libtool gcc make libuv1-dev libsqlite3-dev
- name: Check out raft
uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.number }}/head
path: raft
- name: Install raft
run: |
cd raft
autoreconf -i
./configure --prefix=/usr --enable-debug --enable-uv --enable-sanitize --enable-backtrace
sudo make -j$(nproc) install
- name: Check out cowsql
uses: actions/checkout@v3
with:
repository: cowsql/cowsql
path: cowsql
- name: Test and install cowsql
run: |
cd cowsql
autoreconf -i
./configure --prefix=/usr --enable-debug --enable-sanitize --enable-backtrace
sudo make -j$(nproc) check || (cat ./test-suite.log && false)
sudo make install
- name: Install Go
uses: actions/setup-go@v4
- name: Check out go-cowsql
uses: actions/checkout@v3
with:
repository: cowsql/go-cowsql
path: go-cowsql
- name: Test go-cowsql
env:
GO_DQLITE_MULTITHREAD: '1'
run: |
cd go-cowsql
go get -tags libsqlite3 -t ./...
go test -asan -v ./...
VERBOSE=1 ASAN=-asan ./test/cowsql-demo.sh
VERBOSE=1 ASAN=-asan ./test/roles.sh
VERBOSE=1 ASAN=-asan ./test/recover.sh
dqlite:
if: contains(github.event.pull_request.labels.*.name, 'downstream')
runs-on: ubuntu-22.04
steps:
- name: Install apt deps
run: |
sudo apt-get update -qq
sudo apt-get install -qq automake libtool gcc make libuv1-dev libsqlite3-dev
- name: Check out raft
uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.number }}/head
path: raft
- name: Install raft
run: |
cd raft
autoreconf -i
./configure --prefix=/usr --enable-debug --enable-uv --enable-sanitize --enable-backtrace
sudo make -j$(nproc) install
- name: Check out dqlite
uses: actions/checkout@v3
with:
repository: canonical/dqlite
ref: v1.16.0
path: dqlite
- name: Test and install dqlite
run: |
cd dqlite
autoreconf -i
./configure --prefix=/usr --enable-debug --enable-sanitize --enable-backtrace
sudo make -j$(nproc) check || (cat ./test-suite.log && false)
sudo make install
- name: Install Go
uses: actions/setup-go@v4
- name: Check out go-dqlite
uses: actions/checkout@v3
with:
repository: canonical/go-dqlite
path: go-dqlite
- name: Test go-dqlite
env:
GO_DQLITE_MULTITHREAD: '1'
run: |
cd go-dqlite
go get -tags libsqlite3 -t ./...
go test -asan -v ./...
VERBOSE=1 ASAN=-asan ./test/dqlite-demo.sh
VERBOSE=1 ASAN=-asan ./test/roles.sh
VERBOSE=1 ASAN=-asan ./test/recover.sh
incus:
if: contains(github.event.pull_request.labels.*.name, 'downstream')
runs-on: ubuntu-22.04
env:
CGO_LDFLAGS_ALLOW: "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
INCUS_SHIFTFS_DISABLE: "true"
INCUS_VERBOSE: "1"
INCUS_OFFLINE: "1"
INCUS_TMPFS: "1"
INCUS_REQUIRED_TESTS: "test_storage_buckets"
strategy:
fail-fast: false
matrix:
suite: ["cluster", "standalone"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: lxc/incus
- name: Install Go
uses: actions/setup-go@v4
- name: Install dependencies
run: |
set -x
sudo add-apt-repository ppa:ubuntu-lxc/lxc-git-master -y --no-update
sudo apt-get update
sudo snap remove lxd --purge
sudo snap remove core20 --purge || true
sudo apt-get autopurge moby-containerd docker uidmap -y
sudo ip link delete docker0
sudo nft flush ruleset
sudo systemctl mask lxc.service
sudo systemctl mask lxc-net.service
sudo apt-get install --no-install-recommends -y \
curl \
git \
libacl1-dev \
libcap-dev \
libdbus-1-dev \
liblxc-dev \
libseccomp-dev \
libselinux-dev \
libsqlite3-dev \
libtool \
libudev-dev \
libuv1-dev \
automake \
make \
pkg-config\
acl \
attr \
bind9-dnsutils \
btrfs-progs \
busybox-static \
dnsmasq-base \
easy-rsa \
gettext \
jq \
lxc-utils \
lvm2 \
nftables \
quota \
rsync \
s3cmd \
socat \
sqlite3 \
squashfs-tools \
tar \
tcl \
thin-provisioning-tools \
uuid-runtime \
xfsprogs \
xz-utils \
zfsutils-linux
# reclaim some space
sudo apt-get clean
# Download minio.
curl -sSfL https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20240116160738.0.0_amd64.deb --output /tmp/minio.deb
sudo apt-get install /tmp/minio.deb --yes
# Download MinIO client
curl -sSfL https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2024-01-16T16-06-34Z --output /tmp/mc
sudo mv /tmp/mc /usr/local/bin/
sudo chmod +x /usr/local/bin/mc
# Download latest release of openfga server.
mkdir -p "$(go env GOPATH)/bin"
curl -sSfL https://api.github.com/repos/openfga/openfga/releases/latest | jq -r '.assets | .[] | .browser_download_url | select(. | test("_linux_amd64.tar.gz$"))' | xargs -I {} curl -sSfL {} -o openfga.tar.gz
tar -xzf openfga.tar.gz -C "$(go env GOPATH)/bin/"
# Download latest release of openfga cli.
curl -sSfL https://api.github.com/repos/openfga/cli/releases/latest | jq -r '.assets | .[] | .browser_download_url | select(. | test("_linux_amd64.tar.gz$"))' | xargs -I {} curl -sSfL {} -o fga.tar.gz
tar -xzf fga.tar.gz -C "$(go env GOPATH)/bin/"
- name: Check out raft
uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.number }}/head
path: raft
- name: Install raft
run: |
cd raft
autoreconf -i
./configure --prefix=/usr --enable-debug --enable-backtrace
sudo make -j$(nproc) install
- name: Check out cowsql
uses: actions/checkout@v3
with:
repository: cowsql/cowsql
path: cowsql
- name: Install cowsql
run: |
cd cowsql
autoreconf -i
./configure --prefix=/usr --enable-debug --enable-backtrace
sudo make -j$(nproc) install
- name: Download go dependencies
run: |
go mod download
- name: Run Incus build
run: |
make
- name: "Run system tests"
run: |
chmod +x ~
echo "root:1000000:1000000000" | sudo tee /etc/subuid /etc/subgid
cd test
sudo --preserve-env=PATH,GOPATH,GITHUB_ACTIONS,INCUS_VERBOSE,INCUS_BACKEND,INCUS_OFFLINE,INCUS_SKIP_TESTS,INCUS_REQUIRED_TESTS,INCUS_SHIFTFS_DISABLE INCUS_BACKEND=dir ./main.sh ${{ matrix.suite }}
jepsen:
if: contains(github.event.pull_request.labels.*.name, 'downstream')
uses: cowsql/jepsen.cowsql/.github/workflows/test-build-run.yml@main
with:
raft-ref: refs/pull/${{ github.event.number }}/head
workloads: >
['append', 'bank', 'set']
nemeses: >
['none', 'partition', 'kill', 'stop', 'disk', 'member',
'partition,stop', 'partition,kill', 'partition,member',
'packet,stop', 'pause']