Skip to content

Commit

Permalink
Merge pull request #990 from anarkiwi/mv
Browse files Browse the repository at this point in the history
build/test mavlink API container.
  • Loading branch information
anarkiwi authored Nov 24, 2023
2 parents d20c96d + 897dfea commit 0cabc77
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 15 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docker-extras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 3 additions & 5 deletions gamutrf/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

running = True

ORCHESTRATOR = os.getenv("ORCHESTRATOR", "orchestrator")


def init_prom_vars():
prom_vars = {
Expand Down Expand Up @@ -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",
)
Expand All @@ -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(
Expand Down
9 changes: 6 additions & 3 deletions orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions utils/mavlink-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -12,4 +12,4 @@ RUN poetry install --no-dev
COPY mavlink-api.py .

# nosemgrep:github.workflows.config.missing-user
CMD ["python3", "mavlink-api.py"]
CMD ["python3", "mavlink-api.py"]
12 changes: 7 additions & 5 deletions utils/mavlink-api/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0cabc77

Please sign in to comment.