DANGER!!! WIP docker-sync adaptation, seems to work well ... but breaks sometime. See FAQ and add to it, please.
This docker container provides a fully working environment without the installation hassle
by wrapping docker-dronedb into a docker-compose.yml with all other required services
(mostly PostgreSQL, Redis and NGINX ... plus other goodies!)
While Kubernetes is what we should probably do, we first attempted to make it simple to deploy a production (no quotes this time) environment by taking advantage of Docker Swarm, in particular the secrets functionality.
Pre-requisites are a working Docker installation in Docker Swarm mode or simply via Docker Compose, on a good Unix-like system.
[WIP/danger] If you want to develop using platform-native tools (meaning, a way to access the files that are otherwise inside of containerized filesystems, both in MacOS and Linux), you will also need to:
sudo gem install docker-syncFor Docker Compose mode, just run the commands below, add dev.localhost.lan to your /etc/hosts and then connect to http://dev.localhost.lan/ with your browser after you prime the DB schema with some data (first time only steps):
git clone https://github.com/splashblot/tiles-swarm.gitcd tiles-swarmdocker-compose up postgis dronedb redis - only those three for now to prime the DBdocker exec -ti tiles-swarm_dronedb_1 /bin/bash -c "export TERM=xterm-256color; exec bash"cd /dronedb/script/ && ./create_db_only.sh && ./setup_tiles_feature_flags.sh && ./create_tiles_dev_user.sh && exitdocker-compose down - to cleanup those containersdocker-compose up[WIP/danger] docker-sync) docker-sync-stack start - Tends to time out, just re-issue the command the first time aroundThe default login is dev/pass1234.
docker-compose up
Last but not least, you need to add hostname aliases to your /etc/hosts file. For example:
sudo sh -c 'echo 127.0.0.1 dev.localhost.lan >> /etc/hosts'
... more might be needed if you want to configure other organizations or subdomains:
sudo sh -c 'echo 127.0.0.1 localhost.lan >> /etc/hosts'
sudo sh -c 'echo 127.0.0.1 agroguia.localhost.lan >> /etc/hosts'
sudo sh -c 'echo 127.0.0.1 splashblot.localhost.lan >> /etc/hosts'
sudo sh -c 'echo 127.0.0.1 smartrural.localhost.lan >> /etc/hosts'
You should now be able to access the install at http://dev.localhost.lan/
(WARNING: outdated!) In order to be able to perform object detection with ml-py-inferer, you need to follow these steps:
Example tree of /data/ml-py-inferer for a particular configuration
.
├── config.py
└── models
└── nectarines
├── cfgs
│ └── faster_rcnn_end2end.yml
├── VGG16
│ └── faster_rcnn_end2end
│ └── test.prototxt
├── vgg16_faster_rcnn_iter_18000.caffemodel
└── vgg16_faster_rcnn_iter_6000.caffemodel
Once done and when started you will be able to add a procesing node inferer at port 5000 (port can be changed in configuration file) into WebODM so that you can perform object detection.
- My docker-sync is acting up ... and unison keeps bugging me about something or other, what should I do?
Start fresh. Run docker-sync clean and remove your ./dronedb folder. Help us debug it and fix it via PR here ...
- To connect to a remote Swarm:
docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_HOST dockercloud/client <stack_name>
- To update a service running in the stack:
To avoid downtime, we make sure there are 2 replicas running first, make the rolling update, then go back to 1:
docker service scale <service_name>=2
docker service update --force --image splashblot/docker-dronedb:master <service_name>
docker service scale <service_name>=1
example:
docker service scale prod_dronedb=2
docker service update --force --image splashblot/docker-dronedb:master prod_dronedb
docker service scale prod_dronedb=1
- To roll a service update back which was just updated in the stack to the previous image:
docker service update --rollback <service_name>
example:
docker service update --rollback prod_dronedb
- To access a container you need ssh access to:
docker ps
docker exec -ti <container-ID> bash
- To create a new Organization:
dronedb container via ssh (see above)cd /dronedb/script/tiles/sampletada/mkdir <your-new-org-ID>git pull won't make it magically appear as it is put in there by the docker-dronedb build process, you decide how you want to do it (creating a new image is probably overkill, but works)- To add a new hostname to the Let's Encrypt SSL certificate:
docker-entrypoint.sh file like thistiles-swarm (once you git push it should happen automagically)docker service scale prod_nginx=0 (yes, that means downtime! :scream:)docker volume rm prod_data-volume-www-ssl-certs so the SSL certs get regenerated when you start nginx againdocker service scale prod_nginx=1 (this will take a while, as SSL challenges take a few minutes eachContent type
Image
Digest
Size
173.2 MB
Last updated
over 7 years ago
docker pull splashblot/tiles-swarm