Skip to content

Commit

Permalink
various (#347)
Browse files Browse the repository at this point in the history
* install python3-minimal in base image

this increases the base image size by 17 MB but will save on duplication
as this is currently installed in 3 different images separately

* wreadsb: save some duplication with a symbolic link

readsb / viewadsb are the same binary with different behaviour depending
on the executed name, so viewadsb can be a symlink to readsb

* add soapy-full baseimage

* add baseimage acars-decoder-soapy

* soapy-full: add test build

* add acars-decoder-soapy to test build

* change various triggers to new baseimage requirement

* fixup acars-decoder-soapy dependency for on_pr workflow

* soapy-full: don't use SDRplay on armv7, not supported
  • Loading branch information
wiedehopf authored Jan 12, 2025
1 parent 13ae07e commit 43d0cf6
Show file tree
Hide file tree
Showing 6 changed files with 473 additions and 9 deletions.
110 changes: 106 additions & 4 deletions .github/workflows/deploy_ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
fetch-depth: 2

# Log into ghcr (so we can push images)
- name: Login to ghcr.io
uses: docker/[email protected]
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/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Set up QEMU for multi-arch builds
- name: Set up QEMU
uses: docker/[email protected]

# Set up buildx for multi platform builds
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

# 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/[email protected]
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]
Expand Down Expand Up @@ -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/[email protected]
with:
fetch-depth: 2

# Log into ghcr (so we can push images)
- name: Login to ghcr.io
uses: docker/[email protected]
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/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Set up QEMU for multi-arch builds
- name: Set up QEMU
uses: docker/[email protected]

# Set up buildx for multi platform builds
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

# 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/[email protected]
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]
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
202 changes: 198 additions & 4 deletions .github/workflows/on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
# 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/[email protected]
# 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/[email protected]
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/[email protected]
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/[email protected]
# 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/[email protected]
# Build & Push
- name: Test Build & Push ${{ env.IMAGE_NAME }}:${{ env.TAG }}
if: steps.changed-files-specific.outputs.any_changed == 'true'
uses: docker/[email protected]
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
Expand Down Expand Up @@ -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/[email protected]
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/[email protected]
# 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/[email protected]
# 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/[email protected]
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/[email protected]
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/[email protected]
# 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/[email protected]
# 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/[email protected]
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
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
Loading

0 comments on commit 43d0cf6

Please sign in to comment.