Commit Graph

276 Commits

Author SHA1 Message Date
Nicolas De Loof 8cd4a6fe9b
Fix golden files after rebase
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:54 +02:00
Guillaume Lours 07a57469db
Add unit tests version of migration tests instead of e2e one
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:53 +02:00
Guillaume Lours 4bbe3f1589
Add first compose to cloudformation conversion tests
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:53 +02:00
aiordache 3e5b118f26
add GetLogs to MockAPI
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:53 +02:00
aiordache 0492dacfee
remove redundant var init
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:52 +02:00
aiordache 9dbff1eb72
add logs command
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:52 +02:00
Nicolas De Loof 43d3d94c43
Create cluster by compose up
close #53

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:51 +02:00
Nicolas De Loof 1fdac494f3
Create CloudFormation template with parameters
so we don't need AWS API to resolve IDs and can run conversion offline

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:51 +02:00
Guillaume Lours 69a7ef0763
Make cluster optional in context setup
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:51 +02:00
Nicolas De Loof 4ab37f8229
Implement Hostname-only service discovery using LOCALDOMAIN
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:50 +02:00
Guillaume Lours 0864513bfe
Switch automatically to interactive mode if one of the required flag is not set
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:50 +02:00
Guillaume Lours 51e04a4702
Add interactive context setup
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:50 +02:00
Guillaume Lours 895dc249b4
Manage aws credentials within setup command
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:49 +02:00
aiordache 3a678fd7dc
cleanup
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:49 +02:00
aiordache d09c8c7236
add private images support
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:49 +02:00
aiordache 57d7474f7d
set secrets in cloudformation template
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:48 +02:00
aiordache f95bd4fdbf
mapping cpu and memory to fargate values
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:48 +02:00
Guillaume Lours 3e785e2cb0
Fix initialization issue of aws context with PreRun function
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:47 +02:00
Nicolas De Loof 1889d04d83
Implement "network" using SecurityGroups
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:47 +02:00
Guillaume Lours 6febf68748
Add e2e tests for plugin behavior and commands
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:47 +02:00
Guillaume Lours aa8587095f
Add setup command to define a docker context for ecs-plugin
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:46 +02:00
Nicolas De Loof 09871400ef
Register services within Cloud Map
close #35

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:46 +02:00
Nicolas De Loof 0eab586106
Create CloudMap private namespace and register services
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:46 +02:00
Nicolas De Loof 9a6fe86a86
Introduce "Validate" phase to check/make app ECS-compliant
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:45 +02:00
Nicolas De Loof 2544307f55
drop GetEcsTaskExecutionRole which is not in used anymore
We need to define a way for compose-user to declare additional Policies
to be added to TaskExecutionRole

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:45 +02:00
Nicolas De Loof 3e30f2cd1a
Create CloudWatch LogGroup and IAM TaskExecutionRole
As part of the CloudFormation template, create a LogGroup and configure
task with awslogs log-driver. Also create a dedicated IAM Role, with
AmazonECSTaskExecutionRolePolicy. This one will later be fine-tuned to
grant access to secrets/config and other AWS resources according to
custom extensions

close #42

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:45 +02:00
Nicolas De Loof 99b4ed0bfd
Capture first failure to report root error to user on command completion
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:44 +02:00
Nicolas De Loof a8e963a304
Query stack events by stack ID (not name)
This prevent a race condition on `down` as stack is deleted and we still
ask for stack events as we didn't recieved the DELETE_COMPLETE one

Use WaitUntilStack* to detect stack operation completion

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:44 +02:00
Nicolas De Loof f69ada632a
use faint for "in progress" to distingish completed/failed
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:43 +02:00
Nicolas De Loof 814259ae33
Also wait for deletion events
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:43 +02:00
Nicolas De Loof 5d61fc119a
Format stack events as a set of resources with progress status
This mimic how docker-compose report containers creation

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:43 +02:00
Nicolas De Loof 678f4018f0
Collect events while waiting for stack to complete
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:42 +02:00
aiordache 41aaf802e3
implement secret management
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:42 +02:00
aiordache 2ad9504d15
add secret interface
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:42 +02:00
Nicolas De Loof de365f41e9
Fix test by regenerating mock
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:41 +02:00
aiordache 4a6fec63d2
yet another rebase
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:41 +02:00
aiordache cec44fbb7b
move to sdk
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:41 +02:00
aiordache 95c88acfb4
Set existing vpc as default external network in the compose file
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:40 +02:00
aiordache 39a59ae55f
Deploy with user-defined vpc id
Signed-off-by: aiordache <anca.iordache@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:40 +02:00
Nicolas De Loof b6be4a0ac3
Use `WithContext` SDK APIs so we can implement cancelation
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:40 +02:00
Nicolas De Loof 4642bfa172
Fix linter warnings
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:39 +02:00
Nicolas De Loof 30029fa701
ComposeDown only require stack name
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>

