-
Notifications
You must be signed in to change notification settings - Fork 38
General improvements to the docker-dompose examples #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jonasohland
wants to merge
6
commits into
dmf-mxl:main
Choose a base branch
from
jonasohland:fix/docker-compose-example
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+305
−150
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f3cdc34
Add dockerfile to build all tools, fake grain reader
jonasohland d20dfd8
Rewrite docker compose example
jonasohland 2976579
Add flow configs, remove old dockerfiles
jonasohland bbfdc99
Remove redundant flow config files
jonasohland bca9658
Add missing license headers
jonasohland d7ba78f
Use dumb-init from trixie repo in example Dockerfile
jonasohland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,65 @@ | ||
| # SPDX-FileCopyrightText: 2025 Contributors to the Media eXchange Layer project. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| FROM debian:trixie-slim AS base | ||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| gstreamer1.0-plugins-good \ | ||
| gstreamer1.0-plugins-base \ | ||
| curl zip unzip tar \ | ||
| dumb-init \ | ||
| && rm -r /var/lib/apt/lists/* | ||
|
|
||
|
|
||
| RUN useradd -m mxl | ||
|
|
||
| FROM base AS builder | ||
|
|
||
| ARG CLANG_VERSION=19 | ||
| RUN apt-get update && apt-get install -y \ | ||
| build-essential bison flex \ | ||
| cmake ninja-build \ | ||
| pkg-config \ | ||
| git \ | ||
| libgstreamer1.0-dev \ | ||
| libgstreamer-plugins-base1.0-dev | ||
|
|
||
| USER mxl | ||
|
|
||
| WORKDIR /home/mxl | ||
|
|
||
| RUN git clone https://github.com/microsoft/vcpkg.git "${HOME}/vcpkg" \ | ||
| && cd "${HOME}/vcpkg" \ | ||
| && ./bootstrap-vcpkg.sh -disableMetrics | ||
|
|
||
| RUN mkdir mxl | ||
| COPY CMakeLists.txt mxl/CMakeLists.txt | ||
| COPY CMakePresets.json mxl/CMakePresets.json | ||
| COPY Doxyfile.in mxl/Doxyfile.in | ||
| COPY vcpkg.json mxl/vcpkg.json | ||
| COPY lib mxl/lib | ||
| COPY cmake mxl/cmake | ||
| COPY tools mxl/tools | ||
| COPY utils mxl/utils | ||
|
|
||
| RUN cmake -S "${HOME}/mxl" --preset Linux-GCC-Release -DCMAKE_INSTALL_PREFIX=/usr | ||
| RUN ninja -C "${HOME}/mxl/build/Linux-GCC-Release" | ||
|
|
||
| USER 0:0 | ||
| RUN ninja -C "/home/mxl/mxl/build/Linux-GCC-Release" install | ||
|
|
||
| FROM base AS mxl | ||
| COPY --from=builder /usr/lib/x86_64-linux-gnu/libmxl* /usr/lib/x86_64-linux-gnu/ | ||
| COPY --from=builder /usr/bin/mxl-* /usr/bin/ | ||
| USER mxl | ||
| WORKDIR /home/mxl | ||
| ENTRYPOINT ["/bin/bash", "-c"] | ||
|
|
||
| FROM mxl AS mxl-info | ||
| ENTRYPOINT ["/usr/bin/mxl-info"] | ||
|
|
||
| FROM mxl AS mxl-gst-testsrc | ||
| ENTRYPOINT ["/usr/bin/mxl-gst-testsrc"] | ||
|
|
||
| FROM mxl AS mxl-fake-reader | ||
| COPY examples/scripts/fake-reader.sh /home/mxl/fake-reader.sh | ||
| ENTRYPOINT ["/usr/bin/dumb-init", "--", "/home/mxl/fake-reader.sh"] | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,69 +1,83 @@ | ||
| # SPDX-FileCopyrightText: 2025 Contributors to the Media eXchange Layer project. | ||
| # SPDX-FileCopyrightText: 2026 Contributors to the Media eXchange Layer project. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: mxl-example | ||
| volumes: | ||
| mxl-domain: | ||
| driver: local | ||
| driver_opts: | ||
| device: none | ||
| type: tmpfs | ||
| o: nosuid,strictatime,uid=1000,gid=1000,mode=0755 | ||
| services: | ||
| init: | ||
| image: alpine | ||
| command: ["sh", "-c", "mkdir -p /dev/shm/mxl"] | ||
| # Writes a test video flow to the domain | ||
| video-flow-writer: | ||
| build: | ||
| dockerfile: examples/Dockerfile | ||
| context: .. | ||
| target: mxl-gst-testsrc | ||
| volumes: | ||
| - mxl-domain:/mxl-domain | ||
| - type: bind | ||
| source: /dev/shm | ||
| target: /dev/shm | ||
| restart: no | ||
|
|
||
| writer-media-function: | ||
| image: mxl-writer | ||
| profiles: [test-source] | ||
| depends_on: | ||
| - init | ||
| source: flow-configs | ||
| target: /home/mxl/flow-configs | ||
| command: -d /mxl-domain -v flow-configs/flow-video-v210.json | ||
| # Writes a test audio flow to the domain | ||
| audio-flow-writer: | ||
| build: | ||
| dockerfile: examples/Dockerfile | ||
| context: .. | ||
| dockerfile: examples/Dockerfile.writer.txt | ||
| restart: unless-stopped | ||
| target: mxl-gst-testsrc | ||
| volumes: | ||
| - type: volume | ||
| source: mxl-domain | ||
| target: /mxl-domain | ||
| - type: bind | ||
| source: /dev/shm/mxl | ||
| target: /domain | ||
|
|
||
| writer-looper-video-media-function: | ||
| image: mxl-writer-video-looper | ||
| profiles: [looping-file-source] | ||
| depends_on: | ||
| - init | ||
| source: flow-configs | ||
| target: /home/mxl/flow-configs | ||
| command: -d /mxl-domain -a flow-configs/flow-audio.json | ||
| # Simulates a video flow reader | ||
| video-fake-reader: | ||
| build: | ||
| dockerfile: examples/Dockerfile | ||
| context: .. | ||
| dockerfile: examples/Dockerfile.writer.video.loop.txt | ||
| restart: unless-stopped | ||
| target: mxl-fake-reader | ||
| volumes: | ||
| - type: bind | ||
| source: /dev/shm/mxl | ||
| target: /domain | ||
|
|
||
| writer-looper-audio-media-function: | ||
| image: mxl-writer-audio-looper | ||
| profiles: [looping-file-source] | ||
| depends_on: | ||
| - init | ||
| - type: volume | ||
| source: mxl-domain | ||
| target: /mxl-domain | ||
| command: --domain /mxl-domain --video-flow-id 5fbec3b1-1b0f-417d-9059-8b94a47197ed --interval 1 | ||
| # Simulates an audio flow reader | ||
| audio-fake-reader: | ||
| build: | ||
| dockerfile: examples/Dockerfile | ||
| context: .. | ||
| dockerfile: examples/Dockerfile.writer.audio.loop.txt | ||
| restart: unless-stopped | ||
| target: mxl-fake-reader | ||
| volumes: | ||
| - type: bind | ||
| source: /dev/shm/mxl | ||
| target: /domain | ||
|
|
||
| reader-media-function: | ||
| image: mxl-reader | ||
| depends_on: | ||
| - init | ||
| - type: volume | ||
| source: mxl-domain | ||
| target: /mxl-domain | ||
| command: --domain /mxl-domain --audio-flow-id 5fbec3b1-1b0f-417d-9059-8b94a47197ed --interval 1 | ||
| # Prints the video flow information every 5 seconds. | ||
| video-flow-info: | ||
| build: | ||
| dockerfile: examples/Dockerfile | ||
| context: .. | ||
| dockerfile: examples/Dockerfile.reader.txt | ||
| restart: unless-stopped | ||
| target: mxl-info | ||
| volumes: | ||
| - type: bind | ||
| source: /dev/shm/mxl | ||
| target: /domain | ||
| stdin_open: true | ||
| tty: true | ||
| - type: volume | ||
| source: mxl-domain | ||
| target: /mxl-domain | ||
| entrypoint: ["/usr/bin/dumb-init", "--"] | ||
| command: ["/bin/bash", "-c", "trap 'exit 0' SIGINT SIGTERM; while true; do mxl-info mxl:///mxl-domain?id=5fbec3b1-1b0f-417d-9059-8b94a47197ed; sleep 5; done"] | ||
| # Prints the audio flow information every 5 seconds. | ||
| audio-flow-info: | ||
| build: | ||
| dockerfile: examples/Dockerfile | ||
| context: .. | ||
| target: mxl-info | ||
| volumes: | ||
| - type: volume | ||
| source: mxl-domain | ||
| target: /mxl-domain | ||
| entrypoint: ["/usr/bin/dumb-init", "--"] | ||
| command: ["/bin/bash", "-c", "trap 'exit 0' SIGINT SIGTERM; while true; do mxl-info mxl:///mxl-domain?id=b3bb5be7-9fe9-4324-a5bb-4c70e1084449; sleep 5; done"] |
This file contains hidden or 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,23 @@ | ||
| { | ||
| "$copyright": "SPDX-FileCopyrightText: 2025 Contributors to the Media eXchange Layer project.", | ||
| "$license": "SPDX-License-Identifier: Apache-2.0", | ||
| "description": "MXL Audio Flow", | ||
| "format": "urn:x-nmos:format:audio", | ||
| "tags": { | ||
| "urn:x-nmos:tag:grouphint/v1.0": [ | ||
| "Media Function XYZ:Audio" | ||
| ] | ||
| }, | ||
| "label": "MXL Audio Flow", | ||
| "version": "1441812152:154331951", | ||
| "id": "b3bb5be7-9fe9-4324-a5bb-4c70e1084449", | ||
| "media_type": "audio/float32", | ||
| "sample_rate": { | ||
| "numerator": 48000 | ||
| }, | ||
| "channel_count": 2, | ||
| "bit_depth": 32, | ||
| "parents": [], | ||
| "source_id": "2aa143ac-0ab7-4d75-bc32-5c00c13d186f", | ||
| "device_id": "169feb2c-3fae-42a5-ae2e-f6f8cbce29cf" | ||
| } |
This file contains hidden or 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,3 @@ | ||
| SPDX-FileCopyrightText: 2025 Contributors to the Media eXchange Layer project. | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 |
This file contains hidden or 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,43 @@ | ||
| { | ||
| "$copyright": "SPDX-FileCopyrightText: 2025 Contributors to the Media eXchange Layer project.", | ||
| "$license": "SPDX-License-Identifier: Apache-2.0", | ||
| "description": "MXL Test Flow, 1080p29", | ||
| "id": "5fbec3b1-1b0f-417d-9059-8b94a47197ed", | ||
| "tags": { | ||
| "urn:x-nmos:tag:grouphint/v1.0": [ | ||
| "Media Function XYZ:Video" | ||
| ] | ||
| }, | ||
| "format": "urn:x-nmos:format:video", | ||
| "label": "MXL Test Flow, 1080p29", | ||
| "parents": [], | ||
| "media_type": "video/v210", | ||
| "grain_rate": { | ||
| "numerator": 30000, | ||
| "denominator": 1001 | ||
| }, | ||
| "frame_width": 1920, | ||
| "frame_height": 1080, | ||
| "interlace_mode": "progressive", | ||
| "colorspace": "BT709", | ||
| "components": [ | ||
| { | ||
| "name": "Y", | ||
| "width": 1920, | ||
| "height": 1080, | ||
| "bit_depth": 10 | ||
| }, | ||
| { | ||
| "name": "Cb", | ||
| "width": 960, | ||
| "height": 1080, | ||
| "bit_depth": 10 | ||
| }, | ||
| { | ||
| "name": "Cr", | ||
| "width": 960, | ||
| "height": 1080, | ||
| "bit_depth": 10 | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,3 @@ | ||
| SPDX-FileCopyrightText: 2025 Contributors to the Media eXchange Layer project. | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.