Live video on the AT Protocol
1include: ".ci/dockerfile-hash.yaml"
2
3variables:
4 DOCKER_REPO: "975050346355.dkr.ecr.us-east-2.amazonaws.com/streamplace"
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 $TARGET && make desktop-$TARGET && make pkg-$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_TEST_COUNT: "1"
160 script:
161 - git fetch --unshallow || echo 'already unshallow'
162 - make dev-setup && make dev-test && make ci-lexicons
163 artifacts:
164 when: always
165 paths:
166 - test.xml
167 reports:
168 junit: test.xml
169
170build-docker-mistserver:
171 stage: build
172 interruptible: true
173 needs:
174 - job: build-linux-amd64
175 artifacts: true
176 image:
177 name: gcr.io/kaniko-project/executor:v1.14.0-debug
178 entrypoint: [""]
179 timeout: 2 hours
180 script:
181 - mkdir -p /kaniko/.docker
182 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
183 - /kaniko/executor
184 --build-arg TARGETARCH=amd64
185 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_AMD64
186 --context "${CI_PROJECT_DIR}"
187 --dockerfile "${CI_PROJECT_DIR}/docker/mistserver.Dockerfile"
188 --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-mistserver"
189 --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-mistserver"
190
191build-docker-amd64:
192 stage: build
193 interruptible: true
194 needs:
195 - job: build-linux-amd64
196 artifacts: true
197 image:
198 name: gcr.io/kaniko-project/executor:v1.14.0-debug
199 entrypoint: [""]
200 timeout: 2 hours
201 script:
202 - mkdir -p /kaniko/.docker
203 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
204 - /kaniko/executor
205 --build-arg TARGETARCH=amd64
206 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_AMD64
207 --context "${CI_PROJECT_DIR}"
208 --dockerfile "${CI_PROJECT_DIR}/docker/release.Dockerfile"
209 --destination "$CI_REGISTRY_IMAGE:$STREAMPLACE_BRANCH-amd64"
210 --destination "$CI_REGISTRY_IMAGE:$STREAMPLACE_VERSION-amd64"
211 --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-amd64"
212 --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-amd64"
213
214build-docker-arm64:
215 stage: build
216 interruptible: true
217 tags:
218 - linux
219 - arm64
220 needs:
221 - job: build-linux-arm64
222 artifacts: true
223 image:
224 name: gcr.io/kaniko-project/executor:v1.14.0-debug
225 entrypoint: [""]
226 timeout: 2 hours
227 script:
228 - mkdir -p /kaniko/.docker
229 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
230 - /kaniko/executor
231 --build-arg TARGETARCH=arm64
232 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_ARM64
233 --context "${CI_PROJECT_DIR}"
234 --dockerfile "${CI_PROJECT_DIR}/docker/release.Dockerfile"
235 --destination "$CI_REGISTRY_IMAGE:$STREAMPLACE_BRANCH-arm64"
236 --destination "$CI_REGISTRY_IMAGE:$STREAMPLACE_VERSION-arm64"
237 --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-arm64"
238 --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-arm64"
239 --customPlatform=linux/arm64
240
241build-docker-manifest:
242 stage: build
243 interruptible: true
244 image:
245 name: curlimages/curl:latest
246 entrypoint: [""]
247 needs:
248 - job: build-docker-arm64
249 - job: build-docker-amd64
250 - job: build-linux-amd64 # just for the environment variables
251 artifacts: true
252 before_script:
253 - curl -s -L https://github.com/estesp/manifest-tool/releases/download/v2.1.7/binaries-manifest-tool-2.1.7.tar.gz | tar xvz
254 - mv manifest-tool-linux-amd64 ./manifest-tool
255 - chmod +x ./manifest-tool
256 timeout: 2 hours
257 script:
258 - ./manifest-tool --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" push from-args
259 --platforms linux/amd64,linux/arm64
260 --template $CI_REGISTRY_IMAGE:$STREAMPLACE_VERSION-ARCH
261 --tags $STREAMPLACE_BRANCH
262 --target $CI_REGISTRY_IMAGE:$STREAMPLACE_VERSION
263
264.build-android:
265 stage: build
266 interruptible: true
267 image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
268 timeout: 2 hours
269 script:
270 - git fetch --unshallow || echo 'already unshallow'
271 - make $TARGET -j$(nproc)
272
273build-android-debug:
274 extends:
275 - .build-android
276 variables:
277 TARGET: ci-android-debug
278
279build-android-release:
280 extends:
281 - .build-android
282 variables:
283 TARGET: ci-android-release
284
285.build-on-mac:
286 stage: build
287 interruptible: true
288 image: macos-sonoma-xcode-big
289 tags:
290 - tart-installed
291 variables:
292 STREAMPLACE_TEST_COUNT: "1"
293 NODE_OPTIONS: "--max_old_space_size=4096"
294 timeout: 2 hours
295 script:
296 # workaround for https://gitlab.com/gitlab-org/gitlab/-/issues/501457
297 # which is a workaround for ios builds failing due to /tmp vs /private/tmp weirdness
298 - cd ..
299 - mv streamplace /Users/admin/streamplace
300 - cd /Users/admin/streamplace
301 - git fetch --unshallow || echo 'already unshallow'
302 - brew install ninja go openssl@3 && go version
303 - export PATH="/opt/homebrew/opt/node@22/bin:$PATH"
304 - brew install node@22
305 - node --version
306 - npm install -g corepack@latest --force
307 - corepack enable
308 - sudo gem uninstall xcodeproj -x --ignore-dependencies
309 - sudo gem install xcodeproj -v 1.25.1
310 - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && bash rustup.sh -y && rm rustup.sh
311 - export PATH="$PATH:$HOME/.cargo/bin"
312 - echo $PATH
313 - 'echo "which xcodeproj: $(which xcodeproj)"'
314 - 'echo "xcodeproj --version: $(xcodeproj --version)"'
315 - "$(which xcodeproj) --version"
316 - >
317 export GOTOOLCHAIN=go1.24.2
318 && python3 -m pip install virtualenv
319 && python3 -m virtualenv ~/venv
320 && source ~/venv/bin/activate
321 && python3 -m pip install meson
322 && ${=COMMAND}
323 # ^^ zsh-ism for running command with spaces
324
325build-ios:
326 extends:
327 - .build-on-mac
328 variables:
329 COMMAND: make ci-ios -j16
330
331build-desktop-darwin:
332 extends:
333 - .build-on-mac
334 needs:
335 - build-darwin-amd64
336 - build-darwin-arm64
337 variables:
338 COMMAND: make ci-desktop-darwin
339
340windows-selftest:
341 interruptible: true
342 stage: build
343 # for the moment...
344 tags:
345 - windows
346 timeout: 2 hours
347 needs:
348 - job: build-windows-amd64
349 artifacts: true
350 variables:
351 MSYSTEM: "MINGW32"
352 CHERE_INVOKING: "yes"
353 script:
354 - C:\msys64\usr\bin\bash -lc "bash -x ./util/windows-selftest.sh $STREAMPLACE_DESKTOP_URL_WINDOWS_AMD64"
355
356.release-template:
357 stage: build
358 interruptible: true
359 image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
360 needs:
361 - build-darwin-amd64
362 - build-darwin-arm64
363 - build-android-debug
364 - build-android-release
365 - build-docker-amd64
366 - build-docker-arm64
367 - build-docker-manifest
368 - build-desktop-darwin
369 - build-ios
370 - test
371 rules:
372 - if: '$CI_COMMIT_TAG =~ /^v?\d+\.\d+\.\d+$/'
373 timeout: 2 hours
374
375npm-release:
376 extends:
377 - .release-template
378 script:
379 - make ci-npm-release
380
381release:
382 extends:
383 - .release-template
384 script:
385 - make ci-release
386
387deb-release:
388 extends:
389 - .release-template
390 script:
391 - make ci-deb-release
392
393homebrew-release:
394 extends:
395 - .release-template
396 script:
397 - make ci-homebrew
398
399.report-status:
400 tags:
401 - tiny-job
402 interruptible: true
403 image:
404 name: curlimages/curl
405 entrypoint: [""]
406 variables:
407 STATUS_PROJECT: streamplace/streamplace
408 STATUS_NAME: git.stream.place
409 script:
410 # For complete details on the GitHub API please see:
411 # https://developer.github.com/v3/repos/statuses
412 - >
413 set -eu && curl -L
414 --fail-with-body
415 --silent
416 -X POST
417 -H "Accept: application/vnd.github+json"
418 -H "Authorization: Bearer $GITHUB_TOKEN"
419 -H "X-GitHub-Api-Version: 2022-11-28"
420 https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA}
421 -d '{"state":"'${CI_JOB_NAME}'","target_url":"'${CI_PIPELINE_URL}'","description":"'${STATUS_NAME}'","context":"'${STATUS_NAME}'"}'
422 environment:
423 name: reporting-github
424 dependencies: []
425
426pending:
427 stage: .pre
428 extends:
429 - .report-status
430
431success:
432 stage: .post
433 extends:
434 - .report-status
435
436failure:
437 stage: .post
438 extends:
439 - .report-status
440 rules:
441 - when: on_failure