Skip to content

Commit

Permalink
Apptainer/Singularity, more output, sync to NodeODM Part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kikislater committed Sep 16, 2024
1 parent 8416ba2 commit eb9b5e2
Show file tree
Hide file tree
Showing 22 changed files with 847 additions and 381 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules
tests
tmp
data
nodemicmac.sif
node
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ package-lock.json
micmac/build
micmac/build/*

*.pyc
*.pyc

data
node
nodemicmac.sif
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apt-get update
RUN apt-get install -y -qq --no-install-recommends software-properties-common build-essential cmake git \
exiv2 libimage-exiftool-perl proj-bin gdal-bin figlet imagemagick pdal libpdal-dev \
libboost-all-dev libtbb-dev libssl-dev libcurl4-openssl-dev pkg-config libpth-dev \
curl libx11-dev python3-pip python3-setuptools python3-shapely apt-utils
curl libx11-dev python3-pip python3-setuptools python3-shapely apt-utils p7zip-full

RUN pip3 install -U shyaml
RUN pip3 install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org appsettings
Expand All @@ -23,7 +23,7 @@ RUN pip3 install --trusted-host pypi.org --trusted-host pypi.python.org --truste

RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g nodemon
RUN npm install --production

# Build Entwine
WORKDIR "/staging"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,11 @@ cd build
cmake -DCMAKE_BUILD_TYPE=Release -DLASZIP_INCLUDE_DIRS=/staging/LAStools/LASzip/dll -DLASZIP_LIBRARY=/staging/LAStools/LASzip/build/src/liblaszip.a ..
make && sudo make install
```
2] Install gdal2tiles.py script, node.js and npm dependencies
2] Install gdal2tiles.py script, node.js, npm dependencies and 7zip:

```bash
sudo curl --silent --location https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get install -y nodejs python-gdal
sudo apt-get install -y nodejs python-gdal p7zip-full
git clone hhttps://github.com/OpenDroneMap/NodeMICMAC.git
cd NodeMICMAC
npm install
Expand Down
18 changes: 18 additions & 0 deletions apptainer.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Bootstrap: docker
From: opendronemap/nodemicmac:master

%labels
Author Sylvain POULAIN
Version 1.0
Description Apptainer container for NodeMICMAC and WebGIS with Entwine and MicMac.

%environment
export PATH=$PATH:/code/micmac/bin
export python=$(which python3)

%runscript
cd "/var/www"
exec /usr/bin/node /var/www/index.js "$@"
%startscript
cd "/var/www"
exec /usr/bin/node /var/www/index.js "$@"
5 changes: 5 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
let fs = require('fs');
let argv = require('minimist')(process.argv.slice(2));
let utils = require('./libs/utils');
const spawnSync = require('child_process').spawnSync;

if (argv.help){
console.log(`
Expand Down Expand Up @@ -113,4 +114,8 @@ config.s3SignatureVersion = argv.s3_signature_version || fromConfigFile("s3Signa
config.s3UploadEverything = argv.s3_upload_everything || fromConfigFile("s3UploadEverything", false);
config.maxConcurrency = parseInt(argv.max_concurrency || fromConfigFile("maxConcurrency", 0));

// Detect 7z availability
const childProcess = spawnSync("7z", ['--help']);
config.has7z = childProcess.status === 0;

module.exports = config;
1 change: 0 additions & 1 deletion data/.gitignore

This file was deleted.

5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,11 @@ if (config.test) {
if (config.testDropUploads) logger.info("Uploads will drop at random");
}


if (!config.has7z){
logger.warn("The 7z program is not installed, falling back to legacy (zipping will be slower)");
}

let commands = [
cb => odmInfo.initialize(cb),
cb => auth.initialize(cb),
Expand Down
10 changes: 5 additions & 5 deletions libs/Directories.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Node-OpenDroneMap Node.js App and REST API to access OpenDroneMap.
Copyright (C) 2016 Node-OpenDroneMap Contributors
NodeODM App and REST API to access ODM.
Copyright (C) 2016 NodeODM Contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Expand All @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
"use strict";
Expand All @@ -25,4 +25,4 @@ class Directories{
}
}

module.exports = Directories;
module.exports = Directories;
10 changes: 5 additions & 5 deletions libs/ProgressReceiver.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Node-OpenDroneMap Node.js App and REST API to access OpenDroneMap.
Copyright (C) 2016 Node-OpenDroneMap Contributors
NodeODM App and REST API to access ODM.
Copyright (C) 2016 NodeODM Contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Expand All @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
"use strict";
Expand All @@ -21,7 +21,7 @@ const dgram = require('dgram');

module.exports = class ProgressReceiver{
constructor(){
const server = dgram.createSocket('udp4');
const server = dgram.createSocket({type: 'udp4', reuseAddr: true});
this.callbacks = [];

server.on('error', (err) => {
Expand Down
Loading

0 comments on commit eb9b5e2

Please sign in to comment.