summaryrefslogtreecommitdiff
path: root/ci/docker
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2020-10-24 14:56:22 -0300
committerThibault Saunier <tsaunier@igalia.com>2021-09-24 16:21:18 -0300
commit091946a4785e563dcdf196bea8fcd7e9b85f5330 (patch)
tree423a5b757df499c2ef912230a89b38b9b1396ba8 /ci/docker
parentbcd3ffa8b2a259aa7ccc0236e8c5373d0543599e (diff)
downloadgstreamer-091946a4785e563dcdf196bea8fcd7e9b85f5330.tar.gz
ci: Port CI to the new monorepo
Main differences with previous setup are: - No manifest creation - gst-indent is executed only when the bot is assigned (instead of the manifest task) - Cerbero jobs are triggered in the cerbero repo - Remove cerbero and android related files as they now are in cerbero itself. - Update `container.ps1` to the new file layout Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/891>
Diffstat (limited to 'ci/docker')
-rw-r--r--ci/docker/README2
-rw-r--r--ci/docker/build_manifest/Dockerfile7
-rw-r--r--ci/docker/fedora/Dockerfile12
-rw-r--r--ci/docker/fedora/cleanup.sh7
-rw-r--r--ci/docker/fedora/prepare.sh244
-rw-r--r--ci/docker/indent/Dockerfile7
-rw-r--r--ci/docker/test_manifest/Dockerfile8
-rw-r--r--ci/docker/windows/.dockerignore1
-rw-r--r--ci/docker/windows/Dockerfile23
-rw-r--r--ci/docker/windows/build_image.ps127
-rw-r--r--ci/docker/windows/container.ps160
-rw-r--r--ci/docker/windows/install_choco.ps123
-rw-r--r--ci/docker/windows/install_gst.ps171
-rw-r--r--ci/docker/windows/install_toolchain.ps169
-rw-r--r--ci/docker/windows/prepare_cerbero_env.sh27
-rw-r--r--ci/docker/windows/prepare_gst_env.ps117
-rw-r--r--ci/docker/windows/rust.Dockerfile21
17 files changed, 626 insertions, 0 deletions
diff --git a/ci/docker/README b/ci/docker/README
new file mode 100644
index 0000000000..1e99ca0a6f
--- /dev/null
+++ b/ci/docker/README
@@ -0,0 +1,2 @@
+GStreamer Docker images
+
diff --git a/ci/docker/build_manifest/Dockerfile b/ci/docker/build_manifest/Dockerfile
new file mode 100644
index 0000000000..e3c4921e6f
--- /dev/null
+++ b/ci/docker/build_manifest/Dockerfile
@@ -0,0 +1,7 @@
+FROM python:3.7.1-alpine
+
+ARG DEFAULT_BRANCH="master"
+
+RUN pip install requests
+RUN apk add git
+RUN cd / && git clone -b ${DEFAULT_BRANCH:=master} https://gitlab.freedesktop.org/gstreamer/gst-ci.git
diff --git a/ci/docker/fedora/Dockerfile b/ci/docker/fedora/Dockerfile
new file mode 100644
index 0000000000..84a1a038dd
--- /dev/null
+++ b/ci/docker/fedora/Dockerfile
@@ -0,0 +1,12 @@
+FROM registry.fedoraproject.org/fedora:31
+
+ENV RUSTUP_HOME=/usr/local/rustup \
+ CARGO_HOME=/usr/local/cargo \
+ PATH=/usr/local/cargo/bin:$PATH
+
+ARG DEFAULT_BRANCH="main"
+
+COPY prepare.sh cleanup.sh /root/
+
+RUN /usr/bin/sh /root/prepare.sh && \
+ /usr/bin/sh /root/cleanup.sh
diff --git a/ci/docker/fedora/cleanup.sh b/ci/docker/fedora/cleanup.sh
new file mode 100644
index 0000000000..a60a9fcf4b
--- /dev/null
+++ b/ci/docker/fedora/cleanup.sh
@@ -0,0 +1,7 @@
+set -eux
+
+echo "Removing DNF cache"
+dnf clean all
+
+rm -R /root/*
+rm -rf /var/cache/dnf /var/log/dnf*
diff --git a/ci/docker/fedora/prepare.sh b/ci/docker/fedora/prepare.sh
new file mode 100644
index 0000000000..3327e21e0c
--- /dev/null
+++ b/ci/docker/fedora/prepare.sh
@@ -0,0 +1,244 @@
+set -eux
+
+# Fedora base image disable installing documentation files. See https://pagure.io/atomic-wg/issue/308
+# We need them to cleanly build our doc.
+sed -i "s/tsflags=nodocs//g" /etc/dnf/dnf.conf
+
+dnf install -y git-core ninja-build dnf-plugins-core python3-pip
+
+# Configure git for various usage
+git config --global user.email "gstreamer@gstreamer.net"
+git config --global user.name "Gstbuild Runner"
+
+# Add rpm fusion repositories in order to access all of the gst plugins
+sudo dnf install -y \
+ "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" \
+ "https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"
+
+dnf upgrade -y
+
+# install rest of the extra deps
+dnf install -y \
+ aalib-devel \
+ aom \
+ bat \
+ intel-mediasdk-devel \
+ libaom \
+ libaom-devel \
+ libcaca-devel \
+ libdav1d \
+ libdav1d-devel \
+ ccache \
+ cmake \
+ clang-devel \
+ elfutils \
+ elfutils-libs \
+ elfutils-devel \
+ gcc \
+ gcc-c++ \
+ gdb \
+ git-lfs \
+ glslc \
+ gtk3 \
+ gtk3-devel \
+ gtest \
+ gtest-devel \
+ graphene \
+ graphene-devel \
+ gsl \
+ gsl-devel \
+ gupnp \
+ gupnp-devel \
+ gupnp-igd \
+ gupnp-igd-devel \
+ gssdp \
+ gssdp-devel \
+ faac-devel \
+ ffmpeg \
+ ffmpeg-libs \
+ ffmpeg-devel \
+ flex \
+ flite \
+ flite-devel \
+ mono-devel \
+ procps-ng \
+ patch \
+ qt5-devel \
+ redhat-rpm-config \
+ json-glib \
+ json-glib-devel \
+ libnice \
+ libnice-devel \
+ libsodium-devel \
+ libunwind \
+ libunwind-devel \
+ libyaml-devel \
+ libxml2-devel \
+ libxslt-devel \
+ llvm-devel \
+ log4c-devel \
+ make \
+ nasm \
+ neon \
+ neon-devel \
+ nunit \
+ npm \
+ opencv \
+ opencv-devel \
+ openjpeg2 \
+ openjpeg2-devel \
+ SDL2 \
+ SDL2-devel \
+ sbc \
+ sbc-devel \
+ x264 \
+ x264-libs \
+ x264-devel \
+ python3 \
+ python3-devel \
+ python3-libs \
+ python3-gobject \
+ python3-cairo \
+ python3-cairo-devel \
+ valgrind \
+ vulkan \
+ vulkan-devel \
+ mesa-omx-drivers \
+ mesa-libGL \
+ mesa-libGL-devel \
+ mesa-libGLU \
+ mesa-libGLU-devel \
+ mesa-libGLES \
+ mesa-libGLES-devel \
+ mesa-libOpenCL \
+ mesa-libOpenCL-devel \
+ mesa-libgbm \
+ mesa-libgbm-devel \
+ mesa-libd3d \
+ mesa-libd3d-devel \
+ mesa-libOSMesa \
+ mesa-libOSMesa-devel \
+ mesa-vulkan-drivers \
+ wpewebkit \
+ wpewebkit-devel \
+ xorg-x11-server-utils \
+ xorg-x11-server-Xvfb
+
+# Install common debug symbols
+dnf debuginfo-install -y gtk3 \
+ glib2 \
+ glibc \
+ gupnp \
+ gupnp-igd \
+ gssdp \
+ freetype \
+ openjpeg \
+ gobject-introspection \
+ python3 \
+ python3-libs \
+ python3-gobject \
+ libappstream-glib-devel \
+ libjpeg-turbo \
+ glib-networking \
+ libcurl \
+ libsoup \
+ nss \
+ nss-softokn \
+ nss-softokn-freebl \
+ nss-sysinit \
+ nss-util \
+ openssl \
+ openssl-libs \
+ openssl-pkcs11 \
+ brotli \
+ bzip2-libs \
+ gpm-libs \
+ harfbuzz \
+ harfbuzz-icu \
+ json-c \
+ json-glib \
+ libbabeltrace \
+ libffi \
+ libsrtp \
+ libunwind \
+ mpg123-libs \
+ neon \
+ orc-compiler \
+ orc \
+ pixman \
+ pulseaudio-libs \
+ pulseaudio-libs-glib2 \
+ wavpack \
+ webrtc-audio-processing \
+ ffmpeg \
+ ffmpeg-libs \
+ faad2-libs \
+ libavdevice \
+ libmpeg2 \
+ faac \
+ fdk-aac \
+ x264 \
+ x264-libs \
+ x265 \
+ x265-libs \
+ xz \
+ xz-libs \
+ zip \
+ zlib
+
+# Install the dependencies of gstreamer
+dnf builddep -y gstreamer1 \
+ gstreamer1-plugins-base \
+ gstreamer1-plugins-good \
+ gstreamer1-plugins-good-extras \
+ gstreamer1-plugins-ugly \
+ gstreamer1-plugins-ugly-free \
+ gstreamer1-plugins-bad-free \
+ gstreamer1-plugins-bad-free-extras \
+ gstreamer1-plugins-bad-freeworld \
+ gstreamer1-libav \
+ gstreamer1-rtsp-server \
+ gstreamer1-vaapi \
+ python3-gstreamer1
+
+dnf remove -y meson
+pip3 install meson==0.58.0 hotdoc
+
+# Remove gst-devel packages installed by builddep above
+dnf remove -y "gstreamer1*devel"
+
+# FIXME: Why does installing directly with dnf doesn't actually install
+# the documentation files?
+dnf download glib2-doc gdk-pixbuf2-devel*x86_64* gtk3-devel-docs
+rpm -i --reinstall *.rpm
+rm -f *.rpm
+
+# Install Rust
+RUSTUP_VERSION=1.24.2
+RUST_VERSION=1.52.1
+RUST_ARCH="x86_64-unknown-linux-gnu"
+
+dnf install -y wget
+RUSTUP_URL=https://static.rust-lang.org/rustup/archive/$RUSTUP_VERSION/$RUST_ARCH/rustup-init
+wget $RUSTUP_URL
+dnf remove -y wget
+
+chmod +x rustup-init;
+./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION;
+rm rustup-init;
+chmod -R a+w $RUSTUP_HOME $CARGO_HOME
+
+rustup --version
+cargo --version
+rustc --version
+
+# get gstreamer and make all subprojects available
+git clone -b ${DEFAULT_BRANCH} https://gitlab.freedesktop.org/gstreamer/gstreamer.git /gstreamer
+meson subprojects download --sourcedir /gstreamer
+/gstreamer/ci/scripts/handle-subprojects-cache.py --build /gstreamer/subprojects/
+
+# Run git gc to prune unwanted refs and reduce the size of the image
+for i in $(find subprojects/ -mindepth 1 -maxdepth 1 -type d);
+do
+ git -C $i gc --aggressive || true;
+done
diff --git a/ci/docker/indent/Dockerfile b/ci/docker/indent/Dockerfile
new file mode 100644
index 0000000000..63581e3597
--- /dev/null
+++ b/ci/docker/indent/Dockerfile
@@ -0,0 +1,7 @@
+FROM debian:stretch-slim
+
+RUN apt update -yqq \
+ && apt install -y curl indent git findutils \
+ && rm -R /var/lib/apt/ /var/log/apt/ \
+ && curl -L -o /usr/local/bin/gst-indent https://gitlab.freedesktop.org/gstreamer/gstreamer/raw/master/tools/gst-indent \
+ && chmod a+x /usr/local/bin/gst-indent
diff --git a/ci/docker/test_manifest/Dockerfile b/ci/docker/test_manifest/Dockerfile
new file mode 100644
index 0000000000..cdc369c822
--- /dev/null
+++ b/ci/docker/test_manifest/Dockerfile
@@ -0,0 +1,8 @@
+FROM registry.fedoraproject.org/fedora:31
+
+RUN dnf install -y \
+ python3-pytest \
+ python3-requests \
+ python3-pytest-cov \
+ git-core \
+ && rm -rf /var/cache/dnf /var/log/dnf*
diff --git a/ci/docker/windows/.dockerignore b/ci/docker/windows/.dockerignore
new file mode 100644
index 0000000000..76bab46af2
--- /dev/null
+++ b/ci/docker/windows/.dockerignore
@@ -0,0 +1 @@
+build_image.ps1
diff --git a/ci/docker/windows/Dockerfile b/ci/docker/windows/Dockerfile
new file mode 100644
index 0000000000..9637c2e7bb
--- /dev/null
+++ b/ci/docker/windows/Dockerfile
@@ -0,0 +1,23 @@
+# escape=`
+
+FROM 'mcr.microsoft.com/windows/servercore:ltsc2019'
+
+# Make sure any failure in PowerShell scripts is fatal
+SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
+ENV ErrorActionPreference='Stop'
+
+COPY install_choco.ps1 C:\
+RUN C:\install_choco.ps1
+
+RUN 'git config --global user.email "cirunner@gstreamer.freedesktop.org"; git config --global user.name "GStreamer CI system"'
+
+COPY install_toolchain.ps1 C:\
+RUN C:\install_toolchain.ps1
+
+ARG DEFAULT_BRANCH="main"
+
+COPY prepare_gst_env.ps1 C:\
+RUN C:\prepare_gst_env.ps1
+
+COPY prepare_cerbero_env.sh C:\
+RUN C:\MinGW\msys\1.0\bin\bash.exe --login -c "C:/prepare_cerbero_env.sh"
diff --git a/ci/docker/windows/build_image.ps1 b/ci/docker/windows/build_image.ps1
new file mode 100644
index 0000000000..0fadb7e284
--- /dev/null
+++ b/ci/docker/windows/build_image.ps1
@@ -0,0 +1,27 @@
+$env:ErrorActionPreference='Stop'
+
+$env:DEFAULT_BRANCH='main'
+$env:VERSION='test'
+$env:tag ="registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:$env:VERSION-$env:DEFAULT_BRANCH"
+$env:rust_tag ="registry.freedesktop.org/gstreamer/gst-ci/amd64/windows-rust:$env:VERSION-$env:DEFAULT_BRANCH"
+
+Set-Location './docker/windows/'
+
+Get-Date
+Write-Output "Building $env:tag"
+docker build --isolation=hyperv -m 12g --build-arg DEFAULT_BRANCH=$env:DEFAULT_BRANCH -f Dockerfile -t $env:tag .
+if (!$?) {
+ Write-Host "Failed to build docker image $env:tag"
+ Exit 1
+}
+
+Get-Date
+Write-Output "Building $env:rust_tag"
+docker build --isolation=hyperv -m 12g --build-arg DEFAULT_BRANCH=$env:DEFAULT_BRANCH -f rust.Dockerfile -t $env:rust_tag .
+if (!$?) {
+ Write-Host "Failed to build docker image $env:rust_tag"
+ Exit 1
+}
+
+Get-Date
+Write-Output "Build Finished" \ No newline at end of file
diff --git a/ci/docker/windows/container.ps1 b/ci/docker/windows/container.ps1
new file mode 100644
index 0000000000..1386495c72
--- /dev/null
+++ b/ci/docker/windows/container.ps1
@@ -0,0 +1,60 @@
+# Copied from mesa, big kudos
+#
+# https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/.gitlab-ci/windows/mesa_container.ps1
+# https://gitlab.freedesktop.org/mesa/mesa/-/blob/34e3e164936d1d3cef267da7780e87f062fedf39/.gitlab-ci/windows/mesa_container.ps1
+
+# Implements the equivalent of ci-templates container-ifnot-exists, using
+# Docker directly as we don't have buildah/podman/skopeo available under
+# Windows, nor can we execute Docker-in-Docker
+$registry_uri = $args[0]
+$registry_username = $args[1]
+$registry_password = $args[2]
+$registry_user_image = $args[3]
+$registry_central_image = $args[4]
+$dockerfile = $args[5]
+
+docker --config "windows-docker.conf" login -u "$registry_username" -p "$registry_password" "$registry_uri"
+if (!$?) {
+ Write-Host "docker login failed to $registry_uri"
+ Exit 1
+}
+
+# if the image already exists, don't rebuild it
+docker --config "windows-docker.conf" pull "$registry_user_image"
+if ($?) {
+ Write-Host "User image $registry_user_image already exists; not rebuilding"
+ docker --config "windows-docker.conf" logout "$registry_uri"
+ Exit 0
+}
+
+# if the image already exists upstream, copy it
+docker --config "windows-docker.conf" pull "$registry_central_image"
+if ($?) {
+ Write-Host "Copying central image $registry_central_image to user image $registry_user_image"
+ docker --config "windows-docker.conf" tag "$registry_central_image" "$registry_user_image"
+ docker --config "windows-docker.conf" push "$registry_user_image"
+ $pushstatus = $?
+ docker --config "windows-docker.conf" logout "$registry_uri"
+ if (!$pushstatus) {
+ Write-Host "Pushing image to $registry_user_image failed"
+ Exit 1
+ }
+ Exit 0
+}
+
+Write-Host "No image found at $registry_user_image or $registry_central_image; rebuilding"
+docker --config "windows-docker.conf" build $DOCKER_BUILD_ARGS --no-cache -t "$registry_user_image" -f "$dockerfile" "./ci/docker/windows"
+if (!$?) {
+ Write-Host "Container build failed"
+ docker --config "windows-docker.conf" logout "$registry_uri"
+ Exit 1
+}
+Get-Date
+
+docker --config "windows-docker.conf" push "$registry_user_image"
+$pushstatus = $?
+docker --config "windows-docker.conf" logout "$registry_uri"
+if (!$pushstatus) {
+ Write-Host "Pushing image to $registry_user_image failed"
+ Exit 1
+}
diff --git a/ci/docker/windows/install_choco.ps1 b/ci/docker/windows/install_choco.ps1
new file mode 100644
index 0000000000..b19eb7b0a3
--- /dev/null
+++ b/ci/docker/windows/install_choco.ps1
@@ -0,0 +1,23 @@
+Get-Date
+Write-Host "Installing Chocolatey"
+Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
+Import-Module "$env:ProgramData\chocolatey\helpers\chocolateyProfile.psm1"
+Update-SessionEnvironment
+
+choco install -y vcredist140
+$vc140_install = $?
+
+Write-Host "Installing Chocolatey packages"
+choco install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'
+$cmake_install = $?
+
+choco install -y git --params "/NoAutoCrlf /NoCredentialManager /NoShellHereIntegration /NoGuiHereIntegration /NoShellIntegration"
+$git_install = $?
+
+choco install -y python3 git-lfs 7zip
+$rest_installs = $?
+
+if (!($vc140_install -and $cmake_install -and $git_install -and $rest_installs)) {
+ Write-Host "Failed to install some dependencies from choco"
+ Exit 1
+}
diff --git a/ci/docker/windows/install_gst.ps1 b/ci/docker/windows/install_gst.ps1
new file mode 100644
index 0000000000..6105f3623b
--- /dev/null
+++ b/ci/docker/windows/install_gst.ps1
@@ -0,0 +1,71 @@
+[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
+
+# Download gst-build and all its subprojects
+# git clone -b $env:DEFAULT_BRANCH https://gitlab.freedesktop.org/gstreamer/gst-build.git C:\gst-build
+# FIXME: need 1.19+ for cairo subproject :/
+# Should use a stable branch instead
+git clone -b master --depth 1 https://gitlab.freedesktop.org/gstreamer/gst-build.git C:\gst-build
+if (!$?) {
+ Write-Host "Failed to clone gst-build"
+ Exit 1
+}
+
+Set-Location C:\gst-build
+
+# Copy the cache we already have in the image to avoid massive redownloads
+Move-Item C:/subprojects/* C:\gst-build\subprojects
+
+if (!$?) {
+ Write-Host "Failed to copy subprojects cache"
+ Exit 1
+}
+
+# Update the subprojects cache
+Write-Output "Running meson subproject reset"
+meson subprojects update --reset
+
+if (!$?) {
+ Write-Host "Failed to reset subprojects state"
+ Exit 1
+}
+
+Write-Output "Running git update"
+python git-update --no-interaction
+
+if (!$?) {
+ Write-Host "Failed to run git-update"
+ Exit 1
+}
+
+$env:MESON_ARGS = "-Dglib:installed_tests=false " +
+ "-Dlibnice:tests=disabled " +
+ "-Dlibnice:examples=disabled " +
+ "-Dffmpeg:tests=disabled " +
+ "-Dopenh264:tests=disabled " +
+ "-Dpygobject:tests=false " +
+ "-Dugly=enabled " +
+ "-Dbad=enabled " +
+ "-Dges=enabled " +
+ "-Drtsp_server=enabled " +
+ "-Ddevtools=enabled " +
+ "-Dsharp=disabled " +
+ "-Dpython=disabled " +
+ "-Dlibav=disabled " +
+ "-Dvaapi=disabled " +
+ "-Dgst-plugins-base:pango=enabled " +
+ "-Dgst-plugins-good:cairo=enabled "
+
+Write-Output "Building gst"
+cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && meson _build $env:MESON_ARGS && meson compile -C _build && ninja -C _build install"
+
+if (!$?) {
+ Write-Host "Failed to build and install gst"
+ Exit 1
+}
+
+git clean -fdxx
+
+if (!$?) {
+ Write-Host "Failed to git clean"
+ Exit 1
+} \ No newline at end of file
diff --git a/ci/docker/windows/install_toolchain.ps1 b/ci/docker/windows/install_toolchain.ps1
new file mode 100644
index 0000000000..fd61b42d1c
--- /dev/null
+++ b/ci/docker/windows/install_toolchain.ps1
@@ -0,0 +1,69 @@
+[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
+
+$msvc_2017_url = 'https://aka.ms/vs/15/release/vs_buildtools.exe'
+$msys2_url = 'https://github.com/msys2/msys2-installer/releases/download/2021-02-15/msys2-base-x86_64-20210215.tar.xz'
+$msys_mingw_get_url = 'https://dotsrc.dl.osdn.net/osdn/mingw/68260/mingw-get-0.6.3-mingw32-pre-20170905-1-bin.tar.xz'
+
+Get-Date
+Write-Host "Downloading Visual Studio 2017 build tools"
+Invoke-WebRequest -Uri $msvc_2017_url -OutFile C:\vs_buildtools.exe
+
+Get-Date
+Write-Host "Installing Visual Studio 2017"
+Start-Process -NoNewWindow -Wait C:\vs_buildtools.exe -ArgumentList '--wait --quiet --norestart --nocache --installPath C:\BuildTools --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended'
+if (!$?) {
+ Write-Host "Failed to install Visual Studio tools"
+ Exit 1
+}
+Remove-Item C:\vs_buildtools.exe -Force
+
+Get-Date
+Write-Host "Downloading and extracting mingw-get for MSYS"
+Invoke-WebRequest -Uri $msys_mingw_get_url -OutFile C:\mingw-get.tar.xz
+7z e C:\mingw-get.tar.xz -o"C:\\"
+$res1 = $?
+7z x C:\mingw-get.tar -o"C:\\MinGW"
+$res2 = $?
+
+if (!($res1 -and $res2)) {
+ Write-Host "Failed to extract mingw-get"
+ Exit 1
+}
+
+Remove-Item C:\mingw-get.tar.xz -Force
+Remove-Item C:\mingw-get.tar -Force
+
+Get-Date
+Write-Host "Installing MSYS for Cerbero into C:/MinGW using mingw-get"
+Start-Process -Wait C:\MinGW\bin\mingw-get.exe -ArgumentList 'install msys-base mingw32-base mingw-developer-toolkit'
+if (!$?) {
+ Write-Host "Failed to install Msys for cerbero using MinGW"
+ Exit 1
+}
+
+Get-Date
+Write-Host "Installing MSYS2 into C:/msys64"
+Invoke-WebRequest -Uri $msys2_url -OutFile C:\msys2-x86_64.tar.xz
+
+7z e C:\msys2-x86_64.tar.xz -o"C:\\"
+$res1 = $?
+7z x C:\msys2-x86_64.tar -o"C:\\"
+$res2 = $?
+
+if (!($res1 -and $res2)) {
+ Write-Host "Failed to extract msys2"
+ Exit 1
+}
+
+Remove-Item C:\msys2-x86_64.tar.xz -Force
+Remove-Item C:\msys2-x86_64.tar -Force
+
+Get-Date
+Write-Host "Installing Meson"
+pip3 install meson
+if (!$?) {
+ Write-Host "Failed to install meson from pip"
+ Exit 1
+}
+
+Write-Host "Toolchain Install Complete"
diff --git a/ci/docker/windows/prepare_cerbero_env.sh b/ci/docker/windows/prepare_cerbero_env.sh
new file mode 100644
index 0000000000..da94acabb3
--- /dev/null
+++ b/ci/docker/windows/prepare_cerbero_env.sh
@@ -0,0 +1,27 @@
+#! /bin/bash
+
+set -eux
+
+cd C:/
+git clone -b ${DEFAULT_BRANCH} https://gitlab.freedesktop.org/gstreamer/cerbero.git
+cd cerbero
+
+echo 'local_sources="C:/cerbero/cerbero-sources"' > localconf.cbc
+echo 'home_dir="C:/cerbero/cerbero-build"' >> localconf.cbc
+echo 'vs_install_path = "C:/BuildTools"' >> localconf.cbc
+echo 'vs_install_version = "vs15"' >> localconf.cbc
+
+# Fetch all bootstrap requirements
+./cerbero-uninstalled -t -c localconf.cbc -c config/win64.cbc fetch-bootstrap --jobs=4
+# Fetch all package requirements for a mingw gstreamer build
+./cerbero-uninstalled -t -c localconf.cbc -c config/win64.cbc fetch-package --jobs=4 gstreamer-1.0
+# Fetch all package requirements for a visualstudio gstreamer build
+./cerbero-uninstalled -t -v visualstudio -c localconf.cbc -c config/win64.cbc fetch-package --jobs=4 gstreamer-1.0
+
+# Fixup the MSYS installation
+./cerbero-uninstalled -t -c localconf.cbc -c config/win64.cbc bootstrap -y --build-tools=no --toolchains=no --offline
+
+# Wipe visualstudio package dist, sources, logs, and the build tools recipes
+./cerbero-uninstalled -t -v visualstudio -c localconf.cbc -c config/win64.cbc wipe --force --build-tools
+# clean the localconf
+rm /c/cerbero/localconf.cbc
diff --git a/ci/docker/windows/prepare_gst_env.ps1 b/ci/docker/windows/prepare_gst_env.ps1
new file mode 100644
index 0000000000..7b19497297
--- /dev/null
+++ b/ci/docker/windows/prepare_gst_env.ps1
@@ -0,0 +1,17 @@
+[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
+
+# FIXME: Python fails to validate github.com SSL certificate, unless we first
+# run a dummy download to force refreshing Windows' CA database.
+# See: https://bugs.python.org/issue36137
+(New-Object System.Net.WebClient).DownloadString("https://github.com") >$null
+
+Write-Host "Cloning GStreamer"
+git clone -b $env:DEFAULT_BRANCH https://gitlab.freedesktop.org/gstreamer/gstreamer.git C:\gstreamer
+
+# download the subprojects to try and cache them
+Write-Host "Downloading subprojects"
+meson subprojects download --sourcedir /gstreamer
+
+Write-Host "Caching subprojects into /subprojects/"
+python /gstreamer/ci/scripts/handle-subprojects-cache.py --build /gstreamer/subprojects/
+Remove-Item -Recurse -Force C:\gstreamer
diff --git a/ci/docker/windows/rust.Dockerfile b/ci/docker/windows/rust.Dockerfile
new file mode 100644
index 0000000000..f3742454a3
--- /dev/null
+++ b/ci/docker/windows/rust.Dockerfile
@@ -0,0 +1,21 @@
+# escape=`
+
+# Expect this to be set when calling docker build with
+# --build-arg BASE_IMAGE="" and make it fail if not set.
+ARG BASE_IMAGE="inavlid.gstreamer.freedesktop.org/invalid"
+FROM $BASE_IMAGE
+
+ARG DEFAULT_BRANCH="main"
+ARG RUST_VERSION="invalid"
+
+COPY install_gst.ps1 C:\
+RUN C:\install_gst.ps1
+RUN choco install -y pkgconfiglite
+ENV PKG_CONFIG_PATH="C:/lib/pkgconfig"
+
+ADD https://win.rustup.rs/x86_64 C:\rustup-init.exe
+RUN C:\rustup-init.exe -y --profile minimal --default-toolchain $env:RUST_VERSION
+
+# Uncomment for easy testing
+# RUN git clone --depth 1 https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
+# RUN cd gstreamer-rs; cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64; cargo build --all; cargo test --all" \ No newline at end of file