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

Multi compose #61

Closed
wants to merge 14 commits into from
Closed
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
55 changes: 1 addition & 54 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,54 +1 @@
HOSTNAME=skyscan

#Axis-PTZ
TZ="New York" #Local timezone in "TZ database name" format. https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
LAT=38.889444 # Latitude of the camera
LONG=-77.035278 # Longitude of the camera
ALT=200 # Altitude of the camera, this should be in METERS above sea level
ROLL=0 # Roll Angle of Camera Mount from Inertial
PITCH=0 # Pitch Angle of Camera Mount from Inertial
YAW=0 # Yaw Angle of Camera Mount from Inertial
MIN_ELEVATION=0 # The minimum elevation for the camera.
FEEDER_ID=long-api-key-goes-here # Your FlightAware feeder ID (required)
AXIS_USERNAME=root # The username for the Axis camera
AXIS_PASSWORD=password # The Password for the Axis camera
AXIS_IP=192.168.1.220 # The IP address of the camera
CAMERA_MOVE_SPEED=50 # The speed at which the Axis will move for Pan/Tilt (0-100)
CAMERA_DELAY=0.5 # How many seconds after issuing a Pan/Tilt command should a picture be taken
CAMERA_ZOOM=1000 # The zoom setting for the camera (0-9999)
CAMERA_LEAD=0.5 # How many seconds ahead of a plane's predicted location should the camera be positioned
RTL_DEV=1 # The device ID for the RTL-SDR - set using the rtl_eeprom program
GPS_SERIAL=/dev/ttyACM0 # GPS module serial port

#Edge-detect
WEIGHTS=/data/weights/localizer.pt
AGNOSTIC_NMS=True
NOSAVE=True
CONF_THRES=0.25
IMG_SIZE=640
DEVICE=CPU
IOU_THRES=0.45
SOURCE_DIR=/data/tosort
PLANE_DIR=/data/plane
NOPLANE_DIR=/data/noplane
LOG_DIR=/data/log
VIEW_IMG=False
SAVE_TXT=False
SAVE_JSON=True
SAVE_CONF=False
CLASSES=0
AUGMENT=False
MQTT_IP=mqtt
MQTT_TOPIC=/skyscan/captures/data/processed
CAMERA_TOPIC=skyscan/${HOSTNAME}/image/edgetech-axis-ptz/JSON
NO_TRACE=False
UPDATE=False
OMP_NUM_THREADS=1

# Coral Detect Variables
CORAL_WEIGHTS=/data/weights/localizer.tflite

