From 825f69eea74b018a87b473c5d69f1a44cd32ebbb Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 19 May 2025 10:56:49 +0300 Subject: [PATCH 1/5] Enable LL-HLS plugin support in Dockerfile --- docker/Dockerfile_Process | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docker/Dockerfile_Process b/docker/Dockerfile_Process index 723251bf..7430744f 100644 --- a/docker/Dockerfile_Process +++ b/docker/Dockerfile_Process @@ -22,6 +22,13 @@ # * Supervisor Configuration (Optional): If you want to use Supervisor to manage the Ant Media Server process, you can enable as follows. With this configuration, you can easily restart, stop the service, or run the `enable_ssl.sh` script for Ant Media Server. # --build-arg UseSupervisor='true' # +# * InstallLLHLSPlugin: Set this variable to 'true' to enable LL-HLS plugin to Ant Media Server. +# --build-arg InstallLLHLSPlugin='true' +# +# * LLHLSPluginZip: If the LL-HLS plugin is in the same folder as the Dockerfile, no path is needed. Otherwise, you must provide the path manually. +# --build-arg LLHLSPluginZip='low-latency-hls-plugin.zip' +# + FROM ubuntu:22.04 @@ -31,6 +38,8 @@ ARG InstallMediaPush ARG MediaPushVersion ARG UseSupervisor=false ARG BranchName=master +ARG InstallLLHLSPlugin=false +ARG LLHLSPluginZip=low-latency-hls-plugin.zip ENV UseSupervisor=${UseSupervisor} @@ -122,4 +131,21 @@ RUN if [ "true" = "$UseSupervisor" ]; then \ ############################################################################## + +ADD ./${LLHLSPluginZip} /home/ + +RUN touch /.dockerenv + +RUN if [ "$InstallLLHLSPlugin" = "true" ]; then \ + cd /home && \ + unzip ${LLHLSPluginZip} && \ + cd low-latency-hls-plugin && \ + chmod +x install_low-latency-hls-plugin.sh && \ + bash -x install_low-latency-hls-plugin.sh && \ + cd /home && \ + rm -rf ${LLHLSPluginZip} low-latency-hls-plugin; \ + fi + +RUN rm -f /.dockerenv + ENTRYPOINT [ "sh", "-c", "if [ \"$UseSupervisor\" = \"true\" ]; then exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf; else exec /usr/local/antmedia/start.sh \"$@\"; fi", "--" ] From 834d80b2a68da05509b5b6337b13417724b9a3e1 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 19 May 2025 11:30:24 +0300 Subject: [PATCH 2/5] Update Dockerfile_Process --- docker/Dockerfile_Process | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile_Process b/docker/Dockerfile_Process index 7430744f..a316546e 100644 --- a/docker/Dockerfile_Process +++ b/docker/Dockerfile_Process @@ -134,7 +134,12 @@ RUN if [ "true" = "$UseSupervisor" ]; then \ ADD ./${LLHLSPluginZip} /home/ -RUN touch /.dockerenv +RUN touch /.dockerenv + +RUN if [ "$InstallLLHLSPlugin" = "true" ] && [ ! -f "/home/${LLHLSPluginZip}" ]; then \ + echo "LLHLS Plugin ZIP file not found at /home/${LLHLSPluginZip}. Aborting."; \ + exit 1; \ + fi RUN if [ "$InstallLLHLSPlugin" = "true" ]; then \ cd /home && \ From 78dc64814601c5a0fe76e836362f09fa4c405d4c Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 23 Jun 2025 12:14:52 +0300 Subject: [PATCH 3/5] Create docker-ll-hls.yml --- .github/workflows/docker-ll-hls.yml | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/docker-ll-hls.yml diff --git a/.github/workflows/docker-ll-hls.yml b/.github/workflows/docker-ll-hls.yml new file mode 100644 index 00000000..428e0dad --- /dev/null +++ b/.github/workflows/docker-ll-hls.yml @@ -0,0 +1,47 @@ +name: Test LL-HLS Plugin Installation + +on: [push] + +env: + DEBUG: true + +jobs: + test-llhls: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Download LL-HLS plugin zip + run: | + curl -L -o low-latency-hls-plugin.zip ${{ secrets.LLHLS_PLUGIN_URL }} + + - name: Build Docker Image with LL-HLS Plugin + run: | + docker build -f docker/Dockerfile_Process \ + --build-arg LicenseKey=${{ secrets.ENTERPRISE_LICENSE }}" \ + --build-arg InstallLLHLSPlugin=true \ + -t antmedia-llhls:test . + + - name: Run Container and Validate LL-HLS Installation + run: | + docker run -d -p 5080:5080 --name antmedia-llhls antmedia-llhls:test + sleep 30 + + echo "Checking if LL-HLS plugin is installed..." + docker run -d -p 5080:5080 --name antmedia-llhls antmedia-llhls:test + sleep 30 + + echo "Searching for low-latency-hls.jar under /usr/local/antmedia/webapps/" + FOUND=$(docker exec antmedia-llhls find /usr/local/antmedia/webapps/ -type f -name "low-latency-hls.jar" || true) + + if [ -n "$FOUND" ]; then + echo "$FOUND" + else + exit 1 + fi + echo "LL-HLS Plugin installed successfully." From 816e29c0b50f0a0e12aba5771e49e86182aa164d Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 23 Jun 2025 12:16:46 +0300 Subject: [PATCH 4/5] Fix typo --- .github/workflows/docker-ll-hls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-ll-hls.yml b/.github/workflows/docker-ll-hls.yml index 428e0dad..4a49d975 100644 --- a/.github/workflows/docker-ll-hls.yml +++ b/.github/workflows/docker-ll-hls.yml @@ -23,7 +23,7 @@ jobs: - name: Build Docker Image with LL-HLS Plugin run: | docker build -f docker/Dockerfile_Process \ - --build-arg LicenseKey=${{ secrets.ENTERPRISE_LICENSE }}" \ + --build-arg LicenseKey="${{ secrets.ENTERPRISE_LICENSE }}" \ --build-arg InstallLLHLSPlugin=true \ -t antmedia-llhls:test . From a22a3782b5f8682b67eecf450dd5864feb957d7b Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 23 Jun 2025 13:28:22 +0300 Subject: [PATCH 5/5] Update Dockerfile_Process --- docker/Dockerfile_Process | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile_Process b/docker/Dockerfile_Process index a316546e..6f88957d 100644 --- a/docker/Dockerfile_Process +++ b/docker/Dockerfile_Process @@ -137,20 +137,25 @@ ADD ./${LLHLSPluginZip} /home/ RUN touch /.dockerenv RUN if [ "$InstallLLHLSPlugin" = "true" ] && [ ! -f "/home/${LLHLSPluginZip}" ]; then \ - echo "LLHLS Plugin ZIP file not found at /home/${LLHLSPluginZip}. Aborting."; \ + echo "ERROR: LL-HLS Plugin ZIP file not found at /home/${LLHLSPluginZip}. Aborting."; \ + echo "Please ensure '${LLHLSPluginZip}' is in the same directory as the Dockerfile."; \ exit 1; \ fi RUN if [ "$InstallLLHLSPlugin" = "true" ]; then \ + echo "Installing LL-HLS Plugin..."; \ cd /home && \ unzip ${LLHLSPluginZip} && \ cd low-latency-hls-plugin && \ - chmod +x install_low-latency-hls-plugin.sh && \ bash -x install_low-latency-hls-plugin.sh && \ cd /home && \ - rm -rf ${LLHLSPluginZip} low-latency-hls-plugin; \ + rm -rf ${LLHLSPluginZip} low-latency-hls-plugin && \ + echo "LL-HLS Plugin installation completed successfully."; \ + else \ + echo "LL-HLS Plugin installation skipped (InstallLLHLSPlugin=${InstallLLHLSPlugin})"; \ fi + RUN rm -f /.dockerenv ENTRYPOINT [ "sh", "-c", "if [ \"$UseSupervisor\" = \"true\" ]; then exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf; else exec /usr/local/antmedia/start.sh \"$@\"; fi", "--" ]