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

V1.26.0 stage #1917

Merged
merged 72 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
e36e2c8
Model changes for ACS for container ordering
ubhattacharjya Jan 28, 2019
5fbfab0
Adding adapter to have volumes/links use DependsOn field
ubhattacharjya Jan 30, 2019
5c3fa51
Refactor dependency graph code for volume/links dependency resolution
ubhattacharjya Feb 7, 2019
680db40
Merge branch 'dev' into container-ordering feature
ubhattacharjya Feb 15, 2019
4e818ef
Add log driver secret to LogConfig and agent capability
tommyhahn Feb 9, 2019
2cf4734
Merge pull request #1853 from ubhattacharjya/mergeBranch
ubhattacharjya Feb 16, 2019
79bd517
engine,dockerclient: per container start/stop timeouts
adnxn Feb 6, 2019
3265bf9
statemanager: add container start/stop statemanger
adnxn Feb 15, 2019
e325804
Merge pull request #1818 from tommyhahn/branch_logging_driver
tommyhahn Feb 18, 2019
f4da625
Merge pull request #1849 from adnxn/dev-granular-timeouts
adnxn Feb 19, 2019
0e8a379
readme: update config level container timeouts
adnxn Feb 19, 2019
9ab5eff
cleaned travis config format, and upgraded to go 1.11
yhlee-aws Feb 19, 2019
7b9b9fc
Replace mongo docker images with crux and redis
shubham2892 Feb 14, 2019
6dcd3e3
Add Dependency conditions of 'Complete', 'Success' and 'Healthy'
ubhattacharjya Feb 13, 2019
9708e51
Revert "Add log driver secret to LogConfig and agent capability" due …
tommyhahn Feb 20, 2019
4c57056
engine: adding poll function during progressTask
petderek Feb 22, 2019
3bc095b
Merge pull request #1876 from petderek/container-ordering-task-sync
petderek Feb 22, 2019
6f89b0e
dependencygraph: Enforce shutdown order
petderek Feb 18, 2019
fa040f4
functional tests: increase timeout on link/volume
petderek Feb 19, 2019
89bb2e8
dependencygraph: simplify container start logic
petderek Feb 21, 2019
582327c
Merge pull request #1866 from petderek/container-ordering-feature
petderek Feb 22, 2019
01dca6d
Remove the functionality of StartTimeout as Docker API Start Timeout
ubhattacharjya Feb 22, 2019
5bac35e
engine: add ordering integration tests
petderek Feb 22, 2019
af9e1f5
Merge pull request #1881 from petderek/container-ordering-integ-tests
petderek Feb 24, 2019
4ac84e4
Dependency Condition Naming change:
ubhattacharjya Feb 23, 2019
c698919
Validating that the dependency container has not timed out
ubhattacharjya Feb 22, 2019
7ba5947
Merge pull request #1882 from ubhattacharjya/Naming
ubhattacharjya Feb 24, 2019
83c928b
Merge pull request #1880 from ubhattacharjya/ChangeStartTimeout
ubhattacharjya Feb 24, 2019
c065ad3
tests: make windows test run a bit faster
petderek Feb 24, 2019
ee7a419
Merge pull request #1886 from petderek/fast-windows-test
petderek Feb 24, 2019
3c27ece
Checking dependency resolution after timeout and successful exit check
ubhattacharjya Feb 24, 2019
cd2b228
engine: adding timeouts to the other order tests
petderek Feb 24, 2019
314e658
Merge pull request #1884 from ubhattacharjya/bugFix
ubhattacharjya Feb 25, 2019
6ef7266
ACS model change
ubhattacharjya Feb 24, 2019
01b0505
Accomodate ACS model change
ubhattacharjya Feb 24, 2019
25f450c
Add app mesh support to agent.
suneyz Feb 20, 2019
774d936
Add amazon-vpc-cni-plugins into agent
suneyz Feb 4, 2019
ace346a
Add agent default endpoint IPs to appmesh egressIgnoredIPs.
suneyz Feb 26, 2019
0c0a2e8
tests: prefer cached images
petderek Feb 26, 2019
d986f36
Adding shutdown order test
petderek Feb 27, 2019
fc2d930
Merge pull request #1885 from ubhattacharjya/ACS
ubhattacharjya Feb 27, 2019
e34ceb7
Adding Integ Tests for Granular Stop Timeout
ubhattacharjya Feb 26, 2019
a3d87cb
Change task server endpoint to 127.0.0.1
suneyz Feb 24, 2019
bc3f30c
Fix Shutdown Order test
ubhattacharjya Feb 27, 2019
c3b8514
integ tests: allocate more cpu per container
petderek Feb 27, 2019
95de818
Merge pull request #1887 from ubhattacharjya/StopTimeoutTest
ubhattacharjya Feb 27, 2019
ea64925
Update amazon-vpc-cni-plugins to latest sha to include CGO_ENABLED bu…
suneyz Feb 27, 2019
4a67ab7
Merge branch 'container-ordering-feature' into dev
ubhattacharjya Feb 28, 2019
6e98779
update to 1.25.3
fierlion Feb 15, 2019
b36a2fa
functional tests: validator pull image update
petderek Feb 28, 2019
90793e4
Merge pull request #1904 from ubhattacharjya/MergeContOrder
petderek Feb 28, 2019
8529bd8
Merge pull request #1901 from suneyz/iam
petderek Feb 28, 2019
6d37bed
Merge pull request #1905 from petderek/fix-win-test
petderek Feb 28, 2019
b3629cc
Merge pull request #1898 from aws/app-mesh
petderek Feb 28, 2019
5848638
update nginx version
yumex93 Feb 28, 2019
08c9e1d
Merge pull request #1907 from yumex93/update_nginx
yumex93 Feb 28, 2019
8c80e71
Adding functional tests for container ordering
ubhattacharjya Feb 26, 2019
a6db7b8
functional tests: enable cpu unbounded
petderek Feb 28, 2019
a59e320
Adding functional tests for container ordering
ubhattacharjya Feb 26, 2019
94ecd6a
Merge branch 'master' into dev
fenxiong Feb 28, 2019
bb0c31a
Merge pull request #1908 from fenxiong/merge-dev
fenxiong Feb 28, 2019
243ddda
Fix error detection case when image that is being deleted does not exist
shubham2892 Feb 27, 2019
0393e12
Fix amazon-vpc-cni-plugins sha check.
suneyz Feb 28, 2019
f1f4453
Increase docker stop timeout to 5 seconds
ubhattacharjya Feb 28, 2019
f60b03c
increase linux integ tests timeout
yumex93 Feb 28, 2019
d73de56
Merge pull request #1911 from suneyz/dev
yumex93 Feb 28, 2019
e39f661
Merge pull request #1889 from ubhattacharjya/FunctionalTests
ubhattacharjya Feb 28, 2019
78d1921
update amazon-vpc-cni-plugins sha
suneyz Feb 28, 2019
7642368
Merge pull request #1913 from yumex93/dev
yumex93 Feb 28, 2019
e7af32a
Merge pull request #1914 from suneyz/dev
petderek Feb 28, 2019
9a351b8
Adjusting timeouts on a windows test
petderek Mar 1, 2019
ebac220
Update to 1.26.0
petderek Feb 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "amazon-ecs-cni-plugins"]
path = amazon-ecs-cni-plugins
url = https://github.com/aws/amazon-ecs-cni-plugins.git
[submodule "amazon-vpc-cni-plugins"]
path = amazon-vpc-cni-plugins
url = https://github.com/aws/amazon-vpc-cni-plugins.git
31 changes: 14 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
language: go
go_import_path: github.com/aws/amazon-ecs-agent
sudo: false
go:
- 1.9
os:
- windows
- linux
go_import_path: github.com/aws/amazon-ecs-agent
script:
- |
(
if [ "$TRAVIS_OS_NAME" = 'windows' ]; then
go test -race -tags unit -timeout 40s ./agent/...
else
make get-deps
make test
make static-check
make xplatform-build
fi
)
- 1.11

