Live video on the AT Protocol
1include: ".ci/dockerfile-hash.yaml"
2
3variables:
4 DOCKER_REPO: "us-central1-docker.pkg.dev/aquareum-tv/streamplace/build"
5
6build-bunny:
7 stage: build
8 interruptible: true
9 image:
10 name: gcr.io/kaniko-project/executor:v1.14.0-debug
11 entrypoint: [""]
12 timeout: 2 hours
13 script:
14 - mkdir -p /kaniko/.docker
15 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
16 - /kaniko/executor
17 --context "${CI_PROJECT_DIR}/docker"
18 --dockerfile "${CI_PROJECT_DIR}/docker/bunny.Dockerfile"
19 --destination "$DOCKER_REPO:bunny"
20
21builder:
22 stage: build
23 interruptible: true
24 allow_failure: true
25 image:
26 name: gcr.io/kaniko-project/executor:v1.14.0-debug
27 entrypoint: [""]
28 variables:
29 FQ_IMAGE_NAME: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
30 TARGET: builder
31 timeout: 2 hours
32 script:
33 - mkdir -p /kaniko/.docker
34 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
35 - /kaniko/executor
36 --build-arg TARGETARCH=amd64
37 --build-arg DOCKERFILE_HASH=$DOCKERFILE_HASH
38 --cache=true
39 --context "${CI_PROJECT_DIR}"
40 --dockerfile "${CI_PROJECT_DIR}/docker/build.Dockerfile"
41 --destination "$FQ_IMAGE_NAME"
42 --target "$TARGET"
43
44builder-rebuild:
45 tags:
46 - tiny-job
47 stage: build
48 allow_failure: true
49 interruptible: true
50 image:
51 name: curlimages/curl:latest
52 entrypoint: [""]
53 needs:
54 - job: builder
55 timeout: 2 hours
56 script:
57 - echo "CI_PIPELINE_ID=$CI_PIPELINE_ID"
58 - echo "CI_PIPELINE_ID=$CI_PIPELINE_IID"
59 - echo "CI_PROJECT_ID=$CI_PROJECT_ID"
60 - >
61 curl
62 --data-raw '{"project_id": "'$CI_PROJECT_ID'", "pipeline_id": "'$CI_PIPELINE_ID'", "job_token": "'$CI_JOB_TOKEN'"}'
63 --fail-with-body
64 https://retry-gitlab.iameli.workers.dev/
65
66.build:
67 stage: build
68 interruptible: true
69 image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
70 timeout: 2 hours
71 script:
72 - rm -rf /usr/x86_64-w64-mingw32/include/d3dcompiler.h /usr/share/mingw-w64/include/d3dcompiler.h /usr/lib/gcc/x86_64-w64-mingw32/10-posix/libssp.dll.a /usr/lib/gcc/x86_64-w64-mingw32/10-posix/libssp-0.dll /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libssp-0.dll /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libssp.dll.a
73 - git fetch --unshallow || echo 'already unshallow'
74 - bash -c "make version && make app && make $TARGET && make desktop-$TARGET && make ci-upload-node-$TARGET -j$(nproc)"
75 artifacts:
76 reports:
77 dotenv: .ci/build.env
78
79build-linux-amd64:
80 extends:
81 - .build
82 variables:
83 TARGET: linux-amd64
84
85build-linux-arm64:
86 extends:
87 - .build
88 variables:
89 TARGET: linux-arm64
90
91build-windows-amd64:
92 extends:
93 - .build
94 variables:
95 TARGET: windows-amd64
96
97build-darwin-arm64:
98 extends:
99 - .build
100 variables:
101 TARGET: darwin-arm64
102
103build-darwin-amd64:
104 extends:
105 - .build
106 variables:
107 TARGET: darwin-amd64
108
109leak-test-viewers:
110 stage: build
111 interruptible: true
112 needs:
113 - job: build-linux-amd64
114 artifacts: true
115 - job: build-bunny
116 image:
117 name: "$DOCKER_REPO:bunny"
118 variables:
119 SP_WIDE_OPEN: "true"
120 SP_NO_FIREHOSE: "true"
121 SP_WHIP_TEST: "--file=/bunny.mp4 --count=1 --viewers=50 --duration=5m"
122 KUBERNETES_MEMORY_REQUEST: "2Gi"
123 KUBERNETES_MEMORY_LIMIT: "2Gi"
124 GOGC: "20"
125 GOMEMLIMIT: "2GiB"
126 timeout: "10 minutes"
127 allow_failure: true
128 script:
129 - /bunny.sh
130
131leak-test-streamers:
132 stage: build
133 interruptible: true
134 needs:
135 - job: build-linux-amd64
136 artifacts: true
137 - job: build-bunny
138 image:
139 name: "$DOCKER_REPO:bunny"
140 variables:
141 SP_WIDE_OPEN: "true"
142 SP_NO_FIREHOSE: "true"
143 SP_WHIP_TEST: "--file=/bunny.mp4 --count=10 --duration=5m"
144 KUBERNETES_MEMORY_REQUEST: "2Gi"
145 KUBERNETES_MEMORY_LIMIT: "2Gi"
146 GOGC: "20"
147 GOMEMLIMIT: "2GiB"
148 timeout: "10 minutes"
149 allow_failure: true
150 script:
151 - /bunny.sh
152
153test:
154 stage: build
155 interruptible: true
156 image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
157 timeout: 2 hours
158 variables:
159 STREAMPLACE_IGNORE_LEAKS: "true"
160 STREAMPLACE_TEST_COUNT: "1"
161 script:
162 - git fetch --unshallow || echo 'already unshallow'
163 - make ci-test -j$(nproc) && make ci-lexicons
164
165build-docker-mistserver:
166 stage: build
167 interruptible: true
168 needs:
169 - job: build-linux-amd64
170 artifacts: true
171 image:
172 name: gcr.io/kaniko-project/executor:v1.14.0-debug
173 entrypoint: [""]
174 timeout: 2 hours
175 script:
176 - mkdir -p /kaniko/.docker
177 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
178 - /kaniko/executor
179 --build-arg TARGETARCH=amd64
180 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_AMD64
181 --context "${CI_PROJECT_DIR}"
182 --dockerfile "${CI_PROJECT_DIR}/docker/mistserver.Dockerfile"
183 --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-mistserver"
184 --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-mistserver"
185
186build-docker-amd64:
187 stage: build
188 interruptible: true
189 needs:
190 - job: build-linux-amd64
191 artifacts: true
192 image:
193 name: gcr.io/kaniko-project/executor:v1.14.0-debug
194 entrypoint: [""]
195 timeout: 2 hours
196 script:
197 - mkdir -p /kaniko/.docker
198 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
199 - /kaniko/executor
200 --build-arg TARGETARCH=amd64
201 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_AMD64
202 --context "${CI_PROJECT_DIR}"
203 --dockerfile "${CI_PROJECT_DIR}/docker/release.Dockerfile"
204 --destination "$CI_REGISTRY_IMAGE:$STREAMPLACE_BRANCH-amd64"
205 --destination "$CI_REGISTRY_IMAGE:$STREAMPLACE_VERSION-amd64"
206 --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-amd64"
207 --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-amd64"
208
209build-docker-arm64:
210 stage: build
211 interruptible: true
212 tags:
213 - linux
214 - arm64
215 needs:
216 - job: build-linux-arm64
217 artifacts: true
218 image:
219 name: gcr.io/kaniko-project/executor:v1.14.0-debug
220 entrypoint: [""]
221 timeout: 2 hours
222 script:
223 - mkdir -p /kaniko/.docker
224 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
225 - /kaniko/executor
226 --build-arg TARGETARCH=arm64
227 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_ARM64
228 --context "${CI_PROJECT_DIR}"
229 --dockerfile "${CI_PROJECT_DIR}/docker/release.Dockerfile"
230 --destination "$CI_REGISTRY_IMAGE:$STREAMPLACE_BRANCH-arm64"
231 --destination "$CI_REGISTRY_IMAGE:$STREAMPLACE_VERSION-arm64"
232 --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-arm64"
233 --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-arm64"
234 --customPlatform=linux/arm64
235
236build-docker-manifest:
237 stage: build
238 interruptible: true
239 image:
240 name: curlimages/curl:latest
241 entrypoint: [""]
242 needs:
243 - job: build-docker-arm64
244 - job: build-docker-amd64
245 - job: build-linux-amd64 # just for the environment variables
246 artifacts: true
247 before_script:
248 - curl -s -L https://github.com/estesp/manifest-tool/releases/download/v2.1.7/binaries-manifest-tool-2.1.7.tar.gz | tar xvz
249 - mv manifest-tool-linux-amd64 ./manifest-tool
250 - chmod +x ./manifest-tool
251 timeout: 2 hours
252 script:
253 - ./manifest-tool --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" push from-args
254 --platforms linux/amd64,linux/arm64
255 --template $CI_REGISTRY_IMAGE:$STREAMPLACE_VERSION-ARCH
256 --tags $STREAMPLACE_BRANCH
257 --target $CI_REGISTRY_IMAGE:$STREAMPLACE_VERSION
258
259.build-android:
260 stage: build
261 interruptible: true
262 image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
263 timeout: 2 hours
264 script:
265 - git fetch --unshallow || echo 'already unshallow'
266 - make $TARGET -j$(nproc)
267
268build-android-debug:
269 extends:
270 - .build-android
271 variables:
272 TARGET: ci-android-debug
273
274build-android-release:
275 extends:
276 - .build-android
277 variables:
278 TARGET: ci-android-release
279
280.build-on-mac:
281 stage: build
282 interruptible: true
283 image: macos-sonoma-xcode-big
284 tags:
285 - tart-installed
286 variables:
287 STREAMPLACE_IGNORE_LEAKS: "true"
288 STREAMPLACE_TEST_COUNT: "1"
289 NODE_OPTIONS: "--max_old_space_size=4096"
290 timeout: 2 hours
291 script:
292 # workaround for https://gitlab.com/gitlab-org/gitlab/-/issues/501457
293 # which is a workaround for ios builds failing due to /tmp vs /private/tmp weirdness
294 - cd ..
295 - mv streamplace /Users/admin/streamplace
296 - cd /Users/admin/streamplace
297 - git fetch --unshallow || echo 'already unshallow'
298 - brew install ninja go openssl@3 && go version
299 - export PATH="/opt/homebrew/opt/node@22/bin:$PATH"
300 - brew install node@22
301 - node --version
302 - npm install -g corepack@latest --force
303 - corepack enable
304 - sudo gem uninstall xcodeproj -x --ignore-dependencies
305 - sudo gem install xcodeproj -v 1.25.1
306 - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && bash rustup.sh -y && rm rustup.sh
307 - export PATH="$PATH:$HOME/.cargo/bin"
308 - echo $PATH
309 - 'echo "which xcodeproj: $(which xcodeproj)"'
310 - 'echo "xcodeproj --version: $(xcodeproj --version)"'
311 - "$(which xcodeproj) --version"
312 - >
313 export GOTOOLCHAIN=go1.24.2
314 && python3 -m pip install virtualenv
315 && python3 -m virtualenv ~/venv
316 && source ~/venv/bin/activate
317 && python3 -m pip install meson
318 && ${=COMMAND}
319 # ^^ zsh-ism for running command with spaces
320
321build-ios:
322 extends:
323 - .build-on-mac
324 variables:
325 COMMAND: make ci-ios -j16
326
327build-desktop-darwin:
328 extends:
329 - .build-on-mac
330 needs:
331 - build-darwin-amd64
332 - build-darwin-arm64
333 variables:
334 COMMAND: make ci-desktop-darwin
335
336windows-selftest:
337 interruptible: true
338 allow_failure: true
339 stage: build
340 # for the moment...
341 tags:
342 - windows
343 timeout: 2 hours
344 needs:
345 - job: build-windows-amd64
346 artifacts: true
347 variables:
348 MSYSTEM: "MINGW32"
349 CHERE_INVOKING: "yes"
350 script:
351 - C:\msys64\usr\bin\bash -lc "bash -x ./util/windows-selftest.sh $STREAMPLACE_DESKTOP_URL_WINDOWS_AMD64"
352
353release:
354 stage: build
355 interruptible: true
356 image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
357 needs:
358 - build-darwin-amd64
359 - build-darwin-arm64
360 - build-android-debug
361 - build-android-release
362 - build-docker-amd64
363 - build-docker-arm64
364 - build-docker-manifest
365 - test
366 rules:
367 - if: '$CI_COMMIT_TAG =~ /^v?\d+\.\d+\.\d+$/'
368 timeout: 2 hours
369 script:
370 - make ci-release
371
372.report-status:
373 tags:
374 - tiny-job
375 interruptible: true
376 image:
377 name: curlimages/curl
378 entrypoint: [""]
379 variables:
380 STATUS_PROJECT: streamplace/streamplace
381 STATUS_NAME: git.stream.place
382 script:
383 # For complete details on the GitHub API please see:
384 # https://developer.github.com/v3/repos/statuses
385 - >
386 set -eu && curl -L
387 --fail-with-body
388 --silent
389 -X POST
390 -H "Accept: application/vnd.github+json"
391 -H "Authorization: Bearer $GITHUB_TOKEN"
392 -H "X-GitHub-Api-Version: 2022-11-28"
393 https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA}
394 -d '{"state":"'${CI_JOB_NAME}'","target_url":"'${CI_PIPELINE_URL}'","description":"'${STATUS_NAME}'","context":"'${STATUS_NAME}'"}'
395 environment:
396 name: reporting-github
397 dependencies: []
398
399pending:
400 stage: .pre
401 extends:
402 - .report-status
403
404success:
405 stage: .post
406 extends:
407 - .report-status
408
409failure:
410 stage: .post
411 extends:
412 - .report-status
413 rules:
414 - when: on_failure