Skip to content

Commit 11331f4

Browse files
authored
Merge pull request #87 from Karl-Keller/fixIssue85
Fix issue85
2 parents c2c2e8f + 52a4a60 commit 11331f4

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
See https://github.com/OpenDroneMap/documents/blob/master/CONTRIBUTING.md
2+
3+
KarlKeller
4+

docs/aws.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ In order to use ClusterODM with AWS:
44

55
* Create an Amazon Web Services Account
66
* Select a region to run your instances in - `us-east-2` typically has the cheapest instance costs.
7-
* Create a security group in this region which allows inbound access from your ClusterODM master instance on TCP port 3000.
7+
* Note the zone selected for the region, e.g. 'a'. This will appear appended to the region in 'availability zone'.
8+
* Select/Create a VPC in which the resources will operate.
9+
* Select/Create a subnet within the VPC.
10+
* Create a security group in this region, VPC, and subnet which allows inbound access from your ClusterODM master instance on TCP port 3000. Note the name of the security group not the ID.
811
* Create an S3 bucket in this region to handle results. Don't configure this bucket to block public access.
912
* Select an AMI (machine image) to run - Ubuntu has a [handy AMI finder](https://cloud-images.ubuntu.com/locator/ec2/).
1013
* Create an IAM account for ClusterODM to use, which has EC2 and S3 permissions.
@@ -30,12 +33,15 @@ the on-demand instance cost - you'll always pay the current market price, not yo
3033
"endpoint": "s3.us-west-2.amazonaws.com",
3134
"bucket": "bucketname"
3235
},
36+
"vpc": "",
37+
"subnet": "",
3338
"securityGroup": "CHANGEME!",
3439

3540
"monitoring": false,
3641
"maxRuntime": -1,
3742
"maxUploadTime": -1,
3843
"region": "us-west-2",
44+
"zone": "a",
3945
"tags": ["type,clusterodm"],
4046

4147
"ami": "ami-07b4f3c02c7f83d59",
@@ -63,14 +69,17 @@ the on-demand instance cost - you'll always pay the current market price, not yo
6369
| accessKey | AWS Access Key |
6470
| secretKey | AWS Secret Key |
6571
| s3 | S3 bucket configuration. Note that the bucket should *not* be configured to block public access. |
72+
| vpc | The virtual private cloud in which the instances operate. Not providing this assumes a default setting for VPC within the AWS environment. |
73+
| subnet | The subnet supporting the instances. Not providing this assumes a default setting for the subnet within the AWS environment. |
6674
| securityGroup | AWS Security Group name (not ID). Must exist and allow incoming connections from your ClusterODM host on port TCP/3000. |
67-
| createRetries | Number of attempts to create a droplet before giving up. Defaults to 1.
75+
| createRetries | Number of attempts to create a droplet before giving up. Defaults to 1. |
6876
| maxRuntime | Maximum number of seconds an instance is allowed to run ever. Set to -1 for no limit. |
6977
| maxUploadTime | Maximum number of seconds an instance is allowed to receive file uploads. Set to -1 for no limit. |
7078
| monitoring | Set to true to enable detailed Cloudwatch monitoring for the instance. |
7179
| region | Region identifier where the instances should be created. |
80+
| zone | Zone identifier where the instances should be created. |
7281
| ami | The AMI (machine image) to launch this instance from. |
73-
| tags | Comma-separated list of key,value tags to associate to the instance. |
82+
| tags | Comma-separated list of key,value tags to associate to the instance. |
7483
| spot | Whether to request spot instances. If this is true, a `spotPrice` needs to be provided in the `imageSizeMapping`. |
7584
| imageSizeMapping | Max images count to instance size mapping. (See below.) |
7685
| 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. |

libs/asr-providers/aws.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ module.exports = class AWSAsrProvider extends AbstractASRProvider{
3030
"endpoint": "CHANGEME!",
3131
"bucket": "CHANGEME!"
3232
},
33-
33+
"vpc": "",
34+
"subnet": "",
3435
"securityGroup": "CHANGEME!",
3536
"maxRuntime": -1,
3637
"maxUploadTime": -1,
3738
"instanceLimit": -1,
3839
"createRetries": 1,
3940
"region": "us-west-2",
41+
"zone": "",
4042
"monitoring": false,
4143
"tags": ["clusterodm"],
4244
"ami": "ami-07b4f3c02c7f83d59",
@@ -47,7 +49,8 @@ module.exports = class AWSAsrProvider extends AbstractASRProvider{
4749
],
4850

4951
"addSwap": 1,
50-
"dockerImage": "opendronemap/nodeodm"
52+
"dockerImage": "opendronemap/nodeodm",
53+
"iamrole": ""
5154
}, userConfig);
5255
}
5356

@@ -180,6 +183,27 @@ module.exports = class AWSAsrProvider extends AbstractASRProvider{
180183
args.push(this.getConfig("engineInstallUrl"));
181184
}
182185

186+
if (this.getConfig("zone").length > 0){
187+
args.push("--amazonec2-zone")
188+
args.push(this.getConfig("zone"));
189+
}
190+
191+
if (this.getConfig("vpc").length > 0){
192+
args.push("--amazonec2-vpc-id")
193+
args.push(this.getConfig("vpc"));
194+
}
195+
196+
if (this.getConfig("subnet").length > 0){
197+
args.push("--amazonec2-subnet-id")
198+
args.push(this.getConfig("subnet"));
199+
}
200+
201+
202+
if (this.getConfig("iamrole").length > 0){
203+
args.push("--amazonec2-iam-instance-profile")
204+
args.push(this.getConfig("iamrole"));
205+
}
206+
183207
return args;
184208
}
185209
};

0 commit comments

Comments
 (0)