g Sur la branche api

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:39 +02:00
Nicolas De Loof 541bda3af8
Remove ALB related options to be defined on phase 2
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:38 +02:00
Nicolas De Loof 096c800c1b
use go:generate to automatically run mockgen on build
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:38 +02:00
Guillaume Lours 95de770e87 Update or add license header which are not valid
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-08-17 16:55:25 +02:00
Ulysses Souza a2c2d6aa5d Add Restart Policy support when running single container 2020-08-04 16:57:58 +02:00
aiordache 87245ef727 rename packages ( amazon to ecs and azure to aci )
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-07-30 11:34:34 +02:00
Nicolas De Loof 4138dcfb5a Split API interface by required SDK func per command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-28 10:59:00 +02:00
Nicolas De Loof 3d8d982d4a format
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-28 10:59:00 +02:00
Nicolas De Loof 52c6177ff7 API mock and a test case relying on it
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-28 10:59:00 +02:00
Nicolas De Loof 8c0fee5abf Define amazon.API as a simplified and currated interface over AWS SDK
This makes code simpler to read and easier to mock within tests

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-28 10:59:00 +02:00
Nicolas De Loof 52440a4732 Setup Github Action for CI
close #1

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-28 10:50:27 +02:00
aiordache d612a4ab89 Project name parameter as alternative to compose file on down
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-04-27 09:21:58 +02:00
Nicolas De Loof f8bf0078aa Use DescribeCluster as ListCluster is a Paginated API
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-24 10:13:38 +02:00
Nicolas De Loof ea6d35a927 Fix minor issue after merge conflit resolution
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-23 16:19:47 +02:00
Nicolas De Loof a1c91ac4c2 Merge branch 'cluster-create' of github.com:aiordache/ecs-plugin into aiordache-cluster-create
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-23 14:55:41 +02:00
aiordache 3d7e062215 add delete-cluster flag on down cmd
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-04-23 14:50:18 +02:00
Nicolas De Loof 48096eeed8 DescribeStacks fail with error if stack does not exists
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-23 11:19:59 +02:00
aiordache 3c9905c474 tidy up go mod
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-04-23 09:45:50 +02:00
aiordache 55f2908c16 wait for stack removal on cluster delete
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-04-22 16:49:55 +02:00
Nicolas De Loof 5110cb6b85 Basic architecture documentation
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-22 15:39:02 +02:00
Nicolas De Loof 87f053d710 Detect stack already exists
This will later be used to switch to ChangeSet logic

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-22 15:37:39 +02:00
aiordache 30fd37b6ca ecs cluster create
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-04-22 15:06:01 +02:00
Nicolas De Loof 0972776e6d Ingress description to include service being exposed
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-21 14:48:51 +02:00
Nicolas De Loof b70f01d2f4 Adopt CloudFormation to create ECS app from compose.yaml
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-21 11:38:52 +02:00
Nicolas De Loof 4e72d1892a Prefer AWS API interface over actual implementation
This will help introduce mock-based tests

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-20 13:47:38 +02:00
Nicolas De Loof dd48cc4599 Introduct option to re-use LoadBalancer
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-16 16:18:06 +02:00
Nicolas De Loof a44ee2a4ed Expose services using a LoadBalancer
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-16 15:15:39 +02:00
Nicolas De Loof 17f3ff9db1 Convert services into TaskDefinition before creating resources
close #6

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-16 11:16:50 +02:00
Nicolas De Loof 7763de47eb Introduce "down" command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-16 10:07:28 +02:00
Nicolas De Loof fc7266f3f7 Convert compose service into TaskDefinition
(code imported from prototype)

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-15 10:38:19 +02:00
Nicolas De Loof 4542e05ddf API calls to register services matching compose.yaml
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-14 18:03:33 +02:00
Nicolas De Loof 91daf0dcc0 Skeletton for "compose up" command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-14 17:44:00 +02:00
Nicolas De Loof 40bf8c2dae Load a compose file and pass Project to cobra command
close #2

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-14 11:42:33 +02:00
Nicolas De Loof ba6c599de2 This is a CLI plugin
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-14 08:40:52 +02:00
Nicolas De Loof 1312eec077 Project skaffloding
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-04-10 16:10:52 +02:00