quintilesims / layer0

Build, Manage, and Deploy Your Applications
Apache License 2.0
44 stars 20 forks source link

[WIP] 500: Set LaunchType for services and tasks; remove EnvironmentType from environments #567

Closed tlake closed 6 years ago

tlake commented 6 years ago

What does this pull request do? Provides a solution for #500 that adds a --stateful boolean flag to the CLI's service create and task create to indicate a user's intent to launch on EC2 or Fargate instances. A similar flag is provided for the Terraform plugin. As a side effect, this changeset also removes the EnvironmentType (= "static" or "dynamic") field from the Environment model.

CLI and Terraform plugin read events have also been updated to understand the concept of a service or task's statefulness.

A user should specify requiresCompatibilities in the task definition file at the time of Deploy creation, and AWS will evaluate the task definition's compatibilities when it is registered in the course of Deploy creation. If a user fails to specify any requiresCompatibilities, Layer0 will supply both "EC2" and "FARGATE". In order for a service or task to be considered FARGATE-compatible (or "stateless"), a few additional fields must be configured in the task definition - see the Notes below.

How should this be tested?

The smoketests have been updated for the new workflow, and updated task definitions have been provided. That's probably a good place to gain understanding of the sort of workflows to use in manual testing.

Notes:

Checklist

closes #500

zpatrick commented 6 years ago

@tlake: don't forget to update swagger models!

tlake commented 6 years ago

@diemonster I'm happy to touch on smoketests in this PR. I haven't devoted any time to them yet because I wanted to not waste energy on them if this turned out to be the wrong path to follow. However, I know we've been wanting to get this into api-refactor ASAP, so messing with smoketests would definitely delay that.

Another option might be to merge this once code review has passed so that other devs can incorporate these changes in their own work, and then I can do smoketests in the same PR in which I add documentation for this new launch type support.

nehayward commented 6 years ago

Could we list whether the env is fargate or ec2 in the ‘l0 environment list command’

tlake commented 6 years ago

Closing this for now to avoid clutter.