# Tracker Variables
MQTT_IP=mqtt
TRACKER_INPUT_TOPIC=skyscan/${HOSTNAME}/ADSB/edgetech-pingusb/JSON
TRACKER_PUBLISH_TOPIC=skyscan/${HOSTNAME}/flight/edgetech-tracker/JSON
MQTT_PREFIX="${PWD}/mqtt"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ ml-model/notebooks/*.json
notes.md
semgrep.out
localizer.pt

.mqtt_password
.mqtt_user
.ca_password
/step
ca.env
16 changes: 13 additions & 3 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,27 @@ cd SkyScan

printf "\n\nDownload Docker-Compose SkyScan Files..."
curl -fsSL https://raw.githubusercontent.com/IQTLabs/SkyScan/main/docker-compose.yml -o docker-compose.yml
curl -fsSL https://raw.githubusercontent.com/IQTLabs/SkyScan/main/env-example -o .env

if [ ! -d "mqtt/" ]; then
mkdir mqtt;
fi
pushd mqtt
curl -fsSL https://raw.githubusercontent.com/IQTLabs/SkyScan/main/mqtt/docker-compose.mqtt.yml -o docker-compose.mqtt.yml
curl -fsSL https://raw.githubusercontent.com/IQTLabs/SkyScan/main/mqtt/ca.env -o ca.env
popd

curl -fsSL https://raw.githubusercontent.com/IQTLabs/SkyScan/main/.env-example -o .env
curl -fsSL https://raw.githubusercontent.com/IQTLabs/SkyScan/main/container.env-example -o container.env

printf "\n\nDownload Aircraft Database..."
mkdir ./data
curl -fsSL https://opensky-network.org/datasets/metadata/aircraftDatabase.csv -o ./data/aircraftDatabase.csv

printf "\n\nDownload Docker Containers..."
docker-compose pull
docker-compose -f docker-compose.yml -f mqtt/docker-compose.mqtt.yml pull

printf "\n\n\n\n--------------------------------------------------------------------"
printf "\n1: Configure network interface to same as Axis Camera (192.168.1.x)"
printf "\n2: Configure .env file appropriately"
printf "\n3: docker-compose up"
printf "\n3: docker-compose -f docker-compose.yml -f mqtt/docker-compose.mqtt.yml up"
printf "\n--------------------------------------------------------------------\n\n"
54 changes: 54 additions & 0 deletions container.env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
HOSTNAME=skyscan

#Axis-PTZ
TZ="New York" #Local timezone in "TZ database name" format. https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
LAT=38.889444 # Latitude of the camera
LONG=-77.035278 # Longitude of the camera
ALT=200 # Altitude of the camera, this should be in METERS above sea level
ROLL=0 # Roll Angle of Camera Mount from Inertial
PITCH=0 # Pitch Angle of Camera Mount from Inertial
YAW=0 # Yaw Angle of Camera Mount from Inertial
MIN_ELEVATION=0 # The minimum elevation for the camera.
FEEDER_ID=long-api-key-goes-here # Your FlightAware feeder ID (required)
AXIS_USERNAME=root # The username for the Axis camera
AXIS_PASSWORD=password # The Password for the Axis camera
AXIS_IP=192.168.1.220 # The IP address of the camera
CAMERA_MOVE_SPEED=50 # The speed at which the Axis will move for Pan/Tilt (0-100)
CAMERA_DELAY=0.5 # How many seconds after issuing a Pan/Tilt command should a picture be taken
CAMERA_ZOOM=1000 # The zoom setting for the camera (0-9999)
CAMERA_LEAD=0.5 # How many seconds ahead of a plane's predicted location should the camera be positioned
RTL_DEV=1 # The device ID for the RTL-SDR - set using the rtl_eeprom program
GPS_SERIAL=/dev/ttyACM0 # GPS module serial port

#Edge-detect
WEIGHTS=/data/weights/localizer.pt
AGNOSTIC_NMS=True
NOSAVE=True
CONF_THRES=0.25
IMG_SIZE=640
DEVICE=CPU
IOU_THRES=0.45
SOURCE_DIR=/data/tosort
PLANE_DIR=/data/plane
NOPLANE_DIR=/data/noplane
LOG_DIR=/data/log
VIEW_IMG=False
SAVE_TXT=False
SAVE_JSON=True
SAVE_CONF=False
CLASSES=0
AUGMENT=False
MQTT_IP=mqtt
MQTT_TOPIC=/skyscan/captures/data/processed
CAMERA_TOPIC=skyscan/${HOSTNAME}/image/edgetech-axis-ptz/JSON
NO_TRACE=False
UPDATE=False
OMP_NUM_THREADS=1

# Coral Detect Variables
CORAL_WEIGHTS=/data/weights/localizer.tflite

# Tracker Variables
MQTT_IP=mqtt
TRACKER_INPUT_TOPIC=skyscan/${HOSTNAME}/ADSB/edgetech-pingusb/JSON
TRACKER_PUBLISH_TOPIC=skyscan/${HOSTNAME}/flight/edgetech-tracker/JSON
23 changes: 9 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
volumes:
- ./data:/data
env_file:
- .env
- container.env
deploy:
resources:
limits:
Expand All @@ -21,9 +21,12 @@ services:
- /flash/raw:/app/capture
- /flash/processed/log:/flash/processed/log
depends_on:
mqtt:
condition: service_healthy
networks:
- mqtt
env_file:
- .env
- container.env
deploy:
resources:
limits:
Expand Down Expand Up @@ -57,17 +60,9 @@ services:
limits:
cpus: '1.0'
env_file:
- .env
- container.env
depends_on:
mqtt:
condition: service_healthy
networks:
- mqtt

mqtt:
image: iqtlabs/edgetech-mqtt
ports:
- "9001:9001"
- "1883:1883"
deploy:
resources:
limits:
cpus: '1.0'
restart: unless-stopped
15 changes: 12 additions & 3 deletions install-skyscan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ mkdir processed/log
curl -O $COMPOSE_FILE_URL
curl -O $ENV_FILE_URL

docker-compose pull

echo "Installation complete. Run `docker-compose up` to start the system"
#MQTT structures
if [ ! -d "mqtt/" ]; then
mkdir mqtt;
fi
pushd mqtt
curl -fsSL https://raw.githubusercontent.com/IQTLabs/SkyScan/main/mqtt/docker-compose.mqtt.yml -o docker-compose.mqtt.yml
curl -fsSL https://raw.githubusercontent.com/IQTLabs/SkyScan/main/mqtt/ca.env -o ca.env
popd

docker-compose -f docker-compose.yml -f mqtt/docker-compose.mqtt.yml pull

echo "Installation complete. Run `docker-compose -f docker-compose.yml -f mqtt/docker-compose.mqtt.yml up` to start the system"
echo "Before running, ensure you have replaced the demo weights with your own trained weights"
165 changes: 165 additions & 0 deletions mqtt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

.mqtt_password
.mqtt_user
.ca_password
/step
Loading
Loading