diff --git a/.github/workflows/deploy_ghcr.yml b/.github/workflows/deploy_ghcr.yml index 8e54eb4..583cea6 100644 --- a/.github/workflows/deploy_ghcr.yml +++ b/.github/workflows/deploy_ghcr.yml @@ -396,6 +396,57 @@ jobs: tags: ghcr.io/sdr-enthusiasts/docker-baseimage:acars-decoder labels: ${{ steps.meta.outputs.labels }} + deploy_ghcr_acars-decoder-soapy: + name: Deploy acars-decoder-soapy to ghcr.io + runs-on: ubuntu-latest + needs: [deploy_soapy-full] + permissions: + contents: read + packages: write + + steps: + # Check out our code + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 2 + + # Log into ghcr (so we can push images) + - name: Login to ghcr.io + uses: docker/login-action@v3.3.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Get metadata from repo + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.6.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Set up QEMU for multi-arch builds + - name: Set up QEMU + uses: docker/setup-qemu-action@v3.2.0 + + # Set up buildx for multi platform builds + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3.8.0 + + # Build & Push Dockerfile.acars (only push if this action was NOT triggered by a PR) + - name: Build & Push ghcr.io/sdr-enthusiasts/docker-baseimage:acars-decoder-soapy + uses: docker/build-push-action@v6.10.0 + with: + context: . + file: ./Dockerfile.acars-decoder-soapy + no-cache: true + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ghcr.io/sdr-enthusiasts/docker-baseimage:acars-decoder-soapy + labels: ${{ steps.meta.outputs.labels }} + deploy_soapyrtlsdr: name: Deploy soapyrtlsdr to ghcr.io needs: [deploy_ghcr_rtlsdr] @@ -447,6 +498,57 @@ jobs: tags: ghcr.io/sdr-enthusiasts/docker-baseimage:soapyrtlsdr labels: ${{ steps.meta.outputs.labels }} + deploy_soapy-full: + name: Deploy soapy-full to ghcr.io + needs: [deploy_soapyrtlsdr] + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + # Check out our code + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 2 + + # Log into ghcr (so we can push images) + - name: Login to ghcr.io + uses: docker/login-action@v3.3.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Get metadata from repo + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.6.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Set up QEMU for multi-arch builds + - name: Set up QEMU + uses: docker/setup-qemu-action@v3.2.0 + + # Set up buildx for multi platform builds + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3.8.0 + + # Build & Push Dockerfile (only push if this action was NOT triggered by a PR) + - name: Build & Push ghcr.io/sdr-enthusiasts/docker-baseimage:soapy-full + uses: docker/build-push-action@v6.10.0 + with: + context: . + file: ./Dockerfile.soapy-full + no-cache: true + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ghcr.io/sdr-enthusiasts/docker-baseimage:soapy-full + labels: ${{ steps.meta.outputs.labels }} + deploy_dump978-full: name: Deploy dump978-full to ghcr.io needs: [deploy_soapyrtlsdr] @@ -618,7 +720,7 @@ jobs: trigger_build_sdr-enthusiasts_docker-acarsdec: name: Trigger deploy of sdr-enthusiasts/docker-acarsdec - needs: [deploy_ghcr_acars-decoder] + needs: [deploy_ghcr_acars-decoder-soapy] runs-on: ubuntu-latest if: ${{ github.event.inputs.disable_upstream_triggers != 'true' }} env: @@ -634,7 +736,7 @@ jobs: trigger_build_sdr-enthusiasts_docker-dumpvdl2: name: Trigger deploy of sdr-enthusiasts/docker-dumpvdl2 - needs: [deploy_ghcr_acars-decoder] + needs: [deploy_ghcr_acars-decoder-soapy] runs-on: ubuntu-latest if: ${{ github.event.inputs.disable_upstream_triggers != 'true' }} env: @@ -650,7 +752,7 @@ jobs: trigger_build_sdr-enthusiasts_docker-vdlm2dec: name: Trigger deploy of sdr-enthusiasts/docker-vdlm2dec - needs: [deploy_ghcr_acars-decoder] + needs: [deploy_ghcr_acars-decoder-soapy] runs-on: ubuntu-latest if: ${{ github.event.inputs.disable_upstream_triggers != 'true' }} env: @@ -889,7 +991,7 @@ jobs: trigger_build_sdr-enthusiasts_rtlsdrairband: name: Trigger deploy of sdr-enthusiasts/docker-rtlsdrairband - needs: [deploy_ghcr_base] + needs: [deploy_ghcr_acars-decoder-soapy] runs-on: ubuntu-latest if: ${{ github.event.inputs.disable_upstream_triggers != 'true' }} env: diff --git a/.github/workflows/on_pr.yml b/.github/workflows/on_pr.yml index b78b81f..ed4406d 100644 --- a/.github/workflows/on_pr.yml +++ b/.github/workflows/on_pr.yml @@ -628,6 +628,104 @@ jobs: id: set-output run: echo "cleanupinfo=$TAG" >> $GITHUB_OUTPUT + deploy_ghcr_acars-decoder-soapy: + name: Test deploy acars-decoder-soapy to ghcr.io + # Define any dependent steps + needs: [deploy_soapy-full] + # Define dockerfile and image tag + env: + DOCKERFILE: Dockerfile.acars-decoder-soapy + TAG: acars-decoder-soapy + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # Define output (used to clean-up PR images pushed to ghcr.io) + outputs: + cleanupinfo: ${{ steps.set-output.outputs.cleanupinfo }} + steps: + # Check out our code + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + # List of files to check to trigger a rebuild on this job + - name: Get specific changed files + id: changed-files-specific + uses: tj-actions/changed-files@v45.0.5 + # Add dependent dockerfiles below the ${{ env.DOCKERFILE }} entry, one per line + with: + files: | + Dockerfile.base + Dockerfile.rtlsdr + Dockerfile.soapyrtlsdr + Dockerfile.soapy-full + Dockerfile.acars-decoder-soapy + - name: Get changed status of parent + id: changed-files-parent + uses: tj-actions/changed-files@v45.0.5 + # Add dependent dockerfiles, one per line + with: + files: | + Dockerfile.base + Dockerfile.rtlsdr + Dockerfile.soapyrtlsdr + Dockerfile.soapy-full + Dockerfile.acars-decoder-soapy + # Log into ghcr (so we can push images) + - name: Login to ghcr.io + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: docker/login-action@v3.3.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + # Get metadata from repo + - name: Extract metadata (tags, labels) for Docker + if: steps.changed-files-specific.outputs.any_changed == 'true' + id: meta + uses: docker/metadata-action@v5.6.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # Set up QEMU for multi-arch builds + - name: Set up QEMU + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: docker/setup-qemu-action@v3.2.0 + # Patch dockerfile to pull from PR-generated image + - name: Patch dockerfile + if: steps.changed-files-parent.outputs.any_changed == 'true' + id: patch-dockerfile + env: + SED_SEARCH: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + SED_TO_APPEND: -test-pr + run: | + set -x + sed -i "/^FROM ${SED_SEARCH//\//\\/}/ s/$/${SED_TO_APPEND}/" "$DOCKERFILE" + grep '^FROM ' "$DOCKERFILE" + # Set up buildx for multi platform builds + - name: Set up Docker Buildx + if: steps.changed-files-specific.outputs.any_changed == 'true' + id: buildx + uses: docker/setup-buildx-action@v3.8.0 + # Build & Push + - name: Test Build & Push ${{ env.IMAGE_NAME }}:${{ env.TAG }} + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: docker/build-push-action@v6.10.0 + with: + context: . + file: ${{ env.DOCKERFILE }} + no-cache: true + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: true + # Append "-test-pr-XXX" to image name + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}-test-pr + labels: ${{ steps.meta.outputs.labels }} + # Set output variable for dynamic matrix in clean-up steps + - name: Set clean-up info + if: steps.changed-files-specific.outputs.any_changed == 'true' + id: set-output + run: echo "cleanupinfo=$TAG" >> $GITHUB_OUTPUT + deploy_soapyrtlsdr: name: Test deploy soapyrtlsdr to ghcr.io # Define any dependent steps @@ -721,6 +819,102 @@ jobs: id: set-output run: echo "cleanupinfo=$TAG" >> $GITHUB_OUTPUT + deploy_soapy-full: + name: Test deploy soapy-full to ghcr.io + # Define any dependent steps + needs: [deploy_soapyrtlsdr] + # Define dockerfile and image tag + env: + DOCKERFILE: Dockerfile.soapy-full + TAG: soapy-full + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # Define output (used to clean-up PR images pushed to ghcr.io) + outputs: + cleanupinfo: ${{ steps.set-output.outputs.cleanupinfo }} + steps: + # Check out our code + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + # List of files to check to trigger a rebuild on this job + - name: Get specific changed files + id: changed-files-specific + uses: tj-actions/changed-files@v45.0.5 + # Add dependent dockerfiles below the ${{ env.DOCKERFILE }} entry, one per line + with: + files: | + Dockerfile.base + Dockerfile.rtlsdr + Dockerfile.soapyrtlsdr + Dockerfile.soapy-full + - name: Get changed status of parent + id: changed-files-parent + uses: tj-actions/changed-files@v45.0.5 + # Add dependent dockerfiles, one per line + with: + files: | + Dockerfile.base + Dockerfile.rtlsdr + Dockerfile.soapyrtlsdr + Dockerfile.soapy-full + # Log into ghcr (so we can push images) + - name: Login to ghcr.io + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: docker/login-action@v3.3.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + # Get metadata from repo + - name: Extract metadata (tags, labels) for Docker + if: steps.changed-files-specific.outputs.any_changed == 'true' + id: meta + uses: docker/metadata-action@v5.6.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # Set up QEMU for multi-arch builds + - name: Set up QEMU + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: docker/setup-qemu-action@v3.2.0 + # Patch dockerfile to pull from PR-generated image + - name: Patch dockerfile + if: steps.changed-files-parent.outputs.any_changed == 'true' + id: patch-dockerfile + env: + SED_SEARCH: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + SED_TO_APPEND: -test-pr + run: | + set -x + sed -i "/^FROM ${SED_SEARCH//\//\\/}/ s/$/${SED_TO_APPEND}/" "$DOCKERFILE" + grep '^FROM ' "$DOCKERFILE" + # Set up buildx for multi platform builds + - name: Set up Docker Buildx + if: steps.changed-files-specific.outputs.any_changed == 'true' + id: buildx + uses: docker/setup-buildx-action@v3.8.0 + # Build & Push Dockerfile (only push if this action was NOT triggered by a PR) + - name: Test Build & Push ${{ env.IMAGE_NAME }}:${{ env.TAG }} + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: docker/build-push-action@v6.10.0 + with: + context: . + file: ${{ env.DOCKERFILE }} + no-cache: true + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: true + # Append "-test-pr-XXX" to image name + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}-test-pr + labels: ${{ steps.meta.outputs.labels }} + # Set output variable for dynamic matrix in clean-up steps + - name: Set clean-up info + if: steps.changed-files-specific.outputs.any_changed == 'true' + id: set-output + run: echo "cleanupinfo=$TAG" >> $GITHUB_OUTPUT + deploy_dump978-full: name: Test deploy dump978-full to ghcr.io # Define any dependent steps @@ -1178,7 +1372,7 @@ jobs: trigger_build_sdr-enthusiasts_rtlsdrairband: name: Trigger deploy of sdr-enthusiasts/docker-rtlsdrairband - needs: [deploy_ghcr_base] + needs: [deploy_ghcr_acars-decoder-soapy] runs-on: ubuntu-latest env: WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_PAT_MIKENYE }} @@ -1208,7 +1402,7 @@ jobs: trigger_build_sdr-enthusiasts_docker-acarsdec: name: Trigger deploy of sdr-enthusiasts/docker-acarsdec - needs: [deploy_ghcr_acars-decoder] + needs: [deploy_ghcr_acars-decoder-soapy] runs-on: ubuntu-latest env: WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_PAT_MIKENYE }} @@ -1223,7 +1417,7 @@ jobs: trigger_build_sdr-enthusiasts_docker-dumpvdl2: name: Trigger deploy of sdr-enthusiasts/docker-dumpvdl2 - needs: [deploy_ghcr_acars-decoder] + needs: [deploy_ghcr_acars-decoder-soapy] runs-on: ubuntu-latest env: WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_PAT_MIKENYE }} @@ -1253,7 +1447,7 @@ jobs: trigger_build_sdr-enthusiasts_docker-dumphfdl: name: Trigger deploy of sdr-enthusiasts/docker-dumphfdl - needs: [deploy_ghcr_acars-decoder] + needs: [deploy_ghcr_acars-decoder-soapy] runs-on: ubuntu-latest env: WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_PAT_MIKENYE }} diff --git a/Dockerfile.acars-decoder-soapy b/Dockerfile.acars-decoder-soapy new file mode 100644 index 0000000..1721a8f --- /dev/null +++ b/Dockerfile.acars-decoder-soapy @@ -0,0 +1,51 @@ +FROM ghcr.io/sdr-enthusiasts/docker-baseimage:soapy-full + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# hadolint ignore=DL3008,SC2086,DL3008,SC2039 +RUN set -x && \ + TEMP_PACKAGES=() && \ + KEPT_PACKAGES=() && \ + # Required for building multiple packages. + TEMP_PACKAGES+=(build-essential) && \ + TEMP_PACKAGES+=(pkg-config) && \ + TEMP_PACKAGES+=(cmake) && \ + TEMP_PACKAGES+=(git) && \ + TEMP_PACKAGES+=(automake) && \ + TEMP_PACKAGES+=(autoconf) && \ + # required for S6 overlay + # curl kept for healthcheck + # ca-certificates kept for python + TEMP_PACKAGES+=(gnupg2) && \ + # packages for libacars + TEMP_PACKAGES+=(zlib1g-dev) && \ + TEMP_PACKAGES+=(libxml2-dev) && \ + KEPT_PACKAGES+=(zlib1g) && \ + KEPT_PACKAGES+=(libxml2) && \ + # packages for acarsserv + TEMP_PACKAGES+=(libsqlite3-dev) && \ + KEPT_PACKAGES+=(libsqlite3-0) && \ + # packages for rewriting the output JSON + KEPT_PACKAGES+=(jq) && \ + # install packages + apt-get update && \ + apt-get install -y --no-install-recommends \ + "${KEPT_PACKAGES[@]}" \ + "${TEMP_PACKAGES[@]}"\ + && \ + # libacars + git clone https://github.com/szpajder/libacars.git /src/libacars && \ + pushd /src/libacars && \ + git checkout master && \ + git rev-parse HEAD > /CONTAINER_VERSION && \ + mkdir build && \ + pushd build && \ + cmake ../ && \ + make && \ + make install && \ + popd && popd && \ + # Clean up + apt-get remove -y "${TEMP_PACKAGES[@]}" && \ + apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \ + rm -rf /src/* && \ + bash /scripts/clean-build.sh diff --git a/Dockerfile.base b/Dockerfile.base index de1129e..553fb19 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -47,6 +47,8 @@ RUN \ KEPT_PACKAGES+=(nano) && \ KEPT_PACKAGES+=(iputils-ping) && \ KEPT_PACKAGES+=(dnsutils) && \ + # used by enough images to warrant installing it in common (adds 17 MB to image size) + KEPT_PACKAGES+=(python3-minimal) && \ # install packages ## Builder fixes... mkdir -p /usr/sbin/ && \ diff --git a/Dockerfile.soapy-full b/Dockerfile.soapy-full new file mode 100644 index 0000000..95c1dbe --- /dev/null +++ b/Dockerfile.soapy-full @@ -0,0 +1,112 @@ +FROM ghcr.io/sdr-enthusiasts/docker-baseimage:soapyrtlsdr + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# hadolint ignore=DL3008,SC2086,DL4006,SC2039 +RUN set -x && \ + TEMP_PACKAGES=() && \ + KEPT_PACKAGES=() && \ + # packages needed to install + TEMP_PACKAGES+=(git) && \ + # packages needed to build + TEMP_PACKAGES+=(build-essential) && \ + TEMP_PACKAGES+=(cmake) && \ + TEMP_PACKAGES+=(pkg-config) && \ + TEMP_PACKAGES+=(libusb-1.0-0-dev) && \ + # dependencies for SoapySDR + # install packages + apt-get update && \ + apt-get install -y --no-install-recommends \ + "${KEPT_PACKAGES[@]}" \ + "${TEMP_PACKAGES[@]}" \ + && \ + if ! uname -m | grep -qs armv7; then \ + # install sdrplay + curl --location --output /tmp/install_sdrplay.sh https://raw.githubusercontent.com/sdr-enthusiasts/install-libsdrplay/main/install_sdrplay.sh && \ + chmod +x /tmp/install_sdrplay.sh && \ + /tmp/install_sdrplay.sh && \ + # Deploy SoapyRTLTCP + git clone https://github.com/pothosware/SoapyRTLTCP.git /src/SoapyRTLTCP && \ + pushd /src/SoapyRTLTCP && \ + mkdir -p /src/SoapyRTLTCP/build && \ + pushd /src/SoapyRTLTCP/build && \ + cmake ../ -DCMAKE_BUILD_TYPE=Release && \ + make all && \ + make install && \ + popd && popd && \ + ldconfig && \ + # deploy SoapySDRPlay + git clone https://github.com/pothosware/SoapySDRPlay.git /src/SoapySDRPlay && \ + pushd /src/SoapySDRPlay && \ + mkdir build && \ + pushd build && \ + cmake .. && \ + make && \ + make install && \ + popd && \ + popd && \ + ldconfig; \ + fi && \ + # deploy libmirisdr + git clone https://github.com/ericek111/libmirisdr-5.git /src/libmirisdr-5 && \ + pushd /src/libmirisdr-5 && \ + mkdir build && \ + pushd build && \ + cmake .. && \ + make && \ + make install && \ + popd && popd && \ + # deploy SoapyMiri + git clone https://github.com/ericek111/SoapyMiri.git /src/SoapyMiri && \ + pushd /src/SoapyMiri && \ + mkdir build && \ + pushd build && \ + cmake .. && \ + make -j4 && \ + make install && \ + popd && popd && \ + # deploy airspyhf + git clone https://github.com/airspy/airspyhf.git /src/airspyhf && \ + pushd /src/airspyhf && \ + mkdir -p /src/airspyhf/build && \ + pushd /src/airspyhf/build && \ + cmake ../ -DCMAKE_BUILD_TYPE=Release -DINSTALL_UDEV_RULES=ON && \ + make && \ + make install && \ + ldconfig && \ + popd && popd && \ + # Deploy SoapyAirspyHF + git clone https://github.com/pothosware/SoapyAirspyHF.git /src/SoapyAirspyHF && \ + pushd /src/SoapyAirspyHF && \ + mkdir -p /src/SoapyAirspyHF/build && \ + pushd /src/SoapyAirspyHF/build && \ + cmake ../ -DCMAKE_BUILD_TYPE=Release && \ + make all && \ + make install && \ + popd && popd && \ + ldconfig && \ + # deploy airspyone host + git clone https://github.com/airspy/airspyone_host.git /src/airspyone_host && \ + pushd /src/airspyone_host && \ + mkdir -p /src/airspyone_host/build && \ + pushd /src/airspyone_host/build && \ + cmake ../ -DINSTALL_UDEV_RULES=ON && \ + make && \ + make install && \ + ldconfig && \ + popd && popd && \ + # Deploy SoapyAirspy + git clone https://github.com/pothosware/SoapyAirspy.git /src/SoapyAirspy && \ + pushd /src/SoapyAirspy && \ + mkdir build && \ + pushd build && \ + cmake .. && \ + make && \ + make install && \ + popd && \ + popd && \ + # Clean up + apt-get remove -y "${TEMP_PACKAGES[@]}" && \ + apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \ + rm -rf /src/* && \ + bash /scripts/clean-build.sh diff --git a/Dockerfile.wreadsb b/Dockerfile.wreadsb index 4ea882b..306d79e 100644 --- a/Dockerfile.wreadsb +++ b/Dockerfile.wreadsb @@ -41,7 +41,10 @@ RUN set -x && \ DISABLE_RTLSDR_ZEROCOPY_WORKAROUND=yes \ -j "$(nproc)" \ && \ - find "/src/readsb" -maxdepth 1 -executable -type f -exec cp -v {} /usr/local/bin/ \; && \ + cp readsb /usr/local/bin/ && \ + popd && \ + pushd /usr/local/bin && \ + ln -s readsb viewadsb && \ popd && \ ldconfig && \ # readsb: simple tests