Skip to content

Fix host networking in containers #740

Fix host networking in containers

Fix host networking in containers #740

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
name: Build and publish all images
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
# Note: When modifying this job, copy modifications to all other workflow image jobs
core_images:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: gst-web
context: addons/gst-web
- name: py-build
build_args: |
PACKAGE_VERSION=0.0.0.dev0
context: .
name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish
steps:
- uses: actions/checkout@v4
- name: Build & publish ${{ matrix.name }} image
uses: ./.github/actions/build_and_publish_image
with:
build_args: ${{ matrix.build_args }}
context: ${{ matrix.context }}
dockerfile: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
push: ${{ github.event_name != 'pull_request' }}
subproject: ${{ matrix.name }}
tags: ghcr.io/${{ github.repository }}/${{ matrix.name }}:${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}${{ matrix.version_suffix }}
# Note: When modifying this job, copy modifications to all other workflow image jobs
component_images:
needs: core_images
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: conda
build_args: |
PACKAGE_VERSION=0.0.0.dev0
PKG_VERSION=0.0.0
context: addons/conda
- name: coturn
context: addons/coturn
platforms: linux/amd64,linux/arm64
- name: coturn-web
context: addons/coturn-web
platforms: linux/amd64,linux/arm64
- name: gstreamer
version_suffix: -ubuntu20.04
build_args: |
DISTRIB_IMAGE=ubuntu
DISTRIB_RELEASE=20.04
context: addons/gstreamer
- name: gstreamer
version_suffix: -ubuntu22.04
build_args: |
DISTRIB_IMAGE=ubuntu
DISTRIB_RELEASE=22.04
context: addons/gstreamer
- name: gstreamer
version_suffix: -ubuntu24.04
build_args: |
DISTRIB_IMAGE=ubuntu
DISTRIB_RELEASE=24.04
context: addons/gstreamer
- name: js-interposer
version_suffix: -ubuntu20.04
build_args: |
DISTRIB_IMAGE=ubuntu
DISTRIB_RELEASE=20.04
PKG_NAME=selkies-js-interposer
PKG_VERSION=0.0.0
context: addons/js-interposer
dockerfile: Dockerfile.debpkg
platforms: linux/amd64,linux/arm64
- name: js-interposer
version_suffix: -ubuntu22.04
build_args: |
DISTRIB_IMAGE=ubuntu
DISTRIB_RELEASE=22.04
PKG_NAME=selkies-js-interposer
PKG_VERSION=0.0.0
context: addons/js-interposer
dockerfile: Dockerfile.debpkg
platforms: linux/amd64,linux/arm64
- name: js-interposer
version_suffix: -ubuntu24.04
build_args: |
DISTRIB_IMAGE=ubuntu
DISTRIB_RELEASE=24.04
PKG_NAME=selkies-js-interposer
PKG_VERSION=0.0.0
context: addons/js-interposer
dockerfile: Dockerfile.debpkg
platforms: linux/amd64,linux/arm64
- name: turn-rest
context: addons/turn-rest
platforms: linux/amd64,linux/arm64
- name: infra-gcp-installer
context: infra/gce/installer-image
diff: infra/gce
name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish
steps:
- uses: actions/checkout@v4
- name: Build & publish ${{ matrix.name }} image
uses: ./.github/actions/build_and_publish_image
with:
build_args: ${{ matrix.build_args }}
context: ${{ matrix.context }}
dockerfile: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
push: ${{ github.event_name != 'pull_request' }}
subproject: ${{ matrix.name }}
tags: ghcr.io/${{ github.repository }}/${{ matrix.name }}:${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}${{ matrix.version_suffix }}
# Note: When modifying this job, copy modifications to all other workflow image jobs
example_images:
needs: component_images
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: gst-py-example
version_suffix: -ubuntu20.04
build_args: |
PACKAGE_VERSION=0.0.0.dev0
DISTRIB_IMAGE=ubuntu
DISTRIB_RELEASE=20.04
GSTREAMER_BASE_IMAGE_RELEASE=${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
PY_BUILD_IMAGE=ghcr.io/${{ github.repository }}/py-build:${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
WEB_IMAGE=ghcr.io/${{ github.repository }}/gst-web:${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
JS_BASE_IMAGE_RELEASE=${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
JS_BASE_IMAGE=ghcr.io/${{ github.repository }}/js-interposer
context: addons/example
- name: gst-py-example
version_suffix: -ubuntu22.04
build_args: |
PACKAGE_VERSION=0.0.0.dev0
DISTRIB_IMAGE=ubuntu
DISTRIB_RELEASE=22.04
GSTREAMER_BASE_IMAGE_RELEASE=${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
PY_BUILD_IMAGE=ghcr.io/${{ github.repository }}/py-build:${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
WEB_IMAGE=ghcr.io/${{ github.repository }}/gst-web:${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
JS_BASE_IMAGE_RELEASE=${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
JS_BASE_IMAGE=ghcr.io/${{ github.repository }}/js-interposer
context: addons/example
- name: gst-py-example
version_suffix: -ubuntu24.04
build_args: |
PACKAGE_VERSION=0.0.0.dev0
DISTRIB_IMAGE=ubuntu
DISTRIB_RELEASE=24.04
GSTREAMER_BASE_IMAGE_RELEASE=${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
PY_BUILD_IMAGE=ghcr.io/${{ github.repository }}/py-build:${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
WEB_IMAGE=ghcr.io/${{ github.repository }}/gst-web:${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
JS_BASE_IMAGE_RELEASE=${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}
JS_BASE_IMAGE=ghcr.io/${{ github.repository }}/js-interposer
context: addons/example
name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish
steps:
- uses: actions/checkout@v4
- name: Build & publish ${{ matrix.name }} image
uses: ./.github/actions/build_and_publish_image
with:
build_args: ${{ matrix.build_args }}
context: ${{ matrix.context }}
dockerfile: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
push: ${{ github.event_name != 'pull_request' }}
subproject: ${{ matrix.name }}
tags: ghcr.io/${{ github.repository }}/${{ matrix.name }}:${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}${{ matrix.version_suffix }}
# Note: When modifying this job, copy modifications to all other workflow image jobs
upload_artifacts:
needs: component_images
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
env:
TMPDIR: /tmp
strategy:
matrix:
include:
- name: conda
source: /opt/selkies-gstreamer-conda.tar.gz
target: selkies-gstreamer-portable.tar.gz
- name: gst-web
source: /opt/gst-web.tar.gz
target: gst-web.tar.gz
- name: gstreamer
version_suffix: -ubuntu20.04
source: /opt/selkies-gstreamer-latest.tar.gz
target: selkies-gstreamer.tar.gz
- name: gstreamer
version_suffix: -ubuntu22.04
source: /opt/selkies-gstreamer-latest.tar.gz
target: selkies-gstreamer.tar.gz
- name: gstreamer
version_suffix: -ubuntu24.04
source: /opt/selkies-gstreamer-latest.tar.gz
target: selkies-gstreamer.tar.gz
- name: js-interposer
version_suffix: -ubuntu20.04
suffix: -deb
source: /opt/selkies-js-interposer_0.0.0.deb
target: selkies-js-interposer.deb
- name: js-interposer
version_suffix: -ubuntu22.04
suffix: -deb
source: /opt/selkies-js-interposer_0.0.0.deb
target: selkies-js-interposer.deb
- name: js-interposer
version_suffix: -ubuntu24.04
suffix: -deb
source: /opt/selkies-js-interposer_0.0.0.deb
target: selkies-js-interposer.deb
- name: js-interposer
version_suffix: -ubuntu20.04
suffix: -deb
source: /opt/selkies-js-interposer_0.0.0.deb
target: selkies-js-interposer.deb
platforms: linux/arm64
- name: js-interposer
version_suffix: -ubuntu22.04
suffix: -deb
source: /opt/selkies-js-interposer_0.0.0.deb
target: selkies-js-interposer.deb
platforms: linux/arm64
- name: js-interposer
version_suffix: -ubuntu24.04
suffix: -deb
source: /opt/selkies-js-interposer_0.0.0.deb
target: selkies-js-interposer.deb
platforms: linux/arm64
- name: js-interposer
version_suffix: -ubuntu20.04
suffix: -tar.gz
source: /opt/selkies-js-interposer_0.0.0.tar.gz
target: selkies-js-interposer.tar.gz
- name: js-interposer
version_suffix: -ubuntu22.04
suffix: -tar.gz
source: /opt/selkies-js-interposer_0.0.0.tar.gz
target: selkies-js-interposer.tar.gz
- name: js-interposer
version_suffix: -ubuntu24.04
suffix: -tar.gz
source: /opt/selkies-js-interposer_0.0.0.tar.gz
target: selkies-js-interposer.tar.gz
- name: js-interposer
version_suffix: -ubuntu20.04
suffix: -tar.gz
source: /opt/selkies-js-interposer_0.0.0.tar.gz
target: selkies-js-interposer.tar.gz
platforms: linux/arm64
- name: js-interposer
version_suffix: -ubuntu22.04
suffix: -tar.gz
source: /opt/selkies-js-interposer_0.0.0.tar.gz
target: selkies-js-interposer.tar.gz
platforms: linux/arm64
- name: js-interposer
version_suffix: -ubuntu24.04
suffix: -tar.gz
source: /opt/selkies-js-interposer_0.0.0.tar.gz
target: selkies-js-interposer.tar.gz
platforms: linux/arm64
- name: py-build
source: /opt/pypi/dist/selkies_gstreamer-0.0.0.dev0-py3-none-any.whl
target: selkies_gstreamer-0.0.0.dev0-py3-none-any.whl
name: ${{ matrix.name }}${{ matrix.version_suffix }}${{ matrix.suffix }}_${{ matrix.platforms || 'linux/amd64' }} build artifact extraction & upload
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: ${{ matrix.name }}${{ matrix.version_suffix }}${{ matrix.suffix }}_${{ matrix.platforms || 'linux/amd64' }} build artifact extraction
run: |
docker container create --name=copy --platform="${{ matrix.platforms || 'linux/amd64' }}" "ghcr.io/${{ github.repository }}/${{ matrix.name }}:${{ github.event_name != 'pull_request' && github.ref_name || 'main' }}${{ matrix.version_suffix }}"
docker container cp "copy:${{ matrix.source }}" "${{ env.TMPDIR }}/${{ matrix.target }}"
docker container rm --force --volumes copy
echo "release_arch=$(echo ${{ matrix.platforms || 'linux/amd64' }} | sed -e 's/\//\-/')" >> "$GITHUB_ENV"
- name: ${{ matrix.name }}${{ matrix.version_suffix }}${{ matrix.suffix }}_${{ matrix.platforms || 'linux/amd64' }} upload
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
overwrite: true
name: ${{ matrix.name }}${{ matrix.version_suffix }}${{ matrix.suffix }}_${{ env.release_arch }}
path: ${{ env.TMPDIR }}/${{ matrix.target }}