diff --git a/.github/workflows/docker-extras.yml b/.github/workflows/docker-extras.yml index e5eb41f3..d7bd4992 100644 --- a/.github/workflows/docker-extras.yml +++ b/.github/workflows/docker-extras.yml @@ -6,6 +6,40 @@ on: tags: 'v*' jobs: + buildx-mavlink-api: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) + - name: Change for main + id: change_version + run: if [ "${{ steps.get_version.outputs.VERSION }}" == "main" ]; then echo ::set-output name=VERSION::latest; else echo ::set-output name=VERSION::${{ steps.get_version.outputs.VERSION }}; fi + - name: Set up qemu + uses: docker/setup-qemu-action@v3 + with: + platforms: all + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + - name: Docker Login + env: + DOCKER_PASSWORD: ${{ secrets.DOCKER_TOKEN }} + run: | + echo "${DOCKER_PASSWORD}" | docker login --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin + if: github.repository == 'iqtlabs/gamutrf' && github.event_name == 'push' + - name: Build and push platforms + uses: docker/build-push-action@v5 + with: + context: utils/mavlink-api + file: utils/mavlink-api/Dockerfile + platforms: linux/amd64 + push: true + tags: iqtlabs/gamutrf-mavlink-api:${{ steps.change_version.outputs.VERSION }} + if: github.repository == 'iqtlabs/gamutrf' && github.event_name == 'push' buildx-mqtt: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 6c89e9b7..3aaa5f35 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -17,6 +17,13 @@ jobs: cd docker docker build -f Dockerfile.airspyfm . -t iqtlabs/gamutrf-airspyfm:latest docker build -f Dockerfile.mqtt . -t iqtlabs/gamutrf-mqtt:latest + test-gamutrf-mavlink-api: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: docker build + run: | + docker build -f utils/mavlink-api/Dockerfile utils/mavlink-api -t iqtlabs/gamutrf-mavlink-api:latest test-gamutrf-images: runs-on: ubuntu-latest steps: diff --git a/gamutrf/scan.py b/gamutrf/scan.py index 8c46adbb..4eaba06e 100644 --- a/gamutrf/scan.py +++ b/gamutrf/scan.py @@ -27,8 +27,6 @@ running = True -ORCHESTRATOR = os.getenv("ORCHESTRATOR", "orchestrator") - def init_prom_vars(): prom_vars = { @@ -339,7 +337,7 @@ def argument_parser(): parser.add_argument( "--external_gps_server", dest="external_gps_server", - default=ORCHESTRATOR, + default="127.0.0.1", type=str, help="server to query for external GPS data", ) @@ -353,13 +351,13 @@ def argument_parser(): parser.add_argument( "--mqtt_server", help="MQTT server to report RSSI", - default=ORCHESTRATOR, + default="127.0.0.1", type=str, ) parser.add_argument( "--gps_server", help="GPS Server to get lat,long, and heading", - default=ORCHESTRATOR, + default="127.0.0.1", type=str, ) parser.add_argument( diff --git a/orchestrator.yml b/orchestrator.yml index 79131d9f..9c108891 100644 --- a/orchestrator.yml +++ b/orchestrator.yml @@ -63,10 +63,13 @@ services: - --tune-step-fft=0 - --db_clamp_floor=-150 - --fft_batch_size=256 - # - --inference_min_db=-50 - # - --inference_model_name=mini2_snr + - --use_external_gps + - --use_external_heading + - --inference_min_confidence=0.8 + - --inference_min_db=-50 + - --inference_model_name=mini2_snr + - --inference_output_dir=/logs/inference # - --inference_model_server=torchserve:8080 - # - --inference_output_dir=/logs/inference healthcheck: test: [CMD, "/gamutrf/bin/scanhc.sh", "9000"] interval: 10s diff --git a/utils/mavlink-api/Dockerfile b/utils/mavlink-api/Dockerfile index 9c2bdc76..e9e8f81b 100644 --- a/utils/mavlink-api/Dockerfile +++ b/utils/mavlink-api/Dockerfile @@ -1,5 +1,5 @@ # nosemgrep:github.workflows.config.dockerfile-source-not-pinned -FROM python:3.12-slim@sha256:32477c7ecb3b18a47cff8eb5b8149bc21c858998b0ae2bb36f4ddb43cc79d240 +FROM python:3.11-slim WORKDIR /app ENV PYTHONPATH=${PYTHONPATH}:${PWD} @@ -12,4 +12,4 @@ RUN poetry install --no-dev COPY mavlink-api.py . # nosemgrep:github.workflows.config.missing-user -CMD ["python3", "mavlink-api.py"] \ No newline at end of file +CMD ["python3", "mavlink-api.py"] diff --git a/utils/mavlink-api/docker-compose.yaml b/utils/mavlink-api/docker-compose.yaml index d634a4c1..21e4fc52 100644 --- a/utils/mavlink-api/docker-compose.yaml +++ b/utils/mavlink-api/docker-compose.yaml @@ -1,14 +1,16 @@ version: '3' +networks: + gamutrf: services: mavlink-api: - image: mavlink-api:latest + image: iqtlabs/gamutrf-mavlink-api:latest build: - context: . - dockerfile: ./Dockerfile + context: utils/mavlink-api + dockerfile: utils/mavlink-api/Dockerfile ports: - "8888:8888" devices: - "/dev/pixhawk_serial:/dev/tty.serial1" -# networks: -# - gamutrf + networks: + - gamutrf restart: unless-stopped