Enable Cerbero build in Gitlab CI
I've been playing around now long enough, here's a dump of what I'm heading for to enable Cerbero in the Gitlab CI. My goal is to reuse as much as possible of what @alatiera and @thiblahute have made, and make sure it blends well. And also to reuse as much as possible from Jenkins, as all the secret sauce are there. But also avoid the down side of contiguous builds when this does not imply waiting hours for the CI to complete.
I'm splitting my plan in different steps, Docker, Builds, and Cerbero.
This is related to #6 (closed) and #29 (closed)
Dockers
The plan is to generate dockers from gst-ci, so that we can reuse what is already exist and that all dockers will ends in the same registry. This part isn't very special, it is nearly identical to what we do now. I'm also starting with Fedora and I will expend when this first chain is working.
The design is that we will have dockers generated for cerbero builds. Instead of duplicating the bootstrapper, one change I do is that I clone and run the boostrap step in the Dockerfile. This installs all the OS dependencies, and external stuff like android NDK. It also builds the build-tools (for now, cerbero work is needed if we want to remove). We then cache the bootsrap in the docker. As of current implementation, a /bootstrap folder is create, and this is used at the initial value of build/ if the runner didn't provide a cache. It contains build-tools, build-tools.cache, .cache (cerbero downloads) and .ccache. I don't plan on adding run-time docker for now, I think cerbero should have a --runtime alternative to it's bootstrap for this to really make sense.
ToDo
-
Create build cerbero/Dockerfile-fedora -
Implement in cerbero.git builds -
Implement fast cerbero builds for other component
WIP exists already in https://gitlab.freedesktop.org/ndufresne/gst-ci branch cerbero-ci
Builds
The main issue with cerbero builds is that they slow on full rebuild (mainly due to repo configure time). On Jenkins CI, we have optimized this by doing contiguous builds (reusing previous state). That created some manual maintenance, which I'd like to avoid. Yet, I need something faster. So my plan is to have a stage in cerbero.git that generates builds from scratch. Those builds are special, they would build all the dependencies of gstreamer-1.0 package, but none of the recipes for GStreamer that are included in the CI (cerbero changes needed). The dist and .cache of that build would be uploaded as artifact.
Other builds would pick that artifact (by downloading the latest from cerbero.git artifacts store), and use that as it's initial state. Download cache and CCache are stored are normal runner cache as usual. The result should be that only the GStreamer reciepes needs to be built. This will still be slower then gst-build, as we don't benefit from the meson configure cache, and we install stuff unlike the gst-build, but no longer be massively slower. Unlike the previous method, we never start from a failed state either.
ToDo
-
Create cerbero/gitlab-ci.yml to implement dependency builds -
Update gst-ci/gitlab/ci_template.yml for the other component builds** -
Add cerbero to manifest and script to clone the same version of cerbero for all jobs in the pipeline
** Need not to forget the except: cerbero/
Cerbero
Some changes in cerbero are needed for this to work. Most are already written. And later there is some improvement we could do. Notably, not building the build-tools at the docker creation, because it will be done later anyway and cached in the runners.
ToDo
-
Bug: We should not need perl to run boostrap -
Allow non-interactive package installation -
Allow doing system bootstrap only -
Add a option to excludes recipes when building packages (build-deps command) -
Add a fetch-cache command for fast builds (WIP)
WIP exist in https://gitlab.freedesktop.org/ndufresne/cerbero.git branch cerbero-ci
Post Work
This is of course not the end. We'd all like to go further then Jenkins in automation. I'll keep collecting here what are the whish and/or post work.
-
Build "apps" from the cerbero artifacts (run them if possible) -
Run validate from cerbero artifacts -
Run gst* checks for native builds (in cerbero ?) -
Create releases artefacts on tags -
Integrate manifest2cerbero.py into cerbero -
Enable cross-mingw* -
Enable cross-android* -
Enable Windows builds (need runners) -
Enable OSX builds gst-ci!133 (merged) -
Enable IOS Builds gst-ci!138 (merged) -
Edit me !