matrix:
include:
- os: linux
script:
- make get-deps
- make test
- make static-check
- make xplatform-build
- os: windows
script:
- go test -v -race -tags unit -timeout 40s ./agent/...
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 1.26.0
* Feature - Startup order can now be explicitly set via DependsOn field in the Task Definition [#1904](https://github.com/aws/amazon-ecs-agent/pull/1904)
* Feature - Containers in a task can now have individual start and stop timeouts [#1904](https://github.com/aws/amazon-ecs-agent/pull/1904)
* Feature - AWS App Mesh CNI plugin support [#1898](https://github.com/aws/amazon-ecs-agent/pull/1898)
* Enhancement - Containers with links and volumes defined will now shutdown in the correct order [#1904](https://github.com/aws/amazon-ecs-agent/pull/1904)
* Bug - Image cleanup errors fixed [#1897](https://github.com/aws/amazon-ecs-agent/pull/1897)

## 1.25.3
* Bug - Fixed a bug where agent no longer redirected malformed credentials or metadata http requests [#1844](https://github.com/aws/amazon-ecs-agent/pull/1844)
* Bug - Populate v3 metadata networks response for non-awsvpc tasks [#1833](https://github.com/aws/amazon-ecs-agent/pull/1833)
Expand Down
30 changes: 23 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ gobuild:

# create output directories
.out-stamp:
mkdir -p ./out/test-artifacts ./out/cni-plugins
mkdir -p ./out/test-artifacts ./out/cni-plugins ./out/amazon-ecs-cni-plugins ./out/amazon-vpc-cni-plugins
touch .out-stamp

# Basic go build
Expand Down Expand Up @@ -237,27 +237,43 @@ ECS_CNI_REPOSITORY_REVISION=master

# Variable to override cni repository location
ECS_CNI_REPOSITORY_SRC_DIR=$(PWD)/amazon-ecs-cni-plugins
VPC_CNI_REPOSITORY_SRC_DIR=$(PWD)/amazon-vpc-cni-plugins

get-cni-sources:
git submodule update --init --checkout
git submodule update --init --recursive --remote

cni-plugins: get-cni-sources .out-stamp
@docker build -f scripts/dockerfiles/Dockerfile.buildCNIPlugins -t "amazon/amazon-ecs-build-cniplugins:make" .
build-ecs-cni-plugins:
@docker build -f scripts/dockerfiles/Dockerfile.buildECSCNIPlugins -t "amazon/amazon-ecs-build-ecs-cni-plugins:make" .
docker run --rm --net=none \
-e GIT_SHORT_HASH=$(shell cd $(ECS_CNI_REPOSITORY_SRC_DIR) && git rev-parse --short=8 HEAD) \
-e GIT_PORCELAIN=$(shell cd $(ECS_CNI_REPOSITORY_SRC_DIR) && git status --porcelain 2> /dev/null | wc -l | sed 's/^ *//') \
-u "$(USERID)" \
-v "$(PWD)/out/cni-plugins:/go/src/github.com/aws/amazon-ecs-cni-plugins/bin/plugins" \
-v "$(PWD)/out/amazon-ecs-cni-plugins:/go/src/github.com/aws/amazon-ecs-cni-plugins/bin/plugins" \
-v "$(ECS_CNI_REPOSITORY_SRC_DIR):/go/src/github.com/aws/amazon-ecs-cni-plugins" \
"amazon/amazon-ecs-build-cniplugins:make"
"amazon/amazon-ecs-build-ecs-cni-plugins:make"
@echo "Built amazon-ecs-cni-plugins successfully."

build-vpc-cni-plugins:
@docker build -f scripts/dockerfiles/Dockerfile.buildVPCCNIPlugins -t "amazon/amazon-ecs-build-vpc-cni-plugins:make" .
docker run --rm --net=none \
-e GIT_SHORT_HASH=$(shell cd $(VPC_CNI_REPOSITORY_SRC_DIR) && git rev-parse --short=8 HEAD) \
-u "$(USERID)" \
-v "$(PWD)/out/amazon-vpc-cni-plugins:/go/src/github.com/aws/amazon-vpc-cni-plugins/build/linux_amd64" \
-v "$(VPC_CNI_REPOSITORY_SRC_DIR):/go/src/github.com/aws/amazon-vpc-cni-plugins" \
"amazon/amazon-ecs-build-vpc-cni-plugins:make"
@echo "Built amazon-vpc-cni-plugins successfully."

cni-plugins: get-cni-sources .out-stamp build-ecs-cni-plugins build-vpc-cni-plugins
mv $(PWD)/out/amazon-ecs-cni-plugins/* $(PWD)/out/cni-plugins
mv $(PWD)/out/amazon-vpc-cni-plugins/* $(PWD)/out/cni-plugins
@echo "Built all cni plugins successfully."

ifeq (${BUILD_PLATFORM},aarch64)
run-integ-tests: test-registry gremlin container-health-check-image run-sudo-tests
. ./scripts/shared_env && go test -tags integration -timeout=20m -v ./agent/engine/... ./agent/stats/... ./agent/app/...
else
run-integ-tests: test-registry gremlin container-health-check-image run-sudo-tests
. ./scripts/shared_env && go test -race -tags integration -timeout=12m -v ./agent/engine/... ./agent/stats/... ./agent/app/...
. ./scripts/shared_env && go test -race -tags integration -timeout=20m -v ./agent/engine/... ./agent/stats/... ./agent/app/...
endif

ifeq (${BUILD_PLATFORM},aarch64)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
![Amazon ECS logo](doc/ecs.png "Amazon ECS")

[![Build Status](https://travis-ci.org/aws/amazon-ecs-agent.svg?branch=master)](https://travis-ci.org/aws/amazon-ecs-agent)
[![Build status](https://ci.appveyor.com/api/projects/status/upkhbwf2oc0srglt?svg=true)](https://ci.appveyor.com/project/AmazonECS/amazon-ecs-agent)


The Amazon ECS Container Agent is a component of Amazon Elastic Container Service
Expand Down Expand Up @@ -148,7 +147,7 @@ additional details on each available environment variable.
| `ECS_SELINUX_CAPABLE` | `true` | Whether SELinux is available on the container instance. | `false` | `false` |
| `ECS_APPARMOR_CAPABLE` | `true` | Whether AppArmor is available on the container instance. | `false` | `false` |
| `ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION` | 10m | Time to wait to delete containers for a stopped task. If set to less than 1 minute, the value is ignored. | 3h | 3h |
| `ECS_CONTAINER_STOP_TIMEOUT` | 10m | Time to wait for the container to exit normally before being forcibly killed. | 30s | 30s |
| `ECS_CONTAINER_STOP_TIMEOUT` | 10m | Instance scoped configuration for time to wait for the container to exit normally before being forcibly killed. | 30s | 30s |
| `ECS_CONTAINER_START_TIMEOUT` | 10m | Timeout before giving up on starting a container. | 3m | 8m |
| `ECS_ENABLE_TASK_IAM_ROLE` | `true` | Whether to enable IAM Roles for Tasks on the Container Instance | `false` | `false` |
| `ECS_ENABLE_TASK_IAM_ROLE_NETWORK_HOST` | `true` | Whether to enable IAM Roles for Tasks when launched with `host` network mode on the Container Instance | `false` | `false` |
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.25.3
1.26.0
11 changes: 11 additions & 0 deletions agent/acs/handler/payload_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

"github.com/aws/amazon-ecs-agent/agent/acs/model/ecsacs"
"github.com/aws/amazon-ecs-agent/agent/api"
apiappmesh "github.com/aws/amazon-ecs-agent/agent/api/appmesh"
apieni "github.com/aws/amazon-ecs-agent/agent/api/eni"
apitask "github.com/aws/amazon-ecs-agent/agent/api/task"
apitaskstatus "github.com/aws/amazon-ecs-agent/agent/api/task/status"
Expand Down Expand Up @@ -222,6 +223,16 @@ func (payloadHandler *payloadRequestHandler) addPayloadTasks(payload *ecsacs.Pay

apiTask.SetTaskENI(eni)
}
// Add the app mesh information to task struct
if task.ProxyConfiguration != nil {
appmesh, err := apiappmesh.AppMeshFromACS(task.ProxyConfiguration)
if err != nil {
payloadHandler.handleUnrecognizedTask(task, err, payload)
allTasksOK = false
continue
}
apiTask.SetAppMesh(appmesh)
}
if task.ExecutionRoleCredentials != nil {
// The payload message contains execution credentials for the task.
// Add the credentials to the credentials manager and set the
Expand Down
72 changes: 72 additions & 0 deletions agent/acs/handler/payload_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,78 @@ func TestPayloadHandlerAddedENIToTask(t *testing.T) {
assert.Equal(t, aws.StringValue(expectedENI.Ipv6Addresses[0].Address), taskeni.IPV6Addresses[0].Address)
}

func TestPayloadHandlerAddedAppMeshToTask(t *testing.T) {
appMeshType := "APPMESH"
mockEgressIgnoredIP1 := "128.0.0.1"
mockEgressIgnoredIP2 := "171.1.3.24"
mockAppPort1 := "8000"
mockAppPort2 := "8001"
mockEgressIgnoredPort1 := "13000"
mockEgressIgnoredPort2 := "13001"
mockIgnoredUID := "1337"
mockIgnoredGID := "2339"
mockProxyIngressPort := "9000"
mockProxyEgressPort := "9001"
mockAppPorts := mockAppPort1 + "," + mockAppPort2
mockEgressIgnoredIPs := mockEgressIgnoredIP1 + "," + mockEgressIgnoredIP2
mockEgressIgnoredPorts := mockEgressIgnoredPort1 + "," + mockEgressIgnoredPort2
mockContainerName := "testEnvoyContainer"
taskMetadataEndpointIP := "169.254.170.2"
instanceMetadataEndpointIP := "169.254.169.254"
tester := setup(t)
defer tester.ctrl.Finish()

var addedTask *apitask.Task
tester.mockTaskEngine.EXPECT().AddTask(gomock.Any()).Do(
func(task *apitask.Task) {
addedTask = task
})

payloadMessage := &ecsacs.PayloadMessage{
Tasks: []*ecsacs.Task{
{
Arn: aws.String("arn"),
ProxyConfiguration: &ecsacs.ProxyConfiguration{
Type: aws.String(appMeshType),
Properties: map[string]*string{
"IgnoredUID": aws.String(mockIgnoredUID),
"IgnoredGID": aws.String(mockIgnoredGID),
"ProxyIngressPort": aws.String(mockProxyIngressPort),
"ProxyEgressPort": aws.String(mockProxyEgressPort),
"AppPorts": aws.String(mockAppPorts),
"EgressIgnoredIPs": aws.String(mockEgressIgnoredIPs),
"EgressIgnoredPorts": aws.String(mockEgressIgnoredPorts),
},
ContainerName: aws.String(mockContainerName),
},
},
},
MessageId: aws.String(payloadMessageId),
}

err := tester.payloadHandler.handleSingleMessage(payloadMessage)
assert.NoError(t, err)

// Validate the added task has the eni information as expected
appMesh := addedTask.GetAppMesh()
assert.NotNil(t, appMesh)
assert.Equal(t, mockIgnoredUID, appMesh.IgnoredUID)
assert.Equal(t, mockIgnoredGID, appMesh.IgnoredGID)
assert.Equal(t, mockProxyIngressPort, appMesh.ProxyIngressPort)
assert.Equal(t, mockProxyEgressPort, appMesh.ProxyEgressPort)
assert.Equal(t, 2, len(appMesh.AppPorts))
assert.Equal(t, mockAppPort1, appMesh.AppPorts[0])
assert.Equal(t, mockAppPort2, appMesh.AppPorts[1])
assert.Equal(t, 4, len(appMesh.EgressIgnoredIPs))
assert.Equal(t, mockEgressIgnoredIP1, appMesh.EgressIgnoredIPs[0])
assert.Equal(t, mockEgressIgnoredIP2, appMesh.EgressIgnoredIPs[1])
assert.Equal(t, taskMetadataEndpointIP, appMesh.EgressIgnoredIPs[2])
assert.Equal(t, instanceMetadataEndpointIP, appMesh.EgressIgnoredIPs[3])
assert.Equal(t, 2, len(appMesh.EgressIgnoredPorts))
assert.Equal(t, mockEgressIgnoredPort1, appMesh.EgressIgnoredPorts[0])
assert.Equal(t, mockEgressIgnoredPort2, appMesh.EgressIgnoredPorts[1])
}

func TestPayloadHandlerAddedECRAuthData(t *testing.T) {
tester := setup(t)
defer tester.ctrl.Finish()
Expand Down
49 changes: 42 additions & 7 deletions agent/acs/model/api/api-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
"AssociationType":{
"type":"string",
"enum":[
"gpu",
"elastic-inference"
"elastic-inference",
"gpu"
]
},
"Associations":{
Expand Down Expand Up @@ -203,7 +203,30 @@
"healthCheckType":{"shape":"HealthCheckType"},
"registryAuthentication":{"shape":"RegistryAuthenticationData"},
"logsAuthStrategy":{"shape":"AuthStrategy"},
"secrets":{"shape":"SecretList"}
"secrets":{"shape":"SecretList"},
"dependsOn":{"shape":"ContainerDependencies"},
"startTimeout":{"shape":"Integer"},
"stopTimeout":{"shape":"Integer"}
}
},
"ContainerCondition":{
"type":"string",
"enum":[
"START",
"COMPLETE",
"SUCCESS",
"HEALTHY"
]
},
"ContainerDependencies":{
"type":"list",
"member":{"shape":"ContainerDependency"}
},
"ContainerDependency":{
"type":"structure",
"members":{
"containerName":{"shape":"String"},
"condition":{"shape":"ContainerCondition"}
}
},
"ContainerList":{
Expand Down Expand Up @@ -432,6 +455,18 @@
"type":"list",
"member":{"shape":"PortMapping"}
},
"ProxyConfiguration":{
"type":"structure",
"members":{
"type":{"shape":"ProxyConfigurationType"},
"containerName":{"shape":"String"},
"properties":{"shape":"StringMap"}
}
},
"ProxyConfigurationType":{
"type":"string",
"enum":["APPMESH"]
},
"RegistryAuthenticationData":{
"type":"structure",
"members":{
Expand Down Expand Up @@ -479,8 +514,7 @@
"SecretType":{
"type":"string",
"enum":[
"ENVIRONMENT_VARIABLE",
"MOUNT_POINT"
"ENVIRONMENT_VARIABLE"
]
},
"SensitiveString":{
Expand Down Expand Up @@ -531,7 +565,8 @@
"memory":{"shape":"Integer"},
"associations":{"shape":"Associations"},
"pidMode":{"shape":"String"},
"ipcMode":{"shape":"String"}
"ipcMode":{"shape":"String"},
"proxyConfiguration":{"shape":"ProxyConfiguration"}
}
},
"TaskList":{
Expand Down Expand Up @@ -592,4 +627,4 @@
]
}
}
}
}
Loading