From 30a4b0c1aeb55913dba97d7e0133e0a84592bf85 Mon Sep 17 00:00:00 2001 From: Karl Keller Date: Tue, 30 Nov 2021 18:42:06 +0000 Subject: [PATCH 1/2] Add KarlKeller to contributing list --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c16f446..f155dab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1,4 @@ See https://github.com/OpenDroneMap/documents/blob/master/CONTRIBUTING.md + +KarlKeller + From 52a4a60fd30d7accef42ace7ea7254652c0ac723 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Mon, 20 Dec 2021 16:04:40 +0000 Subject: [PATCH 2/2] Adds AWS subnet, vpc, IAMRole, and zone support. --- docs/aws.md | 15 ++++++++++++--- libs/asr-providers/aws.js | 28 ++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/docs/aws.md b/docs/aws.md index 491b889..1a18309 100644 --- a/docs/aws.md +++ b/docs/aws.md @@ -4,7 +4,10 @@ In order to use ClusterODM with AWS: * Create an Amazon Web Services Account * Select a region to run your instances in - `us-east-2` typically has the cheapest instance costs. -* Create a security group in this region which allows inbound access from your ClusterODM master instance on TCP port 3000. +* Note the zone selected for the region, e.g. 'a'. This will appear appended to the region in 'availability zone'. +* Select/Create a VPC in which the resources will operate. +* Select/Create a subnet within the VPC. +* 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. * Create an S3 bucket in this region to handle results. Don't configure this bucket to block public access. * Select an AMI (machine image) to run - Ubuntu has a [handy AMI finder](https://cloud-images.ubuntu.com/locator/ec2/). * 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 "endpoint": "s3.us-west-2.amazonaws.com", "bucket": "bucketname" }, + "vpc": "", + "subnet": "", "securityGroup": "CHANGEME!", "monitoring": false, "maxRuntime": -1, "maxUploadTime": -1, "region": "us-west-2", + "zone": "a", "tags": ["type,clusterodm"], "ami": "ami-07b4f3c02c7f83d59", @@ -63,14 +69,17 @@ the on-demand instance cost - you'll always pay the current market price, not yo | accessKey | AWS Access Key | | secretKey | AWS Secret Key | | s3 | S3 bucket configuration. Note that the bucket should *not* be configured to block public access. | +| vpc | The virtual private cloud in which the instances operate. Not providing this assumes a default setting for VPC within the AWS environment. | +| subnet | The subnet supporting the instances. Not providing this assumes a default setting for the subnet within the AWS environment. | | securityGroup | AWS Security Group name (not ID). Must exist and allow incoming connections from your ClusterODM host on port TCP/3000. | -| createRetries | Number of attempts to create a droplet before giving up. Defaults to 1. +| createRetries | Number of attempts to create a droplet before giving up. Defaults to 1. | | maxRuntime | Maximum number of seconds an instance is allowed to run ever. Set to -1 for no limit. | | maxUploadTime | Maximum number of seconds an instance is allowed to receive file uploads. Set to -1 for no limit. | | monitoring | Set to true to enable detailed Cloudwatch monitoring for the instance. | | region | Region identifier where the instances should be created. | +| zone | Zone identifier where the instances should be created. | | ami | The AMI (machine image) to launch this instance from. | -| tags | Comma-separated list of key,value tags to associate to the instance. | +| tags | Comma-separated list of key,value tags to associate to the instance. | | spot | Whether to request spot instances. If this is true, a `spotPrice` needs to be provided in the `imageSizeMapping`. | | imageSizeMapping | Max images count to instance size mapping. (See below.) | | 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. | diff --git a/libs/asr-providers/aws.js b/libs/asr-providers/aws.js index c95629a..3d64e67 100644 --- a/libs/asr-providers/aws.js +++ b/libs/asr-providers/aws.js @@ -30,13 +30,15 @@ module.exports = class AWSAsrProvider extends AbstractASRProvider{ "endpoint": "CHANGEME!", "bucket": "CHANGEME!" }, - + "vpc": "", + "subnet": "", "securityGroup": "CHANGEME!", "maxRuntime": -1, "maxUploadTime": -1, "instanceLimit": -1, "createRetries": 1, "region": "us-west-2", + "zone": "", "monitoring": false, "tags": ["clusterodm"], "ami": "ami-07b4f3c02c7f83d59", @@ -47,7 +49,8 @@ module.exports = class AWSAsrProvider extends AbstractASRProvider{ ], "addSwap": 1, - "dockerImage": "opendronemap/nodeodm" + "dockerImage": "opendronemap/nodeodm", + "iamrole": "" }, userConfig); } @@ -180,6 +183,27 @@ module.exports = class AWSAsrProvider extends AbstractASRProvider{ args.push(this.getConfig("engineInstallUrl")); } + if (this.getConfig("zone").length > 0){ + args.push("--amazonec2-zone") + args.push(this.getConfig("zone")); + } + + if (this.getConfig("vpc").length > 0){ + args.push("--amazonec2-vpc-id") + args.push(this.getConfig("vpc")); + } + + if (this.getConfig("subnet").length > 0){ + args.push("--amazonec2-subnet-id") + args.push(this.getConfig("subnet")); + } + + + if (this.getConfig("iamrole").length > 0){ + args.push("--amazonec2-iam-instance-profile") + args.push(this.getConfig("iamrole")); + } + return args; } };