Skip to content

Commit bcc6618

Browse files
committed
fix: misplaced argument
1 parent 522ad69 commit bcc6618

File tree

8 files changed

+28
-23
lines changed

8 files changed

+28
-23
lines changed

docs/aws.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ the on-demand instance cost - you'll always pay the current market price, not yo
9191
| addSwap | Optionally add this much swap space to the instance as a factor of total RAM (`RAM * addSwap`). A value of `1` sets a swapfile equal to the available RAM. |
9292
| dockerImage | Docker image to launch |
9393
| dockerDataDirMountPath | Path on node host to map to NodeODM data directory (/var/www/data). Use local instance storage for much faster I/O. |
94-
| dockerAdditionalArgs | Additional args to pass to docker run command. For instance `--gpu all` to enable GPU acceleration |
94+
| dockerGpu | Enables GPU acceleration by passing `--gpu all` to docker |
9595
| nodeSetupCmd | Can be optionally used to run a setup command on auto-scaled nodes right before we run ODM. |
9696

9797
## Image Size Mapping

docs/digitalocean.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ Example configuration file:
6060
| minImages | Minimum number of images that a dataset needs to have for the autoscaler to be used (-1 = no minimum). |
6161
| addSwap | Optionally add this much swap space to the droplet as a factor of total RAM (`RAM * addSwap`). A value of `1` sets a swapfile equal to the available RAM. |
6262
| dockerImage | Docker image to launch
63-
| dockerAdditionalArgs | Additional args to pass to docker run command. For instance `--gpu all` to enable GPU acceleration |
63+
| dockerGpu | Enables GPU acceleration by passing `--gpu all` to docker |
6464
|

docs/hetzner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ Example configuration file:
7171
| minImages | Minimum number of images that a dataset needs to have for the autoscaler to be used (-1 = no minimum). |
7272
| addSwap | Optionally add this much swap space to the machine as a factor of total RAM (`RAM * addSwap`). A value of `1` sets a swapfile equal to the available RAM. |
7373
| dockerImage | Docker image to launch |
74-
| dockerAdditionalArgs | Additional args to pass to docker run command. For instance `--gpu all` to enable GPU acceleration |
74+
| dockerGpu | Enables GPU acceleration by passing `--gpu all` to docker |

docs/scaleway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ Example configuration file:
6666
| minImages | Minimum number of images that a dataset needs to have for the autoscaler to be used (-1 = no minimum). |
6767
| addSwap | Optionally add this much swap space to the machine as a factor of total RAM (`RAM * addSwap`). A value of `1` sets a swapfile equal to the available RAM. |
6868
| dockerImage | Docker image to launch |
69-
| dockerAdditionalArgs | Additional args to pass to docker run command. For instance `--gpu all` to enable GPU acceleration |
69+
| dockerGpu | Enables GPU acceleration by passing `--gpu all` to docker |

libs/asr-providers/aws.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = class AWSAsrProvider extends AbstractASRProvider{
5454
"addSwap": 1,
5555
"dockerImage": "opendronemap/nodeodm",
5656
"dockerDataDirMountPath": "",
57-
"dockerAdditionalArgs": "",
57+
"dockerGpu": false,
5858

5959
"iamrole": "",
6060
"nodeSetupCmd": ""
@@ -124,7 +124,6 @@ module.exports = class AWSAsrProvider extends AbstractASRProvider{
124124
const accessKey = this.getConfig("accessKey");
125125
const secretKey = this.getConfig("secretKey");
126126
const dataDirMountPath = this.getConfig("dataDirMountPath");
127-
const dockerAdditionalArgs = this.getConfig("dockerAdditionalArgs");
128127
const s3 = this.getConfig("s3");
129128
const webhook = netutils.publicAddressPath("/commit", req, token);
130129

@@ -139,6 +138,9 @@ module.exports = class AWSAsrProvider extends AbstractASRProvider{
139138
if(dataDirMountPath.length > 0){
140139
dockerRunArgs.push(`--mount type=bind,source=${dataDirMountPath},target=/var/www/data`);
141140
}
141+
if (this.getConfig("dockerGpu")){
142+
dockerRunArgs.push(`--gpus all`);
143+
}
142144

143145
dockerRunArgs.push(`${dockerImage} -q 1`);
144146
dockerRunArgs.push(`--s3_access_key ${accessKey}`);
@@ -148,9 +150,6 @@ module.exports = class AWSAsrProvider extends AbstractASRProvider{
148150
dockerRunArgs.push(`--s3_acl ${s3.acl}`);
149151
dockerRunArgs.push(`--webhook ${webhook}`);
150152
dockerRunArgs.push(`--token ${nodeToken}`);
151-
if (dockerAdditionalArgs.length > 0){
152-
dockerRunArgs.push(dockerAdditionalArgs);
153-
}
154153

155154
await dm.ssh(dockerRunArgs.join(" "));
156155
}

libs/asr-providers/digitalocean.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = class DigitalOceanAsrProvider extends AbstractASRProvider{
5858

5959
"addSwap": 1,
6060
"dockerImage": "opendronemap/nodeodm",
61-
"dockerAdditionalArgs": ""
61+
"dockerGpu": false
6262
}, userConfig);
6363
}
6464

@@ -125,19 +125,21 @@ module.exports = class DigitalOceanAsrProvider extends AbstractASRProvider{
125125
}
126126

127127
const dockerImage = this.getConfig("dockerImage");
128-
const dockerAdditionalArgs = this.getConfig("dockerAdditionalArgs", "");
129128
const s3 = this.getConfig("s3");
130129
const webhook = netutils.publicAddressPath("/commit", req, token);
130+
let dockerAdditionalArgs = "";
131+
if (this.getConfig("dockerGpu")) {
132+
dockerAdditionalArgs = "--gpus all";
133+
}
131134

132-
await dm.ssh([`docker run -d -p 3000:3000 ${dockerImage} -q 1`,
135+
await dm.ssh([`docker run -d -p 3000:3000 ${dockerAdditionalArgs} ${dockerImage} -q 1`,
133136
`--s3_access_key ${s3.accessKey}`,
134137
`--s3_secret_key ${s3.secretKey}`,
135138
`--s3_endpoint ${s3.endpoint}`,
136139
`--s3_bucket ${s3.bucket}`,
137140
s3.ignoreSSL ? '--s3_ignore_ssl' : '',
138141
`--webhook ${webhook}`,
139-
`--token ${nodeToken}`,
140-
`${dockerAdditionalArgs}`].join(" "));
142+
`--token ${nodeToken}`].join(" "));
141143
}
142144

