Skip to content

Commit ac3bfd0

Browse files
Merge pull request #205 from smathermather/edit_test_docker
Testing in docker, advanced
2 parents 0566d55 + 16caba8 commit ac3bfd0

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed
55.7 KB
Loading

source/tutorials.rst

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,3 +981,96 @@ Port 3000 is ClusterODM's proxy. This is the place we assign tasks to ClusterODM
981981
:align: center
982982

983983
After adding images in this browser, you can press Start Task and see ClusterODM assigning tasks to the nodes you have wired to. Go for a walk and check the progress.
984+
985+
Development and testing of ODM
986+
==============================
987+
988+
Development and testing of code changes can be difficult. The simplest way to do so is modify the code and rebuild docker images from source, much as documented in the `README for the ODM repository <https://github.com/OpenDroneMap/ODM?tab=readme-ov-file#build-docker-images-from-source>`_.
989+
990+
However, having to do a full docker rebuild for each change is time consuming and wasteful. What might be better is to have a dedicated, long running node that allows us to test out changes in near real time.
991+
992+
#. Fork and clone repository
993+
#. Set up local NodeODM docker instance
994+
#. Modify code
995+
#. Connect to NodeODM instance
996+
#. Install and use changes
997+
998+
Fork and clone repository
999+
-------------------------
1000+
1001+
First, let's fork the ODM repo, and checkout a new branch locally that will function as our development branch.
1002+
1003+
::
1004+
1005+
git checkout -b my_clever_new_change
1006+
# Switched to a new branch 'my_clever_new_change'
1007+
1008+
Set up local NodeODM docker instance
1009+
------------------------------------
1010+
1011+
Next, we will set up a NodeODM instance with a locally mounted volume that points to our development branch of ODM
1012+
1013+
::
1014+
1015+
docker run -d --restart unless-stopped -p 3000:3000 -v /path/to/cloned/ODM/repository/data:/code opendronemap/nodeodm
1016+
1017+
Modify code
1018+
-----------
1019+
1020+
For our test today, we will attempt to upgrade Ceres Solver to version 2.2.0. Most external libraries like Ceres can be found in the Superbuild directory. In this case we edit SuperBuild/cmake/External-Ceres.cmake, and set it to use version 2.2.0
1021+
1022+
.. figure:: images/vimdiff_ceres_change.png
1023+
1024+
Now that we've made that small, but substantive change, we need to rebuild Ceres on the docker image for testing.
1025+
1026+
1027+
Connect to NodeODM instance
1028+
---------------------------
1029+
1030+
Let us find out our container name, in case we forgot:
1031+
1032+
::
1033+
1034+
docker ps
1035+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1036+
c997a4c5611b opendronemap/nodeodm "/usr/bin/node /var/…" 2 minutes ago Up 2 minutes 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp affectionate_yalow
1037+
1038+
Now that we know the container name, we will connect to that instance using docker exec as follows:
1039+
1040+
::
1041+
1042+
docker exec -it affectionate_yalow bash
1043+
1044+
Install and use changes
1045+
-----------------------
1046+
1047+
Let us get the environment prepared for our testing:
1048+
1049+
::
1050+
1051+
root@c997a4c5611b:/var/www# cd /code
1052+
./configure.sh installruntimedepsonly
1053+
mkdir /code/SuperBuild/build
1054+
cd /code/SuperBuild/build
1055+
1056+
1057+
Next we can rebuild Ceres.
1058+
1059+
::
1060+
1061+
cmake ../.
1062+
make -j$(nproc) ceres
1063+
...
1064+
-- Up-to-date: /code/SuperBuild/install/include/ceres
1065+
-- Up-to-date: /code/SuperBuild/install/include/ceres/internal
1066+
-- Installing: /code/SuperBuild/install/include/ceres/internal/config.h
1067+
-- Installing: /code/SuperBuild/install/include/ceres/internal/export.h
1068+
-- Installing: /code/SuperBuild/install/include/ceres/internal/miniglog/glog/logging.h
1069+
-- Installing: /code/SuperBuild/install/lib/cmake/Ceres/CeresTargets.cmake
1070+
-- Installing: /code/SuperBuild/install/lib/cmake/Ceres/CeresTargets-release.cmake
1071+
-- Installing: /code/SuperBuild/install/lib/cmake/Ceres/CeresConfig.cmake
1072+
-- Installing: /code/SuperBuild/install/lib/cmake/Ceres/CeresConfigVersion.cmake
1073+
[100%] Completed 'ceres'
1074+
[100%] Built target ceres
1075+
1076+
Success! Now we can either run ODM directly inside this container, use the NodeODM interface to process data, or connect in with WebODM for additional testing.

0 commit comments

Comments
 (0)