diff --git a/.github/workflows/docker-ll-hls.yml b/.github/workflows/docker-ll-hls.yml new file mode 100644 index 00000000..098e33ad --- /dev/null +++ b/.github/workflows/docker-ll-hls.yml @@ -0,0 +1,44 @@ +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..." + 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." diff --git a/docker/Dockerfile_Process b/docker/Dockerfile_Process index eb0784e4..ef1002a8 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: Name of the LL-HLS plugin zip file. It must be in the build context (e.g. repo root when using: docker build -f docker/Dockerfile_Process .). +# --build-arg LLHLSPluginZip='low-latency-hls-plugin.zip' +# + FROM ubuntu:24.04 @@ -31,22 +38,26 @@ ARG InstallMediaPush ARG MediaPushVersion ARG UseSupervisor=false ARG BranchName=master +ARG InstallLLHLSPlugin=false +ARG LLHLSPluginZip=low-latency-hls-plugin.zip ENV UseSupervisor=${UseSupervisor} #Running update and install makes the builder not to use cache which resolves some updates -RUN apt-get update && apt-get upgrade -y && apt-get install -y curl wget iproute2 cron logrotate dnsutils iptables jq +RUN apt-get update && apt-get upgrade -y && apt-get install -y curl wget iproute2 cron logrotate dnsutils iptables jq unzip alien + +COPY . /build_context -ADD ./${AntMediaServer} /home +RUN mkdir -p /home && if [ -n "${AntMediaServer}" ]; then cp "/build_context/${AntMediaServer}" /home/; fi -RUN cd home \ +RUN cd /home \ && pwd \ && wget https://raw.githubusercontent.com/ant-media/Scripts/${BranchName}/install_ant-media-server.sh \ && chmod 755 install_ant-media-server.sh RUN cd /home \ && pwd \ - && if [ -n "$AntMediaServer" ]; then \ + && if [ -n "${AntMediaServer}" ]; then \ ./install_ant-media-server.sh -i ${AntMediaServer} -s false; \ elif [ -n "$LicenseKey" ]; then \ ./install_ant-media-server.sh -l ${LicenseKey} -s false; \ @@ -122,4 +133,33 @@ RUN if [ "true" = "$UseSupervisor" ]; then \ ############################################################################## + +RUN if [ "$InstallLLHLSPlugin" = "true" ]; then \ + if [ ! -f "/build_context/${LLHLSPluginZip}" ]; then \ + echo "ERROR: LL-HLS Plugin ZIP file not found at /build_context/${LLHLSPluginZip}. Aborting."; \ + echo "Please ensure '${LLHLSPluginZip}' is in the build context."; \ + exit 1; \ + fi; \ + cp "/build_context/${LLHLSPluginZip}" /home/; \ + fi + +RUN touch /.dockerenv + +RUN if [ "$InstallLLHLSPlugin" = "true" ]; then \ + echo "Installing LL-HLS Plugin..."; \ + cd /home && \ + unzip -o ${LLHLSPluginZip} && \ + cd low-latency-hls-plugin && \ + bash -x install_low-latency-hls-plugin.sh && \ + cd /home && \ + 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 -rf /build_context + +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", "--" ]