You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docker has a lamentable use of space and by default does not clean up excess data and machines when processes are complete. This can be advantageous if we need to access a process that has since terminated, but carries the burden of using increasing amounts of storage over time. Maciej Łebkowski has an `excellent overview of how to manage excess disk usage in docker <https://lebkowski.name/docker-volumes/>`_.
297
297
298
-
*****************
299
-
Using Singularity
300
-
*****************
301
-
302
-
`Singularity <https://sylabs.io/>`__ is another container platform able to run Docker images.
303
-
Singularity can be run both on local machins and in instances where the user does not have root access.
304
-
Instances where a user may not have root privlidges include HPC clusters and cloud cluster resources.
305
-
A container is a single file without anything else to install.
306
-
307
-
Build Singularity image from Docker image
308
-
=========================================
309
-
Singularity can use Docker image to build SIF image.
@@ -869,176 +821,160 @@ For instance, point clouds properties can be modified to show elevation and also
869
821
870
822
`Learn to edit <https://github.com/opendronemap/docs#how-to-make-your-first-contribution>`_ and help improve `this page <https://github.com/OpenDroneMap/docs/blob/publish/source/tutorials.rst>`_!
You can write a SLURM script to schedule and set up available nodes with NodeODM for the ClusterODM to be wired to if you are on the HPC. Using SLURM will decrease the amount of time and processes needed to set up nodes for ClusterODM each time. This provides an easier way for user to use ODM on the HPC.
928
879
880
+
To setup HPC with SLURM, you must make sure SLURM is installed.
929
881
882
+
SLURM script will be different from cluster to cluster, depending on which nodes in the cluster that you have. However, the main idea is we want to run NodeODM on each node once, and by default, each NodeODM will be running on port 3000. Apptainer will be taking available ports starting from port 3000, so if your node's port 3000 is open, by default NodeODM will be run on that node. After that, we want to run ClusterODM on the head node and connect the running NodeODMs to the ClusterODM. With that, we will have a functional ClusterODM running on HPC.
930
883
931
-
Launching
932
-
=========
933
-
On two different terminals connected to the HPC , or with tmux (or screen...) a slurm script will start NodeODM instances.
934
-
Then ClusterODM could be started
884
+
Here is an example of SLURM script assigning nodes 48, 50, 51 to run NodeODM. You can freely change and use it depending on your system:
935
885
936
-
NodeODM
937
-
-------
938
-
Create a nodeodm.slurm script in $HOME/git/NodeODM with
939
886
::
940
887
941
-
#!/usr/bin/bash
942
-
#source .bashrc
943
-
888
+
#!/usr/bin/bash
889
+
#source. bashrc
890
+
#SBATCH --partition=8core
891
+
#SBATCH --nodelist-node [48,50, 51]
892
+
#SBATCH --time 20:00:00
944
893
945
-
#SBATCH -J NodeODM
946
-
#SBATCH --partition=ncpulong,ncpu
947
-
#SBATCH --nodes=2
948
-
#SBATCH --mem=10G
949
-
#SBATCH --output logs_nodeodm-%j.out
894
+
cd SHOME
895
+
cd ODM/NodeODM/
950
896
951
-
cd $HOME/git/NodeODM
897
+
#Launch on Node 48
898
+
srun --nodes-1 apptainer run --writable node/ &
952
899
953
-
#Launched on first node
954
-
srun --nodes=1 singularity run --bind $PWD:/var/www nodeodm_latest.sif $
900
+
#Launch on node 50
901
+
srun --nodes-1 apptainer run --writable node/ &
955
902
956
-
#Launch on second node
903
+
#Launch on node 51
904
+
srun --nodes=1 apptainer run --writable node/ &
905
+
wait
957
906
958
-
srun --nodes=1 singularity run --bind $PWD:/var/www nodeodm_latest.sif $
959
907
960
-
wait
908
+
You can check for available nodes using sinfo:
961
909
962
-
start this script with
963
910
::
964
911
965
-
sbatch $HOME/git/NodeODM/nodeodm.slurm
912
+
sinfo
966
913
967
-
logs of this script are written in $HOME/git/NodeODM/logs_nodeodm-XXX.out XXX is the slurm job number
914
+
Run the following command to schedule using the SLURM script:
968
915
916
+
::
969
917
918
+
sbatch sample.slurm
970
919
971
-
ClusterODM
972
-
----------
973
-
Then you can start ClusterODM on the head node with
920
+
921
+
You can also check for currently running jobs using squeue:
974
922
975
923
::
976
924
977
-
cd $HOME/git/ClusterODM
978
-
singularity run --bind $PWD:/var/www clusterodm_latest.sif
925
+
squeue -u $USER
926
+
927
+
928
+
Unfortunately, SLURM does not handle assigning jobs to the head node. Hence, if we want to run ClusterODM on the head node, we have to run it locally. After that, you can connect to the CLI and wire the NodeODMs to the ClusterODMs. Here is an example following the sample SLURM script:
979
929
980
-
Connecting Nodes to ClusterODM
981
-
==============================
982
-
Use the following command to get the nodes names where NodeODM is running
983
930
::
984
931
985
-
squeue -u $USER
932
+
telnet localhost 8080
933
+
> NODE ADD node48 3000
934
+
> NODE ADD node50 3000
935
+
> NODE ADD node51 3000
936
+
> NODE LIST
986
937
987
-
ex : squeue -u $USER
988
-
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
989
-
1829323 ncpu NodeODM bonaime R 24:19 2 ncpu[015-016]
990
938
991
-
In this case, NodeODM run on ncpu015 and ncpu016
939
+
You should always check to make sure which ports are being used to run NodeODM if ClusterODM is not wired correctly.
940
+
941
+
It is also possible to pre-populate nodes using JSON. If starting ClusterODM from apptainer or docker, the relevant JSON is available at `docker/data/nodes.json`. Contents might look similar to the following:
992
942
993
-
Web interface
994
-
-------------
995
-
ClusterODM administrative web interface could be used to wire NodeODMs to the ClusterODM.
996
-
Open another shell window in your local machine and tunnel them to the HPC using the following command:
Replace yourusername and hpc-address with your appropriate username and the hpc address.
945
+
[
946
+
{"hostname":"node48","port":"3000","token":""},
947
+
{"hostname":"node50","port":"3000","token":""},
948
+
{"hostname":"node51","port":"3000","token":""}
949
+
]
1001
950
1002
-
Basically, this command will tunnel the port of the hpc to your local port.
1003
-
After this, open a browser in your local machine and connect to http://localhost:10000.
1004
-
Port 10000 is where ClusterODM's administrative web interface is hosted at.
1005
-
Then NodeODMs could be add/deleted to ClusterODM
1006
-
This is what it looks like :
1007
951
1008
-
.. figure:: images/clusterodm-admin-interface.png
1009
-
:alt:Clusterodm admin interface
1010
-
:align:center
952
+
After finish hosting ClusterODM on the head node and finish wiring it to the NodeODM, you can try tunneling to see if ClusterODM works as expected. Open another shell window in your local machine and tunnel them to the HPC using the following command:
You can connect to the ClusterODM CLI and wire the NodeODMs. For the previous example :
1017
958
1018
-
telnet localhost 8080
1019
-
> NODE ADD ncpu015 3000
1020
-
> NODE ADD ncpu016 3000
1021
-
> NODE LIST
959
+
Replace user and hostname with your appropriate username and the hpc address. Basically, this command will tunnel the port of the hpc to your local port. After this, open a browser in your local machine and connect to `http://localhost:10000`. Port 10000 is where ClusterODM's administrative web interface is hosted at. This is what it looks like:
After this, open a browser in your local machine and connect to http://localhost:3000 with your browser
1036
-
Here, you can Assign Tasks and observe the tasks' processes.
974
+
Port 3000 is ClusterODM's proxy. This is the place we assign tasks to ClusterODM. Once again, connect to `http://localhost:3000` with your browser after tunneling. Here, you can Assign Tasks and observe the tasks' processes.
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.
0 commit comments