143145
getImageSlugFor(imagesCount){

libs/asr-providers/hetzner.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = class HetznerAsrProvider extends AbstractASRProvider{
5656

5757
"addSwap": 1,
5858
"dockerImage": "opendronemap/nodeodm",
59-
"dockerAdditionalArgs": ""
59+
"dockerGpu": false
6060
}, userConfig);
6161
}
6262

@@ -176,19 +176,21 @@ module.exports = class HetznerAsrProvider extends AbstractASRProvider{
176176
}
177177

178178
const dockerImage = this.getConfig("dockerImage");
179-
const dockerAdditionalArgs = this.getConfig("dockerAdditionalArgs", "");
180179
const s3 = this.getConfig("s3");
181180
const webhook = netutils.publicAddressPath("/commit", req, token);
181+
let dockerAdditionalArgs = "";
182+
if (this.getConfig("dockerGpu")) {
183+
dockerAdditionalArgs = "--gpus all";
184+
}
182185

183-
await dm.ssh([`docker run -d -p 3000:3000 ${dockerImage} -q 1`,
186+
await dm.ssh([`docker run -d -p 3000:3000 ${dockerAdditionalArgs} ${dockerImage} -q 1`,
184187
`--s3_access_key ${s3.accessKey}`,
185188
`--s3_secret_key ${s3.secretKey}`,
186189
`--s3_endpoint ${s3.endpoint}`,
187190
`--s3_bucket ${s3.bucket}`,
188191
s3.ignoreSSL ? '--s3_ignore_ssl' : '',
189192
`--webhook ${webhook}`,
190-
`--token ${nodeToken}`,
191-
`${dockerAdditionalArgs}`
193+
`--token ${nodeToken}`
192194
].join(" "));
193195
}
194196

libs/asr-providers/scaleway.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = class ScalewayAsrProvider extends AbstractASRProvider{
4949

5050
"addSwap": 1,
5151
"dockerImage": "opendronemap/nodeodm",
52-
"dockerAdditionalArgs": ""
52+
"dockerGpu": false
5353
}, userConfig);
5454
}
5555

@@ -108,19 +108,21 @@ module.exports = class ScalewayAsrProvider extends AbstractASRProvider{
108108
}
109109

110110
const dockerImage = this.getConfig("dockerImage");
111-
const dockerAdditionalArgs = this.getConfig("dockerAdditionalArgs", "");
112111
const s3 = this.getConfig("s3");
113112
const webhook = netutils.publicAddressPath("/commit", req, token);
113+
let dockerAdditionalArgs = "";
114+
if (this.getConfig("dockerGpu")) {
115+
dockerAdditionalArgs = "--gpus all";
116+
}
114117

115-
await dm.ssh([`docker run -d -p 3000:3000 ${dockerImage} -q 1`,
118+
await dm.ssh([`docker run -d -p 3000:3000 ${dockerAdditionalArgs} ${dockerImage} -q 1`,
116119
`--s3_access_key ${s3.accessKey}`,
117120
`--s3_secret_key ${s3.secretKey}`,
118121
`--s3_endpoint ${s3.endpoint}`,
119122
`--s3_bucket ${s3.bucket}`,
120123
s3.ignoreSSL ? '--s3_ignore_ssl' : '',
121124
`--webhook ${webhook}`,
122125
`--token ${nodeToken}`,
123-
`${dockerAdditionalArgs}`
124126
].join(" "));
125127
}
126128

0 commit comments

Comments
 (0)