diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 3aaa5f35..b4e3f266 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -30,10 +30,9 @@ jobs: - uses: actions/checkout@v4 - name: docker build run: | - cd docker - docker build -f Dockerfile.vkfft . -t iqtlabs/gamutrf-vkfft:latest - docker build -f Dockerfile.base . -t iqtlabs/gamutrf-base:latest - cd .. + docker build -f docker/Dockerfile.vkfft docker -t iqtlabs/gamutrf-vkfft:latest + docker build -f docker/Dockerfile.driver docker -t iqtlabs/gamutrf-driver:latest + docker build -f docker/Dockerfile.base docker -t iqtlabs/gamutrf-base:latest docker build -f Dockerfile . -t iqtlabs/gamutrf:latest docker build -f docker/Dockerfile.torchsig . -t iqtlabs/gamutrf-torchsig:latest docker run -t iqtlabs/gamutrf:latest gamutrf-scan --help diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 62d8feff..e246d8f3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -40,6 +40,15 @@ jobs: push: true tags: iqtlabs/gamutrf-vkfft:${{ steps.change_version.outputs.VERSION }} if: github.repository == 'iqtlabs/gamutrf' && github.event_name == 'push' + - name: Build and push platforms driver + uses: docker/build-push-action@v5 + with: + context: docker + file: docker/Dockerfile.driver + platforms: linux/amd64,linux/arm64 + push: true + tags: iqtlabs/gamutrf-driver:${{ steps.change_version.outputs.VERSION }} + if: github.repository == 'iqtlabs/gamutrf' && github.event_name == 'push' - name: Build and push platforms base uses: docker/build-push-action@v5 with: diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 847506ae..86707951 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -31,46 +31,6 @@ COPY --from=iqtlabs/gamutrf-vkfft:latest /root /root/uhd_sample_recorder WORKDIR /root/uhd_sample_recorder/build RUN CMAKE_BUILD_TYPE=Release cmake ../lib && make -j $(nproc) && cp uhd_sample_recorder /usr/local/bin -FROM ubuntu:22.04 as driver-builder -COPY --from=iqtlabs/gnuradio:3.10.8 /usr/local /usr/local -ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - git \ - libbladerf-dev \ - libboost-all-dev \ - libfftw3-dev \ - libgmp-dev \ - liblimesuite-dev \ - librtlsdr-dev \ - libuhd-dev \ - libusb-1.0-0-dev \ - pkg-config \ - unzip \ - wget -WORKDIR /root -RUN git clone https://github.com/SignalHound/soapy-bb60 -RUN git clone https://github.com/pothosware/SoapyBladeRF -b soapy-bladerf-0.4.1 -RUN git clone https://github.com/pothosware/SoapyRTLSDR -b soapy-rtl-sdr-0.3.3 -RUN git clone https://github.com/pothosware/SoapyUHD -b soapy-uhd-0.4.1 -RUN git clone https://github.com/Nuand/bladeRF.git -b 2023.02 -RUN git clone https://github.com/anarkiwi/lime-tools -b samples -RUN wget https://signalhound.com/sigdownloads/SDK/signal_hound_sdk_08_25_23.zip -Osdk.zip && unzip sdk.zip && rm sdk.zip -WORKDIR /root/soapy-bb60/SoapyBB60C/build -RUN if [ "$(arch)" = "x86_64" ] ; then cp /root/signal_hound_sdk/device_apis/bb_series/include/* /usr/local/include/ && cp /root/signal_hound_sdk/device_apis/bb_series/lib/linux/Ubuntu*18.04/* /usr/local/lib && ldconfig -v -n /usr/local/lib && ln -sf /usr/local/lib/libbb_api.so.5 /usr/local/lib/libbb_api.so && cmake .. && make -j "$(nproc)" && make install ; fi -WORKDIR /root/SoapyBladeRF/build -RUN cmake .. && make -j "$(nproc)" && make install -WORKDIR /root/SoapyRTLSDR/build -RUN cmake .. && make -j "$(nproc)" && make install -WORKDIR /root/SoapyUHD/build -RUN cmake .. && make -j "$(nproc)" && make install -WORKDIR /root/bladeRF/host/build -RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DINSTALL_UDEV_RULES=ON -DENABLE_BACKEND_LIBUSB=TRUE .. && make -j "$(nproc)" && make install -WORKDIR /root/lime-tools/build -RUN cmake .. && make install - FROM ubuntu:22.04 as gr-iqtlabs-builder COPY --from=iqtlabs/gnuradio:3.10.8 /usr/local /usr/local ENV DEBIAN_FRONTEND noninteractive @@ -112,7 +72,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ python3-numpy \ && apt-get -y -q clean && rm -rf /var/lib/apt/lists/* COPY --from=iqtlabs/gnuradio:3.10.8 /usr/local /usr/local -COPY --from=driver-builder /usr/local /usr/local +COPY --from=iqtlabs/gamutrf-driver /usr/local /usr/local COPY --from=gr-iqtlabs-builder /usr/local /usr/local COPY --from=uhd_sample_recorder-builder /usr/local /usr/local RUN ldconfig -v diff --git a/docker/Dockerfile.driver b/docker/Dockerfile.driver new file mode 100644 index 00000000..6add1b4b --- /dev/null +++ b/docker/Dockerfile.driver @@ -0,0 +1,41 @@ +FROM ubuntu:22.04 as driver-builder +COPY --from=iqtlabs/gnuradio:3.10.8 /usr/local /usr/local +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + cmake \ + git \ + libbladerf-dev \ + libboost-all-dev \ + libfftw3-dev \ + libgmp-dev \ + liblimesuite-dev \ + librtlsdr-dev \ + libuhd-dev \ + libusb-1.0-0-dev \ + pkg-config \ + unzip \ + wget +WORKDIR /root +RUN git clone https://github.com/SignalHound/soapy-bb60 +RUN git clone https://github.com/pothosware/SoapyBladeRF -b soapy-bladerf-0.4.1 +RUN git clone https://github.com/pothosware/SoapyRTLSDR -b soapy-rtl-sdr-0.3.3 +RUN git clone https://github.com/pothosware/SoapyUHD -b soapy-uhd-0.4.1 +RUN git clone https://github.com/Nuand/bladeRF.git -b 2023.02 +RUN git clone https://github.com/anarkiwi/lime-tools -b samples +RUN wget https://signalhound.com/sigdownloads/SDK/signal_hound_sdk_08_25_23.zip -Osdk.zip && unzip sdk.zip && rm sdk.zip +WORKDIR /root/soapy-bb60/SoapyBB60C/build +RUN if [ "$(arch)" = "x86_64" ] ; then cp /root/signal_hound_sdk/device_apis/bb_series/include/* /usr/local/include/ && cp /root/signal_hound_sdk/device_apis/bb_series/lib/linux/Ubuntu*18.04/* /usr/local/lib && ldconfig -v -n /usr/local/lib && ln -sf /usr/local/lib/libbb_api.so.5 /usr/local/lib/libbb_api.so && cmake .. && make -j "$(nproc)" && make install ; fi +WORKDIR /root/SoapyBladeRF/build +RUN cmake .. && make -j "$(nproc)" && make install +WORKDIR /root/SoapyRTLSDR/build +RUN cmake .. && make -j "$(nproc)" && make install +WORKDIR /root/SoapyUHD/build +RUN cmake .. && make -j "$(nproc)" && make install +WORKDIR /root/bladeRF/host/build +RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DINSTALL_UDEV_RULES=ON -DENABLE_BACKEND_LIBUSB=TRUE .. && make -j "$(nproc)" && make install +WORKDIR /root/lime-tools/build +RUN cmake .. && make install +FROM ubuntu:22.04 +COPY --from=driver-builder /usr/local /usr/local diff --git a/gamutrf/grscan.py b/gamutrf/grscan.py index 8abc0836..73ad82e3 100644 --- a/gamutrf/grscan.py +++ b/gamutrf/grscan.py @@ -188,30 +188,33 @@ def __init__( logging.info("serving FFT on %s", zmq_addr) self.fft_blocks.append((zeromq.pub_sink(1, 1, zmq_addr, 100, False, 65536, ""))) + self.inference_blocks = [] if inference_output_dir: x = 640 y = 640 Path(inference_output_dir).mkdir(parents=True, exist_ok=True) - self.inference_blocks = [ - self.iqtlabs.image_inference( - tag="rx_freq", - vlen=nfft, - x=x, - y=y, - image_dir=inference_output_dir, - convert_alpha=255, - norm_alpha=0, - norm_beta=1, - norm_type=32, # cv::NORM_MINMAX = 32 - colormap=16, # cv::COLORMAP_VIRIDIS = 16, cv::COLORMAP_TURBO = 20, - interpolation=1, # cv::INTER_LINEAR = 1, - flip=0, # 0 means flipping around the x-axis - min_peak_points=inference_min_db, - model_server=inference_model_server, - model_name=inference_model_name, - confidence=inference_min_confidence, - ) - ] + self.inference_blocks.extend( + [ + self.iqtlabs.image_inference( + tag="rx_freq", + vlen=nfft, + x=x, + y=y, + image_dir=inference_output_dir, + convert_alpha=255, + norm_alpha=0, + norm_beta=1, + norm_type=32, # cv::NORM_MINMAX = 32 + colormap=16, # cv::COLORMAP_VIRIDIS = 16, cv::COLORMAP_TURBO = 20, + interpolation=1, # cv::INTER_LINEAR = 1, + flip=0, # 0 means flipping around the x-axis + min_peak_points=inference_min_db, + model_server=inference_model_server, + model_name=inference_model_name, + confidence=inference_min_confidence, + ) + ] + ) if mqtt_server: self.inference_blocks.extend( [