-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build and publish docker containers (#444)
* build and publish docker containers * changes to supported `cmake` platforms: * depreciate `rpiv1`, `armv7-generic`, and `armv8-generic` and build platforms * change default build platform to `native` * rename `default` to `generic` * enable a series of compile warnings and cleanup code * remove `SSE` specific code - let the compiler "do the right thing" * remove some no longer supported windows `ifdef`'s * fix CTCSS bug that could miss a tone when multiple tones have the same power (happens with less accurate floating point operations, ie i386)
- Loading branch information
1 parent
6aaf698
commit dad1a8b
Showing
25 changed files
with
317 additions
and
287 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,51 @@ | ||
name: Build and Publish Containers | ||
|
||
on: | ||
push: | ||
branches: [main, unstable] | ||
tags: ['v*'] | ||
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '29 13 * * *' # run daily | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Runner Info | ||
run: printenv | sort | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Container metadata | ||
id: metadata | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
|
||
# Add support for more platforms with QEMU - https://github.com/docker/setup-qemu-action | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: linux/amd64, linux/386, linux/arm64, linux/arm/v6, linux/arm/v7 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: true | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
|
This file contains 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
This file contains 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,100 @@ | ||
# build container | ||
FROM debian:bookworm-slim AS build | ||
|
||
# set working dir | ||
WORKDIR /app | ||
|
||
# install build dependencies | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
cmake \ | ||
libmp3lame-dev \ | ||
libshout3-dev \ | ||
libconfig++-dev \ | ||
libfftw3-dev \ | ||
libsoapysdr-dev \ | ||
libpulse-dev \ | ||
\ | ||
git \ | ||
ca-certificates \ | ||
libusb-1.0-0-dev \ | ||
debhelper \ | ||
pkg-config \ | ||
&& \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# compile / install rtl-sdr-blog version of rtl-sdr for v4 support | ||
RUN git clone https://github.com/rtlsdrblog/rtl-sdr-blog && \ | ||
cd rtl-sdr-blog/ && \ | ||
dpkg-buildpackage -b --no-sign && \ | ||
cd .. && \ | ||
dpkg -i librtlsdr0_*.deb && \ | ||
dpkg -i librtlsdr-dev_*.deb && \ | ||
dpkg -i rtl-sdr_*.deb | ||
|
||
|
||
# TODO: build anything from source? | ||
|
||
# copy in the rtl_airband source | ||
COPY CMakeLists.txt src /app/ | ||
|
||
# configure and build | ||
# TODO: detect platforms | ||
RUN uname -m && \ | ||
echo | gcc -### -v -E - | tee /app/compiler_native_info.txt && \ | ||
cmake -B build_dir -DPLATFORM=generic -DCMAKE_BUILD_TYPE=Release -DNFM=TRUE -DBUILD_UNITTESTS=TRUE && \ | ||
VERBOSE=1 cmake --build build_dir -j4 | ||
|
||
# make sure unit tests pass | ||
RUN ./build_dir/unittests | ||
|
||
|
||
# application container | ||
FROM debian:bookworm-slim | ||
|
||
# set working dir | ||
WORKDIR /app | ||
|
||
# install runtime dependencies | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y --no-install-recommends \ | ||
tini \ | ||
libc6 \ | ||
libmp3lame0 \ | ||
libshout3 \ | ||
libconfig++9v5 \ | ||
libfftw3-single3 \ | ||
libsoapysdr0.8 \ | ||
libpulse0 \ | ||
libusb-1.0-0-dev \ | ||
&& \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# install (from build container) rtl-sdr-blog version of rtl-sdr for v4 support | ||
COPY --from=build /app/librtlsdr0_*.deb /app/librtlsdr-dev_*.deb /app/rtl-sdr_*.deb ./ | ||
RUN dpkg -i librtlsdr0_*.deb && \ | ||
dpkg -i librtlsdr-dev_*.deb && \ | ||
dpkg -i rtl-sdr_*.deb && \ | ||
rm -rf *.deb && \ | ||
echo '' | tee --append /etc/modprobe.d/rtl_sdr.conf && \ | ||
echo 'blacklist dvb_usb_rtl28xxun' | tee --append /etc/modprobe.d/rtl_sdr.conf && \ | ||
echo 'blacklist rtl2832' | tee --append /etc/modprobe.d/rtl_sdr.conf && \ | ||
echo 'blacklist rtl2830' | tee --append /etc/modprobe.d/rtl_sdr.conf | ||
|
||
# Copy rtl_airband from the build container | ||
COPY LICENSE /opt/rtl_airband/ | ||
COPY --from=build /app/build_dir/unittests /opt/rtl_airband/ | ||
COPY --from=build /app/build_dir/rtl_airband /opt/rtl_airband/ | ||
RUN chmod a+x /opt/rtl_airband/unittests /opt/rtl_airband/rtl_airband | ||
|
||
# make sure unit tests pass | ||
RUN /opt/rtl_airband/unittests | ||
|
||
# Use tini as init and run rtl_airband | ||
ENTRYPOINT ["/usr/bin/tini", "--"] | ||
CMD ["/opt/rtl_airband/rtl_airband", "-F", "-e"] |
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -33,4 +33,4 @@ | |
|
||
#define SHOUT_SET_METADATA @SHOUT_SET_METADATA@ | ||
|
||
#endif // !_CONFIG_H | ||
#endif /* _CONFIG_H */ |
This file contains 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
This file contains 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
Oops, something went wrong.