Skip to content

Run test plans on Docker Swarm (AWS)#126

Merged
daviddias merged 19 commits intomasterfrom
runner/cluster-swarm-aws
Nov 7, 2019
Merged

Run test plans on Docker Swarm (AWS)#126
daviddias merged 19 commits intomasterfrom
runner/cluster-swarm-aws

Conversation

@raulk
Copy link
Copy Markdown
Contributor

@raulk raulk commented Nov 6, 2019

This PR builds on #112. It introduces:

  • a cluster:swarm runner that takes a docker image of a test plan, and runs a test case within a Docker swarm cluster on AWS.
  • docker:go builder can now push to Docker registries, particularly AWS ECR registries. It does the aws ecr get-login dance and all!
  • an environment configuration file for things like AWS secrets, docker endpoints, etc. This is what mine looks like (eliding sensitive info):
["aws"]
access_key_id = "access key id"
secret_access_key = "secret access key"
region = "us-west-2"

[run_strategies."cluster:swarm"]
docker_endpoint = "tcp://localhost:4545"
docker_tls = false
docker_tls_ca_cert_path = "/"
docker_tls_cert_path = "/"
docker_tls_key_path = "/"

I'm hitting the remote Docker Swarm manager endpoint by creating an SSH tunnel for port forwarding:

$ ssh -nNT -L 4545:/var/run/docker.sock ubuntu@...compute.amazonaws.com

jimpick and others added 3 commits November 6, 2019 00:09
Needs to connect to the right network and fetch the right
image.
Just need to make those a bit more dynamic and we will have a working
runner!
@raulk raulk force-pushed the runner/cluster-swarm-aws branch from 222f0c4 to 6aa9be6 Compare November 6, 2019 00:18
@raulk raulk mentioned this pull request Nov 6, 2019
raulk added 6 commits November 6, 2019 10:21
It now schedules containers on AWS. By default
it runs on the foreground and tails service logs,
until all replicas are done, at which point it
deletes the service.

These behaviours are configurable via runner cfg.
@raulk raulk marked this pull request as ready for review November 6, 2019 20:44
@daviddias
Copy link
Copy Markdown
Contributor

daviddias commented Nov 6, 2019

Could you:

  • Create a secrets-example.toml with the placeholder you pasted at Run test plans on Docker Swarm (AWS) #126 (comment) and add to .gitignore a secrets.toml
  • Add to the README the note on how to create that file (i.e. cp secrets-example.toml secrets.toml and add the the user own secrets)

@raulk
Copy link
Copy Markdown
Contributor Author

raulk commented Nov 6, 2019

@daviddias good ideas!

Copy link
Copy Markdown
Contributor

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

Awesome work! Made some comments and suggestions. That said, @Stebalien should review as there is a lot of go things here that are beyond my current knowledge.

@raulk raulk requested a review from daviddias November 6, 2019 21:22
@raulk raulk requested a review from daviddias November 6, 2019 21:41
Copy link
Copy Markdown
Contributor

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

Thanks for applying CR :)

We now check the executable directory and the working directory.
@raulk raulk requested a review from Stebalien November 6, 2019 23:29
@daviddias
Copy link
Copy Markdown
Contributor

Only missing a @Stebalien 👍🏽 for the merge? :)

Copy link
Copy Markdown
Contributor

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

image

CI lint is unhappy.

}

if !cfg.KeepContainers {
defer deleteContainers(cli, log, containers)
Copy link
Copy Markdown
Contributor

@daviddias daviddias Nov 7, 2019

Choose a reason for hiding this comment

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

Go is unhappy here - #126 (review)

Suggested change
defer deleteContainers(cli, log, containers)
defer func () {
err := deleteContainers(cli, log, containers)
if err != nil {
log.Errorw("error while deleting containers", "error", err)
}
}()

Or is there other best practice to silence this lint error?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In this case, we probably want to log.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(fixed)

Copy link
Copy Markdown
Contributor

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

@raulk raulk force-pushed the runner/cluster-swarm-aws branch from 5687b96 to c93a876 Compare November 7, 2019 10:05
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