Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move waterfall #1046

Merged
merged 10 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,37 @@ jobs:
done && \
sudo ldconfig -v && \
poetry config virtualenvs.create false && \
cd gamutrflib && \
poetry install --no-interaction && \
cd .. && \
poetry install --no-interaction && \
poetry install --no-interaction -C gamutrflib && \
poetry install --no-interaction -C gamutrfwaterfall && \
poetry install --no-interaction -C utils/mavlink-api && \
poetry install --no-interaction && \
sudo dpkg -r --force-depends python3-numpy
- name: Code Quality - Black
run: |
poetry run black augment --check
poetry run black gamutrf --check
poetry run black utils --check
poetry run black gamutrflib --check
poetry run black gamutrfwaterfall --check
poetry run black torchserve --check
poetry run black augment --check
poetry run black utils --check
- name: Code Quality - Pylint
run: |
poetry run pylint --fail-under=6 gamutrf/
poetry run pylint --fail-under=6 gamutrf/ gamutrflib/ gamutrfwaterfall/
- name: Code Quality - Pytype
env:
PYTHONPATH: /usr/local/lib/python3.10/dist-packages:/usr/lib/python3/dist-packages
run: |
sudo pip3 install pytype=="$(grep -E "pytype = " pyproject.toml | grep -Eo "[0-9\.]+")" && \
sudo pip3 install -U pyserial && \
pytype -k gamutrf/ && \
pytype -k gamutrflib/ && \
pytype -k gamutrfwaterfall/ && \
pytype -k utils/mavlink-api
- name: Test with pytest
env:
PYTHONPATH: /usr/local/lib/python3.10/dist-packages:/usr/lib/python3/dist-packages
run: |
poetry run pytest --cov-report term-missing --cov=. --cov-report=xml tests/
poetry run pytest --cov-report term-missing --cov=. --cov-report=xml tests/ gamutrfwaterfall/tests
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ jobs:
docker build -f docker/Dockerfile.driver docker -t iqtlabs/gamutrf-driver:latest
docker build -f docker/Dockerfile.uhd-sr docker -t iqtlabs/gamutrf-uhd-sr:latest
docker build -f docker/Dockerfile.base docker -t iqtlabs/gamutrf-base:latest
docker build -f docker/Dockerfile.waterfall . -t iqtlabs/gamutrf-waterfall: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-compress_dirs --help
docker run -t iqtlabs/gamutrf:latest gamutrf-offline --help
docker run -t iqtlabs/gamutrf:latest gamutrf-scan --help
docker run -t iqtlabs/gamutrf:latest gamutrf-sigfinder --help
docker run -t iqtlabs/gamutrf:latest gamutrf-waterfall --help
docker run -t iqtlabs/gamutrf:latest gamutrf-worker --help
docker run -t iqtlabs/gamutrf-waterfall:latest gamutrf-waterfall --help
sudo apt-get update && sudo apt-get install -qy python3-pip
docker compose -f orchestrator.yml -f worker.yml -f docker/monitoring.yml -f specgram.yml build
9 changes: 9 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ jobs:
push: true
tags: iqtlabs/gamutrf-base:${{ steps.change_version.outputs.VERSION }}
if: github.repository == 'iqtlabs/gamutrf' && github.event_name == 'push'
- name: Build and push platforms waterfall
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile.waterfall
platforms: linux/amd64,linux/arm64
push: true
tags: iqtlabs/gamutrf-waterfall:${{ steps.change_version.outputs.VERSION }}
if: github.repository == 'iqtlabs/gamutrf' && github.event_name == 'push'
buildx-gamutrf:
needs: [buildx-base]
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,6 @@ tests/gamutrf_test_dir/*.tar*
*.DS_Store

\#*
torchserve/*mar
torchserve/*txt
torchserve/*pt
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ RUN apt-get update && apt-get install --no-install-recommends -y -q \
libev-dev \
python3 \
python3-dev \
python3-pip \
python3-pyqt5 \
python3-pyqt5.sip \
python3-pip && \
python3-pyqt5.sip && \
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2 && \
poetry config virtualenvs.create false && \
python3 -m pip install --no-cache-dir --upgrade pip
Expand Down Expand Up @@ -67,6 +67,8 @@ RUN if [ "$(arch)" = "x86_64" ] ; then \
libopencv-core4.5d \
libopencv-imgcodecs4.5d \
libopencv-imgproc4.5d \
python3-pyqt5 \
python3-pyqt5.sip \
librtlsdr0 \
libspdlog1 \
libuhd4.1.0 \
Expand All @@ -75,10 +77,7 @@ RUN if [ "$(arch)" = "x86_64" ] ; then \
libzmq5 \
mesa-vulkan-drivers \
python3 \
python3-pyqt5 \
python3-pyqt5.sip \
python3-zmq \
sox \
uhd-host \
wget \
zstd && \
Expand Down
39 changes: 39 additions & 0 deletions docker/Dockerfile.waterfall
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# nosemgrep:github.workflows.config.dockerfile-source-not-pinned
FROM ubuntu:22.04 as installer
ENV DEBIAN_FRONTEND noninteractive
ENV PATH="${PATH}:/root/.local/bin"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && apt-get install --no-install-recommends -y -q \
ca-certificates \
curl \
gcc \
git \
libcairo2-dev \
libev-dev \
python3 \
python3-dev \
python3-pip && \
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2 && \
poetry config virtualenvs.create false
WORKDIR /gamutrflib
COPY gamutrflib /gamutrflib/
RUN poetry install --no-interaction --no-ansi --no-dev
WORKDIR /gamutrfwaterfall
COPY gamutrfwaterfall /gamutrfwaterfall/
RUN poetry install --no-interaction --no-ansi --no-dev

FROM ubuntu:22.04
ENV DEBIAN_FRONTEND noninteractive
ENV PATH="${PATH}:/root/.local/bin"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && apt-get install --no-install-recommends -y -q \
curl \
git \
libev4 \
libcairo2 \
python3
COPY --from=installer /root/.local /root/.local
COPY --from=installer /usr/local /usr/local
COPY --from=installer /gamutrflib /gamutrflib
COPY --from=installer /gamutrfwaterfall /gamutrfwaterfall
CMD ["gamutrf-waterfall", "--help"]
6 changes: 0 additions & 6 deletions gamutrf/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from gamutrf.scan import main as scan_main
from gamutrf.sigfinder import main as sigfinder_main
from gamutrf.specgram import main as specgram_main
from gamutrf.waterfall import main as waterfall_main
from gamutrf.worker import main as worker_main


Expand Down Expand Up @@ -33,11 +32,6 @@ def specgram():
specgram_main()


def waterfall():
"""Entrypoint for waterfall"""
waterfall_main()


def worker():
"""Entrypoint for worker"""
worker_main()
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
from scipy.ndimage import gaussian_filter

from gamutrflib.peak_finder import get_peak_finder
from gamutrf.utils import SCAN_FRES
from gamutrflib.zmqbucket import ZmqReceiver, parse_scanners, frame_resample

warnings.filterwarnings(action="ignore", message="Mean of empty slice")
warnings.filterwarnings(action="ignore", message="All-NaN slice encountered")
warnings.filterwarnings(action="ignore", message="Degrees of freedom <= 0 for slice.")

SCAN_FRES = 1e4


def safe_savefig(path):
basename = os.path.basename(path)
Expand Down
Loading
Loading