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

build/test mavlink API container. #990

Merged
merged 1 commit into from
Nov 24, 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
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
Loading