[pitivi/sdk] ci: Replace docker with podman
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/sdk] ci: Replace docker with podman
- Date: Sat, 19 Dec 2020 21:44:24 +0000 (UTC)
commit a3ec89e4c3b07e7691410dc30ef3f354fe60f082
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Sat Dec 5 01:47:06 2020 +0100
ci: Replace docker with podman
Fixes #2492
.gitlab-ci.yml | 78 ++++++++++++++++++++++++++++------------------------------
runner | 19 ++++++++++++++
2 files changed, 56 insertions(+), 41 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index da94bcc1a..b3e195b37 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,77 +1,74 @@
---
stages:
- - docker_image
- - build
+ - image
+ - tests
- deploy
variables:
- MANIFEST: build/flatpak/org.pitivi.Pitivi.json
+ FLATPAK_BUILDER_CACHE: /root/pitivi-flatpak-cache
DBUS_ID: org.pitivi.Pitivi
XUNIT_PATH: ${CI_PROJECT_DIR}/xunit.xml
GST_DEBUG_NO_COLOR: "true"
-
pitivi:master:
- stage: docker_image
+ stage: image
tags:
+ - docker
+ - pitivi
- privileged
- image: docker:latest
- variables:
- DOCKER_DRIVER: overlay2
- DOCKER_TLS_CERTDIR: ""
- services:
- - docker:19.03.0-dind
+ image: registry.gitlab.gnome.org/infrastructure/docker/buildah:latest
script:
- # https://stackoverflow.com/questions/2264428/converting-string-to-lower-case-in-bash#2264537
- - export NAMESPACE="$(echo "${CI_PROJECT_NAMESPACE}" | tr A-Z a-z)"
- - export BRANCH=master
- - export IMAGE="${CI_REGISTRY}/${NAMESPACE}/${CI_PROJECT_NAME}:${BRANCH}-sdk_3.36"
- - export BASE_IMAGE="registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.36"
- - export TMPIMAGENAME="tmp-pitivi-${BRANCH}-sdk_3.36"
- - export BUILDDIR="\${HOME}/pitivi"
- - export CLONE_PITIVI="git clone ${CI_PROJECT_URL}.git --single-branch \${HOME}/pitivi -b
${CI_COMMIT_REF_NAME}"
- - export BUILD_PITIVI="flatpak-builder --user --disable-rofiles-fuse ${BUILDDIR}/app
${BUILDDIR}/build/flatpak/org.pitivi.Pitivi.json --state-dir=\${HOME}/flatpak-cache --ccache"
-
+ # Debug
+ # https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
- env
+ - whoami
+ - pwd
+ - ls -al
+ - ls -al /root
- - docker run --privileged --name ${TMPIMAGENAME} ${BASE_IMAGE} bash -c "${CLONE_PITIVI} &&
${BUILD_PITIVI} && rm -Rf ${BUILDDIR}"
- - docker commit ${TMPIMAGENAME} ${IMAGE}
- - docker rm ${TMPIMAGENAME}
- - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- - docker push ${IMAGE}
+ - buildah login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
+
+ # Create an image with the flatpak-builder cache populated.
+ # This allows rebuilding the sandbox quickly when running the tests.
+ - export DOCKERIMAGE="registry.gitlab.gnome.org/gnome/pitivi:master-sdk_3.38"
+ - buildah bud --isolation=chroot --format=docker --build-arg CI_PROJECT_URL=${CI_PROJECT_URL}
--build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --build-arg
FLATPAK_BUILDER_CACHE=${FLATPAK_BUILDER_CACHE} -f ./runner -t ${DOCKERIMAGE} ${DIR}
+ - buildah push ${DOCKERIMAGE}
only:
- triggers
- schedules
retry: 1
-build:
- stage: build
+tests:
+ stage: tests
tags:
- flatpak
- image: registry.gitlab.gnome.org/gnome/pitivi:master-sdk_3.36
+ image: registry.gitlab.gnome.org/gnome/pitivi:master-sdk_3.38
variables:
BLACKLIST: >
-b tests.test_effects.EffectsPropertiesManagerTest.test_dependent_properties
script:
- - export BUILDDIR=${HOME}/pitivi
- - export MANIFEST=${BUILDDIR}/build/flatpak/org.pitivi.Pitivi.json
- - export RUN_IN_SANDBOX="flatpak-builder --disable-rofiles-fuse --filesystem=${BUILDDIR}
--filesystem=${CI_PROJECT_DIR} --env=PITIVI_DEVELOPMENT=1 --env=GST_DEBUG=2 --env=GST_DEBUG_NO_COLOR=true
--run app ${MANIFEST}"
- - export FLATPAK_BUILDER_CACHE="--state-dir=${HOME}/flatpak-cache"
- - export FLATPAK_REPO="${CI_PROJECT_DIR}/flatpak_repo"
-
+ # Debug
- env
+ - whoami
+ - pwd
+ - ls -al
+ - ls -al /root
+
+ - export REPO_DIR=/root/pitivi
+ - export RUN_IN_SANDBOX="flatpak-builder --disable-rofiles-fuse --filesystem=${REPO_DIR}
--filesystem=${CI_PROJECT_DIR} --env=PITIVI_DEVELOPMENT=1 --env=GST_DEBUG=2 --env=GST_DEBUG_NO_COLOR=true
--run app ${REPO_DIR}/build/flatpak/org.pitivi.Pitivi.json"
# Working around the fact that flatpak-builder *requires* the cache dir
- # to be on the same filesystem as the build dir
- - mv ${CI_PROJECT_DIR} ${BUILDDIR}
+ # to be on the same filesystem as the build dir.
+ # CI_PROJECT_DIR is most likely /builds/GNOME/pitivi
+ - mv ${CI_PROJECT_DIR} ${REPO_DIR}
- mkdir -p ${CI_PROJECT_DIR}
- - cd ${BUILDDIR}
- - flatpak-builder --user --disable-rofiles-fuse ${FLATPAK_BUILDER_CACHE} --disable-download --ccache
--repo=${FLATPAK_REPO} --force-clean app build/flatpak/org.pitivi.Pitivi.json --subject="Rolling update for
pitivi master" --body="See ${CI_JOB_URL}"
+ - cd ${REPO_DIR}
+ - flatpak-builder --user --disable-rofiles-fuse --state-dir=${FLATPAK_BUILDER_CACHE} --ccache
--disable-download --repo=${CI_PROJECT_DIR}/flatpak_repo --force-clean app
build/flatpak/org.pitivi.Pitivi.json --subject="Rolling update for pitivi master" --body="See ${CI_JOB_URL}"
- ${RUN_IN_SANDBOX} meson mesonbuild/
- ${RUN_IN_SANDBOX} ninja -C mesonbuild/
- - xvfb-run -n 32 -s "-screen 0 640x480x24" ${RUN_IN_SANDBOX} gst-validate-launcher
$PWD/tests/ptv_testsuite.py --dump-on-failure --timeout-factor 4 --xunit-file ${XUNIT_PATH}
--logs-dir=${CI_PROJECT_DIR}/tests-logs ${BLACKLIST}
+ - xvfb-run -n 32 -s "-screen 0 640x480x24" ${RUN_IN_SANDBOX} gst-validate-launcher
${PWD}/tests/ptv_testsuite.py --dump-on-failure --timeout-factor 4 --xunit-file ${XUNIT_PATH}
--logs-dir=${CI_PROJECT_DIR}/tests-logs ${BLACKLIST}
# For some reason GitLab fails to upload directories
- cd ${CI_PROJECT_DIR}/
@@ -100,4 +97,3 @@ deploy:
- flatpak build-commit-from --src-repo=flatpak_repo /srv/http --timestamp=NOW --gpg-sign=739E841A
only:
- master@GNOME/pitivi
- - thiblahute/sdk3.36@GNOME/pitivi
diff --git a/runner b/runner
new file mode 100644
index 000000000..ef032aa46
--- /dev/null
+++ b/runner
@@ -0,0 +1,19 @@
+FROM registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.38
+
+ARG CI_PROJECT_URL
+ARG CI_COMMIT_REF_NAME
+ARG FLATPAK_BUILDER_CACHE
+
+# This is just a temporary directory. It will be deleted at the end.
+ENV REPO_DIR=/root/tmp-pitivi
+
+RUN git clone ${CI_PROJECT_URL}.git --single-branch ${REPO_DIR} -b ${CI_COMMIT_REF_NAME}
+
+# Populate the flatpak cache by creating the sandbox.
+RUN flatpak-builder --user --disable-rofiles-fuse --ccache \
+ --state-dir=${FLATPAK_BUILDER_CACHE} \
+ ${REPO_DIR}/app \
+ ${REPO_DIR}/build/flatpak/org.pitivi.Pitivi.json
+
+# We're only interested in the FLATPAK_BUILDER_CACHE being populated.
+RUN rm -rf ${REPO_DIR}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]