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

Service architecture and networking redesign #127

Merged
merged 239 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
239 commits
Select commit Hold shift + click to select a range
fc64c52
Add stub Raspberry Pi 5 integration article
hmakelin May 13, 2024
123739a
Add configurable docker registry
hmakelin May 15, 2024
aa9b326
Add gisnav-compose systemd service and its Debian distributable
hmakelin May 15, 2024
df288c9
Fix docker-compose-plugin dependency name
hmakelin May 15, 2024
807db61
Add systemd service glossary entry
hmakelin May 15, 2024
832ff68
Add postinst script to ensure containers are created when service is …
hmakelin May 15, 2024
7d5518e
Make postinst and postrm scripts executable
hmakelin May 15, 2024
610f98c
Fix debian build paths and output file name
hmakelin May 15, 2024
ed4e24c
Fix ExecStop command in gisnav-compose.service - we only want to stop…
hmakelin May 15, 2024
7978833
Fix postinst script
hmakelin May 15, 2024
2b3a691
Update HIL simulation example by adding instruction to install gisnav…
hmakelin May 15, 2024
9da2fec
Update HIL example docs page
hmakelin May 15, 2024
5a82cb5
Add instruction to create Debian package
hmakelin May 15, 2024
302f9fc
Include Dockerfiles and build contexts for relevant services in gisna…
hmakelin May 15, 2024
d663fa3
Update documentation related to gisnav-compose service
hmakelin May 15, 2024
051adc8
Keep containers, volumes, networks when gisnav-compose.service is sto…
hmakelin May 15, 2024
f4314a3
Run homepage as part of GISNav compose services
hmakelin May 15, 2024
9431037
Make postrm script more robust
hmakelin May 15, 2024
6c54cbd
Fix USB ports in Raspberry Pi 5 diagram
hmakelin May 15, 2024
083ac24
Update HIL example prerequisites
hmakelin May 15, 2024
e129ee5
Add stub workflow to build and upload gisnav-compose Debian package
hmakelin May 15, 2024
3f353cf
Remove unused registry service
hmakelin May 16, 2024
f63b78c
Update gisnav-compose Debian package build
hmakelin May 16, 2024
a3b601f
Add todo to make use of rsync when creating Debian package less brittle
hmakelin May 16, 2024
a68df8e
Fix gisnav image build issues in Debian postinst script
hmakelin May 16, 2024
35eeb40
Ensure gisnav dependencies are also pulled/built/created in postinst …
hmakelin May 17, 2024
6469dee
Fix indentation
hmakelin May 17, 2024
3ef18fd
Add missing instructions for HIL example
hmakelin May 17, 2024
5357b29
Add prerequisites for HIL simulation host
hmakelin May 17, 2024
566048a
Remove old Jetson Nano article
hmakelin May 17, 2024
08a6458
Add warning for HIL simulation
hmakelin May 17, 2024
480ef3d
Fix gisnav-compose build
hmakelin May 17, 2024
7ac9660
colcon ignore debian package build directory (otherwise we have a nes…
hmakelin May 18, 2024
e31de81
Improve mavros build time
hmakelin May 18, 2024
a753efb
Speed up mavros core package build
hmakelin May 18, 2024
66fe258
Add troubleshooting section for building mavros on Raspberry Pi 5
hmakelin May 18, 2024
fd97323
Update gisnav-compose postinst script to automatically create a tempo…
hmakelin May 18, 2024
8f09746
Do not have px4 as a gisnav service dependency - compose does not all…
hmakelin May 18, 2024
162aa06
Use base image that supports arm64 for postgres service
hmakelin May 19, 2024
cc3032c
Refactor docker compose configuration
hmakelin May 19, 2024
090e3c1
Add Nginx reverse proxy to aid service discovery client-side
hmakelin May 19, 2024
e3054d9
Fix trailing slash issues and make homepage links work with nginx
hmakelin May 19, 2024
6f48b7d
Update homepage bookmarks
hmakelin May 19, 2024
80b55f5
Start admin portal together with gisnav
hmakelin May 19, 2024
8884094
Update hostname in admin portal instructions now that we are using nginx
hmakelin May 19, 2024
5c6f205
Fix glances widget hostname and href
hmakelin May 19, 2024
6cb58f3
Use third party glances image
hmakelin May 19, 2024
d88883d
Remove old comments
hmakelin May 19, 2024
e65bb9a
Simplify example commands
hmakelin May 19, 2024
2808b49
Improve install UX with gnv CLI and by automatically handling compose…
hmakelin May 20, 2024
9da3bc3
Implement gnv status command
hmakelin May 20, 2024
97ccb16
Make no GPU the default docker-compose.yaml configuration and add nvi…
hmakelin May 20, 2024
2fdf44a
Restructure documentation around installation via Debian package and …
hmakelin May 20, 2024
84c1d67
Fix typo
hmakelin May 20, 2024
dc729aa
Remove incorrect and unnecessary mounting of /dev/shm as a device ins…
hmakelin May 20, 2024
a4ce1fb
WIP: split large compose file into multiple layers to improve maintai…
hmakelin May 22, 2024
8cf2435
Add Docker layers diagram to make planning of shared layers easier
hmakelin May 22, 2024
a63e8c8
Split commands and volumes into separate overrides - leave only pull …
hmakelin May 22, 2024
1697401
Add placeholders for common (expected) makefile targets for root leve…
hmakelin May 22, 2024
ead0470
WIP: restructure repo to improve modularity
hmakelin May 22, 2024
0b0a8a5
Update Makefile for creating Debian distributable
hmakelin May 22, 2024
73b6b44
Update gisnav image Dockerfile path to ros packages after ros parent …
hmakelin May 22, 2024
ac693d3
Fix smaller bugs in debian/Makefile
hmakelin May 22, 2024
8ae5849
Use new docker compose overrides in gnv executable
hmakelin May 22, 2024
d3dcff4
Update comments in builds files to provide more context
hmakelin May 22, 2024
1747b3c
Improve debian/Makefile by reducing repetition and making warning mes…
hmakelin May 22, 2024
33f6e2c
Update repo root Makefile targets to use new debian/Makefile recipes
hmakelin May 22, 2024
db0bde0
Fix docs Makefile target rebuilds
hmakelin May 22, 2024
0656115
Add introduction page to user guide to provide orientation to new vis…
hmakelin May 22, 2024
f65e806
Imprve gnv api
hmakelin May 23, 2024
c6c4989
Put Debian package into dist directory, not build
hmakelin May 23, 2024
8ee3317
Update PX4 sim service networking
hmakelin May 23, 2024
b5c84a9
Update service topography or networking diagram with latest changes
hmakelin May 23, 2024
cd7e124
Minor consistency improvements to service names in networking diagram
hmakelin May 23, 2024
3c14182
Update docker compose deployment documentation
hmakelin May 23, 2024
a490844
CLI deployment UX improvements
hmakelin May 23, 2024
9c6a3b0
Update homepage labels to match recently updated network diagram
hmakelin May 23, 2024
dc8e506
Add support for SITL deployment via gnv CLI tool
hmakelin May 23, 2024
363ee9c
Fix docs volume connection typo in diagram and improve visibility of …
hmakelin May 23, 2024
af590dd
Prevent port collision when running both gisnav and px4 services on s…
hmakelin May 23, 2024
751987d
Add support for dual (default) deployment type for gnv CLI
hmakelin May 23, 2024
65e1a7d
Remove old reST version of Docker Compose documentation page
hmakelin May 24, 2024
69c3c68
Rename and add TODOs for future removal of older docker compose confi…
hmakelin May 24, 2024
513c193
Make it so that the .deb file does not have to be repackaged every ti…
hmakelin May 24, 2024
2d726ba
Make the export_compose_files work with any path, not just the hard-c…
hmakelin May 24, 2024
f3efd83
Fade away Docker terminology from the gnv public interface (help mess…
hmakelin May 24, 2024
2e78819
Remove old unused files (see also commit 69c3c68)
hmakelin May 24, 2024
d228d15
Fix various networking issues in local SITL simulation
hmakelin May 24, 2024
6c45255
Fix various debian package installation bugs
hmakelin May 24, 2024
4088ce5
Fix gscam service hostname
hmakelin May 24, 2024
b9cec25
Add DDS middleware network to connect ROS middleware and GISNav
hmakelin May 24, 2024
595bcc7
Ensure .vrt files are regenerated on maps volume after being destroyed
hmakelin May 24, 2024
988ad7f
Move simulator services and QGC to host network
hmakelin May 25, 2024
305291c
Better define gnv command tool as a Docker Compose wrapper - command …
hmakelin May 25, 2024
ec648bc
Rename GISNav CLI executable to gnc
hmakelin May 25, 2024
d605fce
Check if xhost command is available in expose-xhost target (not avail…
hmakelin May 25, 2024
20795de
WIP: enable remote deployment
hmakelin May 25, 2024
5e237e4
Change remaining gnv references to gnc
hmakelin May 25, 2024
13c6228
Update gnc documentation
hmakelin May 26, 2024
e4f4bfd
Fix edge case behaviors for gnc
hmakelin May 26, 2024
c18ce49
Add todo to reduce unnecessary creation of swapfiles
hmakelin May 26, 2024
115e8bb
Minor styling improvements
hmakelin May 26, 2024
dd503a4
Change old references to gisnav-compose to gisnav.service
hmakelin May 26, 2024
1f89244
Expand documentation around use of GISNav CLI
hmakelin May 26, 2024
9d20933
Fix gnc for more types of commands
hmakelin May 26, 2024
44c4963
Expand GISNav CLI docs
hmakelin May 27, 2024
affe6c0
Remove echo command that was used for debugging
hmakelin May 27, 2024
0c06d9e
Fix container command parsing issue
hmakelin May 27, 2024
4cb6b89
Fix HIL commands in docs
hmakelin May 27, 2024
4a5594d
Enable uploading firmware via container
hmakelin May 28, 2024
37ff604
Improve HIL related logging and documentation
hmakelin May 29, 2024
530262a
Enable HIL simulation
hmakelin May 29, 2024
ed36a9d
Fix camera orientation relative to base_link
hmakelin May 29, 2024
e2963b2
Add universe repository to ensure ROS packages are found
hmakelin May 29, 2024
470b4af
Handle large file uploads better in mapserver entrypoint script
hmakelin May 30, 2024
6de774e
Enable parallel execution for gnc to improve performance
hmakelin May 30, 2024
d59893a
Handle SIGINT when attaching terminal to a remote container
hmakelin May 30, 2024
7d127e2
Make exec command work locally
hmakelin May 31, 2024
6c843ff
Change mavros default mavlink udp bind port to a non-conflicting one
hmakelin May 31, 2024
63e70d3
Fix gnc build and create when multiple services are specified
hmakelin May 31, 2024
a154412
Use tabs to improve categorization of services on homepage
hmakelin May 31, 2024
7ec8e6a
Expose avahi-daemon socket to px4 container so that IP of hostnames r…
hmakelin May 31, 2024
089a6cb
Enable PX4_VIDEO_HOST_IP env variable by overwriting hard-coded 127.0…
hmakelin May 31, 2024
502b62f
Update gnc CLI help message example command
hmakelin May 31, 2024
eb6fcea
Disable automatic build of Docker images to speed up installation
hmakelin May 31, 2024
12743b0
Update docs
hmakelin May 31, 2024
e0430eb
Adjust added FMUK board line in append serial ports section of upload…
hmakelin May 31, 2024
06619e9
Add web based maps viewer
hmakelin Jun 1, 2024
4f62c4d
Add leaflet requests proxy to mapserver into system architecture diagram
hmakelin Jun 1, 2024
31e8061
Minor styling improvements to architecture diagram
hmakelin Jun 1, 2024
4a4a592
Fix leaflet href path in admin portal
hmakelin Jun 1, 2024
456d802
Add more extensive service health checks
hmakelin Jun 1, 2024
d62b3eb
Minor improvements to service descriptions
hmakelin Jun 1, 2024
0b86f82
Reduce number of retries in healthcheck to reduce excessive polling
hmakelin Jun 1, 2024
60f9995
Streamline some healthchecks using wget --spider instead of curl
hmakelin Jun 1, 2024
59fbe59
Eliminate unzip attempts on deleted zipfiles
hmakelin Jun 2, 2024
b4b0e82
Wait for GDAL supported raster files to be fully copied until attempt…
hmakelin Jun 2, 2024
e71f0db
Relax conditions for successful nginx startup by requiring only homep…
hmakelin Jun 2, 2024
fe7becd
Add command to inspect env variables
hmakelin Jun 2, 2024
3b4c97e
Fix resolution of services reverse-proxied by nginx via Docker DNS
hmakelin Jun 3, 2024
ebaaed1
Fix middleware healthchecks
hmakelin Jun 3, 2024
73165b1
Fix gisnav service healthcheck colcon workspace path
hmakelin Jun 3, 2024
32d2116
Fix micro-ros-agent healthcheck
hmakelin Jun 3, 2024
c6fa9a3
Server WFS-T via MapServer
hmakelin Jun 3, 2024
882b7fa
Add TinyOWS for WFS-T support
hmakelin Jun 4, 2024
78be60b
Make WFS-T Insert work
hmakelin Jun 5, 2024
5a079c1
Ensure position shows up on OL
hmakelin Jun 5, 2024
c79505e
Handle connection exceptions in WSFTNode
hmakelin Jun 5, 2024
cc0f2ba
Refresh position on OL web app every second
hmakelin Jun 5, 2024
c70173f
Fix COLCON_IGNORE unintentionally being copied over to gisnav image w…
hmakelin Jun 5, 2024
d9ca73b
Clear features on WFSTNode startup
hmakelin Jun 5, 2024
6feb469
Remove unused poll rate property from WFSTNode
hmakelin Jun 5, 2024
f4c532b
Fix use of wrong method name in container.launch.py
hmakelin Jun 5, 2024
5c56684
Add system requirements page
hmakelin Jun 5, 2024
dcd99ce
First batch of documentation updates after networking redesign to sup…
hmakelin Jun 5, 2024
8f9e661
Second batch of documentation updates after networking redesign to su…
hmakelin Jun 6, 2024
ee4dff2
Use a second mapfile with Docker DNS hostname for mapserver for conta…
hmakelin Jun 6, 2024
303ae6a
Use runtime variable substitution to remove duplication of configurat…
hmakelin Jun 6, 2024
b005fd7
Check for display availability before adding X11 Compose overlay
hmakelin Jun 6, 2024
e759b9a
Add util-linux dependency (fallocate)
hmakelin Jun 7, 2024
29cedfd
Only run expose-xhost in gnc create if X display server is availabl
hmakelin Jun 7, 2024
13f264c
Update systemd service commands for gnc
hmakelin Jun 7, 2024
126da87
Update simulation instructions
hmakelin Jun 7, 2024
39a1257
Handle headless mode for cv2 highgui calls
hmakelin Jun 7, 2024
d0de89b
Simplify gnc start example commands when providing remote hostname
hmakelin Jun 8, 2024
9d3b834
Improve sidebar readability by flattening nested page headings
hmakelin Jun 8, 2024
11ae2a7
Fix headless mode for px4 service
hmakelin Jun 8, 2024
11c3f77
Fix headless env variable mapping to containers
hmakelin Jun 8, 2024
5fb32f1
Fix pose node scalin array growing without bound
hmakelin Jun 10, 2024
eed0c29
Add rviz to dds network together with other ROS services
hmakelin Jun 10, 2024
80bf021
Update MAVROS to v2.8
hmakelin Jun 10, 2024
90c1737
Old camera frame was RFU while new gimbal_0 is FRD so add a static co…
hmakelin Jun 10, 2024
2c03d56
Make camera frame comply with REP 103 (FLU)
hmakelin Jun 11, 2024
1e05fe3
Fix queue implementation bug that was introduced recently
hmakelin Jun 11, 2024
b0d0592
Remove opencv GUI/Qt dependency by using rqt for debug visualizations
hmakelin Jun 11, 2024
ae96fc3
Fix local.launch.py base launch file name
hmakelin Jun 12, 2024
1d32520
WIP: VO and Torch in separate nodes to improve allocation across CPU …
hmakelin Jun 12, 2024
9efbe5c
Fix camera(_flu) static transform broadcaster name
hmakelin Jun 12, 2024
b83224a
Fix local.launch.py file
hmakelin Jun 12, 2024
fce4369
Cache rotated reference image
hmakelin Jun 12, 2024
bd53ede
Introduced roll and pitch stabilized base_link frame
hmakelin Jun 14, 2024
a5691a9
Reduce video framerate to 5 FPS (5 Hz)
hmakelin Jun 14, 2024
f1b455c
Remove postgres related dependency
hmakelin Jun 16, 2024
a65b5c1
WIP: Implement VO against odom frame
hmakelin Jun 18, 2024
f8dc34b
Fix occasional unintended resets of odom frame
hmakelin Jun 18, 2024
8a3fab7
Scale VO poses to meters
hmakelin Jun 19, 2024
8022f55
Remove unused monocular VO image message and some related constant de…
hmakelin Jun 19, 2024
a1d3da5
Publish map to odom via filter
hmakelin Jun 22, 2024
d3e90ab
Update UORBNode publish method to use new gisnav frames
hmakelin Jun 22, 2024
2474912
Implement gisnav base_link and camera_optical frames to complete gisn…
hmakelin Jun 23, 2024
a56a77c
Fix gisnav_base_link orientation in gisnav_map frame
hmakelin Jun 24, 2024
495e6e9
Handle transform unavailability in TwistNode
hmakelin Jun 24, 2024
154729f
Handle VO keyframe/reference frame falling behind
hmakelin Jun 27, 2024
96688e6
Handle exception for lookup_transform in TwistNode
hmakelin Jun 28, 2024
1790381
Add back old comment to clarify purpose of entrypoint script
hmakelin Jun 28, 2024
68a23b4
Fix wrong parameter path for enabling map to odom transform
hmakelin Jun 28, 2024
9858804
Only publish mock GPS messages from odom frame where velocity should …
hmakelin Jun 28, 2024
c5cf5be
Make gisnav_map REP 105 compliant
hmakelin Jun 28, 2024
376a9c7
Re-center yaw origin to north
hmakelin Jun 28, 2024
1b7aff3
Fix velocity and velocity variance direcitons using new frames
hmakelin Jun 28, 2024
c75da44
Handle numpy error thrown bu BufferInterface.transform
hmakelin Jun 30, 2024
f6ccdad
Git commit fix pose chain timestamps
hmakelin Jul 3, 2024
af1d64b
Simplify run function
hmakelin Jul 3, 2024
477b7b6
Add a short timeout for transform lookups in posenode in case matchin…
hmakelin Jul 3, 2024
ba81a0d
Do not try VO if camera pitch or roll is too high
hmakelin Jul 4, 2024
d0f6b56
Update HIL docs to use Raspberry Pi
hmakelin Jul 4, 2024
1a6414e
Add distclean Makefile target
hmakelin Jul 4, 2024
8028834
Use correct timestamp in twist node for odom to camera_link_optical t…
hmakelin Jul 4, 2024
00cfa3c
Reduce visibility of low value log messages in GISNode
hmakelin Jul 5, 2024
e7e29f1
Improve transforms synchronization and exception handling in VO
hmakelin Jul 5, 2024
a313b68
Fix set parameters log messages
hmakelin Jul 6, 2024
77ae8e0
WIP: Make filter work with delayed PoseNode poses
hmakelin Jul 10, 2024
724ea8b
WIP: Make filter work with delayed PoseNode poses part 2
hmakelin Jul 11, 2024
3af19dd
Wait for filter state to catch up before publishing mock GPS estimates
hmakelin Jul 11, 2024
5e82484
Fix UORBNode filter catch-up check
hmakelin Jul 11, 2024
1a912e6
WIP: Make filter work with delayed PoseNode poses part 3
hmakelin Jul 13, 2024
ff0a67e
Handle exception
hmakelin Jul 13, 2024
0e1de45
Update OpenLayers position more often
hmakelin Jul 14, 2024
13b76a0
Initialize gisnav_map to gisnav_odom from FCU to more quickly get sta…
hmakelin Jul 14, 2024
212885d
Fix timestamp bug in add_transform_stamped
hmakelin Jul 14, 2024
a1f7103
WIP: Make VO work with delayed global matches
hmakelin Jul 14, 2024
3b0b7fb
WIP: Make VO work with delayed global poses
hmakelin Jul 15, 2024
305cfb1
Use SIFT keypoints for deep matching
hmakelin Jul 26, 2024
1b14bd1
Use OpenCV SIFT instead of the kornia-moons to be more efficient with…
hmakelin Jul 27, 2024
6db8517
Use precomputed SIFT keypoints from TwistNode in PoseNode to improve …
hmakelin Jul 28, 2024
d253680
Fix ROS topography diagram error
hmakelin Jul 28, 2024
27aea35
Include tf topic in ROS topography diagram
hmakelin Jul 28, 2024
57b362f
Rotate map at discrete configurable intervals (integer degrees)
hmakelin Jul 28, 2024
b879102
Reuse query keypoints for reference on next spin in TwistNode
hmakelin Jul 28, 2024
9659d99
Fix brute force matcher in TwistNode
hmakelin Jul 28, 2024
74f039d
Use 90 degree map rotations to simplify design
hmakelin Jul 29, 2024
8198157
Cache SIFT features for reference image
hmakelin Jul 29, 2024
aef6ec2
Prevent reference keypoints recomputation being triggered too often
hmakelin Jul 29, 2024
1988583
Tune parameters to increase inference speed
hmakelin Jul 30, 2024
c4275c2
Fix orthoimage timestamp unintendedly being set to zero that prevente…
hmakelin Jul 31, 2024
6d9cbc2
Have separate model configs for CPU and GPU
hmakelin Jul 31, 2024
f31e834
Update system requirements notice
hmakelin Jul 31, 2024
da2cb0f
Fix pre-commit errors [skip ci]
hmakelin Aug 1, 2024
01dde48
Fix launch tests [skip ci]
hmakelin Aug 1, 2024
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
62 changes: 40 additions & 22 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,60 @@
# The gisnav service uses the repo root as build context so we
# use a .dockerignore file here to prevent some files from being
# included in the image
# IDEs and editors
.idea/ # IntelliJ-based IDEs (e.g. PyCharm)
.vscode/ # Visual Studio Code

# Python virtual environment
venv/

# PyCharm generated files
.idea/

# Python bytecode
# Python bytecode and cache directories
*.pyc

# colcon created folders
build/
install/
log/

# VitePress
docs/vitepress/docs/.vitepress/dist
docs/vitepress/docs/.vitepress/build
docs/vitepress/docs/.vitepress/cache
docs/vitepress/docs/reference/

# Sphinx
docs/sphinx/build
**/__pycache__/

# General build directories (e.g., colcon, make, sphinx, VitePress)
**/build/
**/_build/
**/.build/
**/dist/
**/_dist/
**/.dist/
**/install/
**/_install/
**/.install/
**/log/
**/_log/
**/.log/
**/cache/
**/_cache/
**/.cache/

# GISNav docs build specific build folder
docs/vitepress/docs/reference

# coverage.py files
.coverage*

# SITL test log output (but leave one sample flight log)
gisnav/test/sitl/output/
*.ulg
*.ulog

# Jupyter Notebook checkpoints
# Jupyter Notebook checkpoints, notebooks
gisnav/test/sitl/ulog_analysis/.ipynb_checkpoints/
gisnav/test/sitl/ulog_analysis/output

.benchmarks/

*.egg-info

# Debian package builds
debian
.pybuild
*.deb

# mypy
.mypy_cache

# node
node_modules

# pytest
*.pytest_cache/*
49 changes: 49 additions & 0 deletions .github/workflows/build_and_upload_gisnav_compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and upload gisnav service

on:
#push:
# # Run when new version tag is pushed
# tags:
# - v*

# Allows running manually from the Actions tab
workflow_dispatch:


jobs:
build-gisnav-service:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Build .deb inside container
run: |
docker pull ghcr.io/${{ github.repository }}:latest
docker run --name gisnav-build ghcr.io/${{ github.repository }}:latest cd /systemd/gisnav && make dist
docker cp $(docker ps -q -l):opt/colcon_ws/src/gisnav/systemd/gisnav/dist/ /tmp/build-output

- name: Find .deb file and set env
run: |
DEB_FILE=$(ls /tmp/build-output/*.deb)
echo "DEB_FILE=$DEB_FILE" >> $GITHUB_ENV

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: gisnav-deb
path: ${{ env.DEB_FILE }}

upload-gisnav-service:
needs: build-gisnav-service
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: gisnav-deb

# Use GitHub releases as apt repository
- name: Upload .deb package as release artifact
run: |
echo TODO
2 changes: 1 addition & 1 deletion .github/workflows/push_gisnav_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
cd colcon_ws/src/gisnav
docker buildx build --build-arg ROS_VERSION=humble --push --platform linux/amd64,linux/arm64 -f docker/mavros/Dockerfile --target gisnav -t ghcr.io/hmakelin/gisnav:${TAG:-latest} .
docker buildx build --build-arg ROS_DISTRO=humble --push --platform linux/amd64,linux/arm64 -f docker/mavros/Dockerfile --target gisnav -t ghcr.io/hmakelin/gisnav:${TAG:-latest} .
50 changes: 31 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
# IDEs and editors
.idea/
.vscode/

# Python virtual environment
venv/

# PyCharm generated files
.idea/

# Python bytecode
# Python bytecode and cache directories
*.pyc

# colcon created folders
build/
install/
log/

# VitePress
docs/vitepress/docs/.vitepress/dist
docs/vitepress/docs/.vitepress/build
docs/vitepress/docs/.vitepress/cache
docs/vitepress/docs/reference/

# Sphinx
docs/sphinx/build
**/__pycache__/

# General build directories (e.g., colcon, make, sphinx, VitePress)
**/build/
**/_build/
**/.build/
**/dist/
**/_dist/
**/.dist/
**/install/
**/_install/
**/.install/
**/log/
**/_log/
**/.log/
**/cache/
**/_cache/
**/.cache/

# GISNav docs build specific build folder
docs/vitepress/docs/reference

# coverage.py files
.coverage*

# SITL test log output (but leave one sample flight log)
gisnav/test/sitl/output/
*.ulg
*.ulog

# Jupyter Notebook checkpoints, notebooks
gisnav/test/sitl/ulog_analysis/.ipynb_checkpoints/
Expand All @@ -36,7 +46,6 @@ gisnav/test/sitl/ulog_analysis/output
*.egg-info

# Debian package builds
debian
.pybuild
*.deb

Expand All @@ -45,3 +54,6 @@ debian

# node
node_modules

# pytest
*.pytest_cache/*
78 changes: 68 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,80 @@
SHELL := /bin/bash

include gisnav/Makefile
include docker/Makefile

# The docs/Makefile has a catch-all target so it is not included here
#include docs/Makefile

.PHONY: docs
docs:
@cd docs/sphinx && sphinx-build -M markdown ./source ./build
@mkdir -p docs/vitepress/docs/reference && cp -r docs/sphinx/build/markdown/* docs/vitepress/docs/reference
@cd docs/vitepress && npm run docs:build
@cd docs/vitepress/docs/.vitepress/dist && touch .nojekyll # for GitHub Pages

.PHONY: docs-preview
docs-preview:
.PHONY: docs\ preview
docs\ preview:
@cd docs/vitepress && npm run docs:preview

.PHONY: docs-dev
docs-preview:
.PHONY: docs\ dev
docs\ dev:
@cd docs/vitepress && npm run docs:dev

.PHONY:
build:
@echo "Building the project..."
@$(MAKE) -C debian/gisnav $@

.PHONY:
dist: build
@echo "Creating distribution package..."
@$(MAKE) -C debian/gisnav $@

.PHONY: clean
clean: clean\ docs
@echo "Cleaning up..."
@$(MAKE) -C debian/gisnav $@
# TODO - build and dist

.PHONY: clean\ docs
clean\ docs:
@echo "Cleaning up documentation build files..."
@rm -rf docs/sphinx/build
@rm -rf docs/vitepress/docs/reference
@rm -rf docs/vitepress/docs/.vitepress/dist

.PHONY: install
install: dist
@echo "Installing the project and dependencies..."
@$(MAKE) -C debian/gisnav $@

.PHONY: test
test:
@echo "Running tests..."
# TODO - run unit and launch tests (do not run simulation tests)

.PHONY: lint
lint:
@echo "Running linter..."
@pre-commit run --all-files

# alias for lint - we do not have a "dry-run" option for lint, both
# lint and format may modify the files
.PHONY: format
format: lint

.PHONY: check
check: lint test
@echo "Running code quality checks..."

.PHONY: help
help:
@echo "Available targets:"
@echo " docs - Build the documentation"
@echo " docs preview - Preview the documentation"
@echo " docs dev - Run the documentation development server"
@echo " build - Build the project"
@echo " dist - Create a distribution package"
@echo " clean - Clean up all generated files"
@echo " clean docs - Clean up documentation build files only"
@echo " install - Install the project and dependencies"
@echo " test - Run the project's tests"
@echo " lint - Run the linter to check code style"
@echo " format - Automatically format the code"
@echo " check - Run linter and tests"
@echo " help - Show this help message"
13 changes: 13 additions & 0 deletions debian/gisnav/DEBIAN/control.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: gisnav
Section: utils
Priority: optional
Maintainer: Harri Makelin <[email protected]>
Build-Depends: debhelper (>= 9)
Standards-Version: 4.6.0
Homepage: https://gisnav.org
Package: gisnav
Version: ${VERSION}
Architecture: all
Depends: bash, docker-compose-plugin, openssh-client, coreutils, sed, x11-utils, util-linux
Description: GISNav CLI Tool
This package contains GISNav CLI ("gnc") - a Docker Compose wrapper that streamlines the deployment of GISNav system configurations. Additionally, it includes the "gisnav.service" systemd service (disabled by default) that can be used to ensure the Compose services are running on system startup.
11 changes: 11 additions & 0 deletions debian/gisnav/DEBIAN/copyright.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: gisnav
Source: https://github.com/hmakelin/gisnav

Files: *
Copyright: 2022 Harri Makelin
License: MIT
The full text of the license can be found in the LICENSE.md file
available at:
.
https://github.com/hmakelin/gisnav/blob/${VERSION}/LICENSE.md
24 changes: 24 additions & 0 deletions debian/gisnav/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
set -e

# Change to the directory where the docker-compose.yml is located
cd /etc/gisnav/docker

# The gnc CLI tool should be provided with this package
# We prepare containers here as part of the installation process so that the
# user experience is better when running `gnc start` for the first time (i.e.
# will not have to pull or build Docker images then).
# Not enabled here because this could significantly slow down install, and
# cause issues with the package manager state when users inevitably interrupt
# the lengthy build process.
#gnc build gisnav --with-dependencies
#gnc create gisnav

# Enable the gisnav.service at startup
# Not enabled automatically here because this could significantly slow down
# resource constrained edge devices.
#systemctl enable gisnav.service

echo "Installation complete. Type 'gnc help' to see available commands."

exit 0
33 changes: 33 additions & 0 deletions debian/gisnav/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
set -e

# Stop and disable the systemd service
if [ -x "$(command -v systemctl)" ]; then
if systemctl stop gisnav.service; then
echo "Successfully stopped gisnav.service."
else
echo "Could not stop gisnav.service - this is OK if the service was not running."
fi

if systemctl disable gisnav.service; then
echo "Successfully disabled gisnav.service."
else
echo "Could not disable gisnav.service - this is OK if the service was not enabled."
fi
else
echo "systemctl command not found. Skipping service stop and disable."
fi

# Execute docker compose down
if [ -x "$(command -v docker compose)" ]; then
# "down" removes containers, volumes, networks
if docker compose -p gisnav down; then
echo "Successfully executed docker compose down."
else
echo "Failed to execute docker compose down. Please stop and remove any GISNav Docker containers manually."
fi
else
echo "docker command not found. Skipping docker compose down."
fi

exit 0
Loading