-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compile modules needed for WHIP support in gstreamer image (#571)
- Loading branch information
1 parent
a00ffff
commit e49cfc0
Showing
11 changed files
with
207 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: GStreamer build AMD64 | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
gstreamer-build-amd64: | ||
uses: ./.github/workflows/gstreamer-base.yaml | ||
with: | ||
buildjet-runs-on: buildjet-8vcpu-ubuntu-2204 | ||
secrets: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: GStreamer build ARM64 | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
gstreamer-build-arm64: | ||
uses: ./.github/workflows/gstreamer-base.yaml | ||
with: | ||
buildjet-runs-on: namespace-profile-arm-16 | ||
secrets: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
buildjet-runs-on: | ||
required: true | ||
type: string | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
env: | ||
GST_VERSION: "1.22.8" | ||
LIBNICE_VERSION: "0.1.21" | ||
|
||
jobs: | ||
base-gstreamer-build: | ||
runs-on: ${{ inputs.buildjet-runs-on }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push base | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./build/gstreamer | ||
push: true | ||
load: true | ||
build-args: | | ||
GSTREAMER_VERSION=${{ env.GST_VERSION }} | ||
LIBNICE_VERSION=${{ env.LIBNICE_VERSION }} | ||
file: ./build/gstreamer/Dockerfile-base | ||
tags: livekit/gstreamer:base-${{ env.GST_VERSION }} | ||
|
||
- name: Build and push dev | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./build/gstreamer | ||
push: true | ||
load: true | ||
build-args: | | ||
GSTREAMER_VERSION=${{ env.GST_VERSION }} | ||
LIBNICE_VERSION=${{ env.LIBNICE_VERSION }} | ||
file: ./build/gstreamer/Dockerfile-dev | ||
tags: livekit/gstreamer:dev-${{ env.GST_VERSION }} | ||
|
||
- name: Build and push prod | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./build/gstreamer | ||
push: true | ||
load: true | ||
build-args: | | ||
GSTREAMER_VERSION=${{ env.GST_VERSION }} | ||
LIBNICE_VERSION=${{ env.LIBNICE_VERSION }} | ||
file: ./build/gstreamer/Dockerfile-prod | ||
tags: livekit/gstreamer:prod-${{ env.GST_VERSION }} | ||
|
||
- name: Prune docker state | ||
run: docker rmi livekit/gstreamer:base-${{ env.GST_VERSION }} | ||
|
||
- name: Build and push prod RS | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./build/gstreamer | ||
push: true | ||
build-args: | | ||
GSTREAMER_VERSION=${{ env.GST_VERSION }} | ||
LIBNICE_VERSION=${{ env.LIBNICE_VERSION }} | ||
file: ./build/gstreamer/Dockerfile-prod-rs | ||
tags: livekit/gstreamer:prod-rs-${{ env.GST_VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
FROM ubuntu:22.04 | ||
FROM ubuntu:23.10 | ||
|
||
ARG GSTREAMER_VERSION | ||
|
||
ARG LIBNICE_VERSION | ||
|
||
COPY install-dependencies / | ||
|
||
RUN /install-dependencies | ||
|
||
ENV PATH=/root/.cargo/bin:$PATH | ||
|
||
RUN for lib in gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav; \ | ||
do \ | ||
wget https://gstreamer.freedesktop.org/src/$lib/$lib-$GSTREAMER_VERSION.tar.xz && \ | ||
tar -xf $lib-$GSTREAMER_VERSION.tar.xz && \ | ||
rm $lib-$GSTREAMER_VERSION.tar.xz && \ | ||
mv $lib-$GSTREAMER_VERSION $lib; \ | ||
done | ||
|
||
# rust plugins are apparently only realeased on gitlab | ||
|
||
RUN wget https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/archive/gstreamer-$GSTREAMER_VERSION/gst-plugins-rs-gstreamer-$GSTREAMER_VERSION.tar.gz && \ | ||
tar xfz gst-plugins-rs-gstreamer-$GSTREAMER_VERSION.tar.gz && \ | ||
rm gst-plugins-rs-gstreamer-$GSTREAMER_VERSION.tar.gz && \ | ||
mv gst-plugins-rs-gstreamer-$GSTREAMER_VERSION gst-plugins-rs | ||
|
||
RUN wget https://libnice.freedesktop.org/releases/libnice-$LIBNICE_VERSION.tar.gz && \ | ||
tar xfz libnice-$LIBNICE_VERSION.tar.gz && \ | ||
rm libnice-$LIBNICE_VERSION.tar.gz && \ | ||
mv libnice-$LIBNICE_VERSION libnice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ARG GSTREAMER_VERSION | ||
|
||
FROM livekit/gstreamer:${GSTREAMER_VERSION}-base | ||
|
||
FROM livekit/gstreamer:${GSTREAMER_VERSION}-dev | ||
|
||
COPY --from=0 /gst-plugins-rs /gst-plugins-rs | ||
|
||
ENV DEBUG=false | ||
ENV OPTIMIZATIONS=true | ||
ENV PATH=/root/.cargo/bin:$PATH | ||
|
||
COPY compile-rs / | ||
|
||
RUN /compile-rs | ||
|
||
FROM livekit/gstreamer:${GSTREAMER_VERSION}-prod | ||
|
||
COPY --from=1 /compiled-binaries / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
for repo in gst-plugins-rs; do | ||
pushd $repo | ||
|
||
# strip binaries in debug mode | ||
mv Cargo.toml Cargo.toml.old | ||
sed s,'\[profile.release\]','[profile.release]\nstrip="debuginfo"', Cargo.toml.old > Cargo.toml | ||
|
||
opts="-D prefix=/usr -D tests=disabled -D doc=disabled" | ||
|
||
if [[ $DEBUG == 'true' ]]; then | ||
if [[ $OPTIMIZATIONS == 'true' ]]; then | ||
opts="$opts -D buildtype=debugoptimized" | ||
else | ||
opts="$opts -D buildtype=debug" | ||
fi | ||
else | ||
opts="$opts -D buildtype=release -D b_lto=true" | ||
fi | ||
|
||
meson build $opts | ||
|
||
# This is needed for other plugins to be built properly | ||
ninja -C build install | ||
# This is where we'll grab build artifacts from | ||
DESTDIR=/compiled-binaries ninja -C build install | ||
popd | ||
done | ||
|
||
gst-inspect-1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters