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

WIP: Creates templates for ECS and EC2 testing #71

Closed
wants to merge 1 commit into from

Conversation

morris25
Copy link
Contributor

@morris25 morris25 commented Mar 4, 2019

In response to #66

@iamed2
Copy link
Member

iamed2 commented Mar 4, 2019

Can you explain this in detail please?

DeployGroupName:
Value: !Ref DeployGroup


Choose a reason for hiding this comment

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

Can get rid of extra blank lines

@morris25
Copy link
Contributor Author

morris25 commented Mar 4, 2019

Currently, we have functions in AWSCredentials.jl that work specifically for retrieving credentials from EC2 instances and containers running through ECS. As it stands, these functions are untested.

The ec2_test.yml creates an EC2 instance along with logging and AWS CodeDeploy, which should make hooking it up to travis easier. The appspec.yml and runtests.sh are both part of the codedeploy setup.

ecs_test.yml provides the means to launch an ECS Container through AWSBatch, and contains a job description that should run the AWSCore tests.

Both these templates can be launched as nested stacks through awscore_test.yml using the aws cloudformation package command. However, as they are less likely to be frequently used they are disabled by default, meaning the unpackaged template should still work as usual without the nested stacks.

@iamed2
Copy link
Member

iamed2 commented Mar 4, 2019

This proposed CodeDeploy setup should be detailed and demonstrated before anything is added to this repo. This approach creates a lot more complexity in the test infrastructure and needs to be fully evaluated. Alternatives should also be considered. One I can think of would be creating the EC2/ECS compute resources on demand and running tests on them using addprocs and an appropriate cluster manager.

One thing to note: the cost for running a t3.nano for a whole year is less than $50.

ecs_test.yml provides the means to launch an ECS Container through AWSBatch, and contains a job description that should run the AWSCore tests.

Why Batch and not ECS directly?

However, as they are less likely to be frequently used they are disabled by default

Huh? Whatever is done for EC2/ECS credential testing should be run every time.

@morris25
Copy link
Contributor Author

morris25 commented Mar 4, 2019

Huh? Whatever is done for EC2/ECS credential testing should be run every time

For our purposes yes, but others who aren't working directly on the credentials-related code will probably not want to spin up the additional nested stacks for local testing. It's probably easier for them not to have to worry about packaging the templates. Any automated deployment will be set up to test ECS/EC2 every time.

Why Batch and not ECS directly?

ECS seems to be set up to run continuous services. We could launch the tests as a task, but ECS doesn't provide very good output for whether a task completed successfully or not. It expects it to run forever, and so just keeps track of whether it's running or not. AWS Batch runs through an ECS cluster, and provides better output as to success or failure.

@morris25
Copy link
Contributor Author

morris25 commented Mar 6, 2019

After some fiddling I've got a minimal example of using CodeDeploy using the ec2_test stack here.
Here it is working: https://travis-ci.org/morris25/Example.jl/jobs/502654717
Here it is not-so-working: https://travis-ci.org/morris25/Example.jl/jobs/502669069
I'll note that the deployment output doesn't give very much information about failures. So if we use this approach, we would probably need to add something to retrieve the logs.

CodeDeploy has the ability to grab code straight from github, which simplifies the setup a little bit. The AWS User for the branch was created with AWSCodeDeployDeployerAccess and has now been disabled. In future revisions the permissions would be added to the PublicCIUser.

Alternatives should also be considered. One I can think of would be creating the EC2/ECS compute resources on demand and running tests on them using addprocs and an appropriate cluster manager

If you can point me to an appropriate cluster manager (preferably not using AWSCore), I'd be happy to give that approach a shot.

@iamed2
Copy link
Member

iamed2 commented Mar 6, 2019

The built-in SSH cluster manager combined with awscli would work without AWSCore

@morris25 morris25 mentioned this pull request Mar 29, 2019
bors bot added a commit that referenced this pull request Apr 9, 2019
72: Adds testing on ec2 r=iamed2 a=morris25

A second attempt at EC2 testing from #71.
In response to #66.

A proof of concept run can be found here https://travis-ci.org/morris25/Example.jl/builds/513200046 

Co-authored-by: morris25 <[email protected]>
@morris25 morris25 mentioned this pull request Apr 12, 2019
bors bot added a commit that referenced this pull request Apr 22, 2019
77: Adds testing on ECS r=iamed2 a=morris25

A cleaned up version of ECS testing from #71.
In response to #66.

Co-authored-by: morris25 <[email protected]>
@morris25 morris25 closed this Apr 23, 2019
@morris25 morris25 deleted the sm/online-test branch April 23, 2019 13:26
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.

3 participants