Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

AWS ECS: validate memory + cpu pairs #1872

Merged
merged 4 commits into from
Jul 20, 2021
Merged

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Jul 15, 2021

AWS ECS / Fargate require the memory and cpu values for containers to be agreeable, and will error when trying to create a container or task definition if they do not match the prescribed values. See this article for more information:

The Waypoint ECS deployment already validated these to a point, but the ECS Server install did not. This PR refactors that validation into a shared utility and uses it for both the platform and server install.

UX for using bad memory value in an ECS deploy:

Screen Shot 2021-07-15 at 16 19 17

UX for using bad memory / cpu values for server install:

Screen Shot 2021-07-15 at 16 49 04

Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

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

I can't believe this is the right way to do this but I've seen this done in Terraform and so many other places that it just must be. LOL.

@@ -1063,58 +1056,29 @@ func (p *Platform) Launch(
L.Debug("registering task definition", "id", id)

var cpuShares int
family := "waypoint-" + app.App

s.Status("Registering Task definition: %s", family)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I moved this because it's the first status update in this method, and without moving it (or adding another one) when the validation fails it looks like the previous step failed, and not this one

Copy link
Contributor

@evanphx evanphx left a comment

Choose a reason for hiding this comment

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

Looks good, just a question about the changelog file.

Comment on lines +5 to +7
```release-note:bug
plugin/aws/ecs: validate memory and cpu values
```
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these should be in one block, mostly because I think go-changelog only supports one block per file?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

bitmoji

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

Successfully merging this pull request may close these issues.

4 participants