Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GPU instance support to the up command #743

Merged
merged 7 commits into from
Mar 13, 2019

Conversation

efekarakus
Copy link
Contributor

Summary

Issue #, if available: 729

Description of changes: The ecs-cli up command now fetched the recommended Amazon ECS GPU optimized AMI metadata given a GPU instance type.

Testing

Ran make docker-test and the unit tests pass

Manual

Ran the command ./bin/local/ecs-cli up --capability-iam --instance-type p2.xlarge --cluster-config no-gpu-support --launch-type EC2 --force and can confirm that the EC2 instance uses the AMI ID amzn2-ami-ecs-gpu-hvm-2.0.20190301-x86_64-ebs (ami-0ebf2c738e66321e6)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@allisaurus allisaurus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide some test output that shows ecs-cli up running successfully with:

  • a GPU instance
  • an arm64 instance
  • a less specialized instance type (e.g., t2 family)
  • no instance type specified

ecs-cli/modules/cli/cluster/cluster_app.go Show resolved Hide resolved
@efekarakus
Copy link
Contributor Author

efekarakus commented Mar 11, 2019

Manual Testing

New functionality

p2.xlarge

./bin/local/ecs-cli up --capability-iam --instance-type p2.xlarge --launch-type EC2 —force

Successful cluster creation, and verified in console that the instance has a GPU optimized image:

WARN[0000] You will not be able to SSH into your EC2 instances without a key pair. 
INFO[0000] Using GPU ecs-optimized AMI because instance type was p2.xlarge 
INFO[0001] Using recommended Amazon Linux 2 AMI with ECS Agent 1.26.0 and Docker version 18.06.1-ce 
INFO[0001] Created cluster                               cluster=default region=us-east-1
INFO[0001] Waiting for your CloudFormation stack resources to be deleted... 
INFO[0001] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0062] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0124] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0185] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0216] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
INFO[0277] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
INFO[0338] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
VPC created: vpc-06b66bb4219a9e0c0
Security Group created: sg-03e2af850152fce2b
Subnet created: subnet-0e14561045cde0ac9
Subnet created: subnet-00421aceefc4c52cb
Cluster creation succeeded.

Existing functionality

a1.medium

./bin/local/ecs-cli up --capability-iam --instance-type a1.medium --launch-type EC2 —force

Successful cluster creation, and verified in console that the instance has an ARM optimized image:

WARN[0000] You will not be able to SSH into your EC2 instances without a key pair. 
INFO[0000] Using Arm ecs-optimized AMI because instance type was a1.medium 
INFO[0001] Using recommended Amazon Linux 2 AMI with ECS Agent 1.26.0 and Docker version 18.06.1-ce 
INFO[0001] Created cluster                               cluster=default region=us-east-1
INFO[0001] Waiting for your CloudFormation stack resources to be deleted... 
INFO[0001] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0033] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
INFO[0094] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
INFO[0155] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
VPC created: vpc-0f6c784332f7657ad
Security Group created: sg-03933bd25b4d445dc
Subnet created: subnet-0c108f8f7f7117b9c
Subnet created: subnet-03c43207ecfe984d3
Cluster creation succeeded.

a1.medium in unsupported region

./bin/local/ecs-cli up --capability-iam --instance-type a1.medium --region us-west-1 --launch-type EC2 --force

Successfully fails:

WARN[0000] You will not be able to SSH into your EC2 instances without a key pair. 
INFO[0000] Using Arm ecs-optimized AMI because instance type was a1.medium 
FATA[0000] Error executing 'up': Could not find Recommended Amazon Linux 2 AMI /aws/service/ecs/optimized-ami/amazon-linux-2/arm64/recommended in us-west-1; the AMI may not be supported in this region: ParameterNotFound: 
	status code: 400, request id: 69ad3e1c-7643-4971-a276-46774ecb34d7 

t2.micro

./bin/local/ecs-cli up --capability-iam --instance-type t2.micro --cluster-config no-gpu-support --launch-type EC2 —force

Successful creation of cluster, and verified in console that the instance is created properly:

WARN[0000] You will not be able to SSH into your EC2 instances without a key pair. 
INFO[0001] Using recommended Amazon Linux 2 AMI with ECS Agent 1.26.0 and Docker version 18.06.1-ce 
INFO[0001] Created cluster                               cluster=no-gpu-support region=us-east-1
INFO[0001] Waiting for your CloudFormation stack resources to be deleted... 
INFO[0001] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0062] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0123] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0186] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
INFO[0247] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
INFO[0308] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
VPC created: vpc-02ba225c17d0e856d
Security Group created: sg-05283b77b9aa150e8
Subnet created: subnet-054bab4f149655ca7
Subnet created: subnet-040ce52a313c56e10
Cluster creation succeeded.

No instance type specified

./bin/local/ecs-cli up --capability-iam --launch-type EC2 —force

Successfully defaults to t2.micro:

WARN[0000] You will not be able to SSH into your EC2 instances without a key pair. 
INFO[0000] Defaulting instance type to t2.micro         
INFO[0001] Using recommended Amazon Linux 2 AMI with ECS Agent 1.26.0 and Docker version 18.06.1-ce 
INFO[0001] Created cluster                               cluster=default region=us-east-1
INFO[0001] Waiting for your CloudFormation stack resources to be deleted... 
INFO[0001] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0063] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0123] Cloudformation stack status                   stackStatus=DELETE_IN_PROGRESS
INFO[0186] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
INFO[0247] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
INFO[0308] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
VPC created: vpc-0c765334b7fd1745d
Security Group created: sg-0ac3d886102f0976d
Subnet created: subnet-0c290f945aa9d318a
Subnet created: subnet-0f4209d27e4e9f79a
Cluster creation succeeded.

@@ -359,7 +347,6 @@ func createCluster(context *cli.Context, awsClients *AWSClients, commandConfig *
return err
}

logrus.Info("Waiting for your cluster resources to be created...")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we're getting rid of this log statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea why I removed that log statement, sorry! I put it back :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants