Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'dev' into moby
Browse files Browse the repository at this point in the history
  • Loading branch information
yhlee-aws committed Oct 10, 2018
2 parents acb23b3 + d888811 commit 3df2358
Show file tree
Hide file tree
Showing 108 changed files with 8,528 additions and 1,754 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -19,4 +19,5 @@ _bin/
/.idea/
/misc/agent-introspection-validator/agent-introspection-validator
/misc/taskmetadata-validator/taskmetadata-validator
/misc/v3-task-endpoint-validator/v3-task-endpoint-validator
/bin
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,4 +1,12 @@
# Changelog
## 1.21.0-dev
* Feature - Add v3 task metadata support for awsvpc, host and bridge network mode

## 1.20.4
* Bug - Fixed a bug where Windows drive volume couldn't be mounted [#1571](https://github.com/aws/amazon-ecs-agent/pull/1571)
* Bug - Fixed a bug where the Agent's Windows binaries didn't use consistent naming [#1573](https://github.com/aws/amazon-ecs-agent/pull/1573)
* Bug - Fixed a bug where a port used by WinRM service was not reserved by the Agent by default [#1577](https://github.com/aws/amazon-ecs-agent/pull/1577)

## 1.20.3
* Enhancement - Deprecate support for serial docker image pull [#1569](https://github.com/aws/amazon-ecs-agent/pull/1569)
* Enhancement - Update the `amazon-ecs-cni-plugins` to `2018.08.0`
Expand Down
818 changes: 202 additions & 616 deletions LICENSE

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions Makefile
Expand Up @@ -172,7 +172,7 @@ test-artifacts-linux: $(LINUX_ARTIFACTS_TARGETS)
test-artifacts: test-artifacts-windows test-artifacts-linux

# Run our 'test' registry needed for integ and functional tests
test-registry: netkitten volumes-test squid awscli image-cleanup-test-images fluentd agent-introspection-validator taskmetadata-validator
test-registry: netkitten volumes-test squid awscli image-cleanup-test-images fluentd agent-introspection-validator taskmetadata-validator v3-task-endpoint-validator
@./scripts/setup-test-registry

test-in-docker:
Expand Down Expand Up @@ -242,7 +242,7 @@ volumes-test:

# TODO, replace this with a build on dockerhub or a mechanism for the
# functional tests themselves to build this
.PHONY: squid awscli fluentd gremlin agent-introspection-validator taskmetadata-validator image-cleanup-test-images ecr-execution-role-image container-health-check-image telemetry-test-image
.PHONY: squid awscli fluentd gremlin agent-introspection-validator taskmetadata-validator v3-task-endpoint-validator image-cleanup-test-images ecr-execution-role-image container-health-check-image telemetry-test-image
squid:
$(MAKE) -C misc/squid $(MFLAGS)

Expand All @@ -267,6 +267,9 @@ agent-introspection-validator:
taskmetadata-validator:
$(MAKE) -C misc/taskmetadata-validator $(MFLAGS)

v3-task-endpoint-validator:
$(MAKE) -C misc/v3-task-endpoint-validator $(MFLAGS)

ecr-execution-role-image:
$(MAKE) -C misc/ecr $(MFLAGS)

Expand Down Expand Up @@ -303,7 +306,7 @@ ifeq (${PLATFORM},Linux)
dep_arch=darwin-386
endif

DEP_VERSION=v0.4.1
DEP_VERSION=v0.5.0
.PHONY: get-dep
get-dep: bin/dep

Expand All @@ -326,6 +329,7 @@ clean:
-$(MAKE) -C misc/image-cleanup-test-images $(MFLAGS) clean
-$(MAKE) -C misc/agent-introspection-validator $(MFLAGS) clean
-$(MAKE) -C misc/taskmetadata-validator $(MFLAGS) clean
-$(MAKE) -C misc/v3-task-endpoint-validator $(MFLAGS) clean
-$(MAKE) -C misc/container-health $(MFLAGS) clean
-$(MAKE) -C misc/telemetry $(MFLAGS) clean
-rm -f .get-deps-stamp
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
@@ -1,5 +1,5 @@
Amazon Elastic Container Service Agent
Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright 2014-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.


**********************
Expand Down
75 changes: 11 additions & 64 deletions README.md
Expand Up @@ -53,78 +53,25 @@ $ docker run --name ecs-agent \

See also the Advanced Usage section below.

### On Windows Server 2016
### On the ECS Optimized Windows AMI

On Windows Server 2016, the Amazon ECS Container Agent runs as a process or service on the host. Unlike Linux,
the agent may not run inside a container as it uses the host's registry and the named pipe at `\\.\pipe\docker_engine`
to communicate with the Docker daemon.

#### As a Service
To install the service, you can do the following:
ECS Optimized Windows AMI ships with a pre-installed PowerShell module called ECSTools to install, configure, and run the ECS Agent as a Windows service.
To install the service, you can run the following PowerShell commands on an EC2 instance. To launch into another cluster instead of windows, replace the 'windows' in the script below with the name of your cluster.

```powershell
PS C:\> # Set up directories the agent uses
PS C:\> New-Item -Type directory -Path ${env:ProgramFiles}\Amazon\ECS -Force
PS C:\> New-Item -Type directory -Path ${env:ProgramData}\Amazon\ECS -Force
PS C:\> New-Item -Type directory -Path ${env:ProgramData}\Amazon\ECS\data -Force
PS C:\> # Set up configuration
PS C:\> $ecsExeDir = "${env:ProgramFiles}\Amazon\ECS"
PS C:\> [Environment]::SetEnvironmentVariable("ECS_CLUSTER", "my-windows-cluster", "Machine")
PS C:\> [Environment]::SetEnvironmentVariable("ECS_LOGFILE", "${env:ProgramData}\Amazon\ECS\log\ecs-agent.log", "Machine")
PS C:\> [Environment]::SetEnvironmentVariable("ECS_DATADIR", "${env:ProgramData}\Amazon\ECS\data", "Machine")
PS C:\> # Download the agent
PS C:\> $agentVersion = "latest"
PS C:\> $agentZipUri = "https://s3.amazonaws.com/amazon-ecs-agent/ecs-agent-windows-$agentVersion.zip"
PS C:\> $zipFile = "${env:TEMP}\ecs-agent.zip"
PS C:\> Invoke-RestMethod -OutFile $zipFile -Uri $agentZipUri
PS C:\> # Put the executables in the executable directory.
PS C:\> Expand-Archive -Path $zipFile -DestinationPath $ecsExeDir -Force
PS C:\> Set-Location ${ecsExeDir}
PS C:\> # Set $EnableTaskIAMRoles to $true to enable task IAM roles
PS C:\> # Note that enabling IAM roles will make port 80 unavailable for tasks.
PS C:\> [bool]$EnableTaskIAMRoles = $false
PS C:\> if (${EnableTaskIAMRoles}) {
>> .\hostsetup.ps1
>> }
PS C:\> # Install the agent service
PS C:\> New-Service -Name "AmazonECS" `
-BinaryPathName "$ecsExeDir\amazon-ecs-agent.exe -windows-service" `
-DisplayName "Amazon ECS" `
-Description "Amazon ECS service runs the Amazon ECS agent" `
-DependsOn Docker `
-StartupType Manual
PS C:\> sc.exe failure AmazonECS reset=300 actions=restart/5000/restart/30000/restart/60000
PS C:\> sc.exe failureflag AmazonECS 1
PS C:\> Import-Module ECSTools
PS C:\> # The -EnableTaskIAMRole option is required to enable IAM roles for tasks.
PS C:\> Initialize-ECSAgent -Cluster 'windows' -EnableTaskIAMRole
```

To run the service, you can do the following:
```powershell
Start-Service AmazonECS
```
#### Downloading Different Version of ECS Agent

#### As a Process
To download different version of ECS Agent, you can do the following:

```powershell
PS C:\> # Set up directories the agent uses
PS C:\> New-Item -Type directory -Path ${env:ProgramFiles}\Amazon\ECS -Force
PS C:\> New-Item -Type directory -Path ${env:ProgramData}\Amazon\ECS -Force
PS C:\> New-Item -Type directory -Path ${env:ProgramData}\Amazon\ECS\data -Force
PS C:\> # Set up configuration
PS C:\> $ecsExeDir = "${env:ProgramFiles}\Amazon\ECS"
PS C:\> [Environment]::SetEnvironmentVariable("ECS_CLUSTER", "my-windows-cluster", "Machine")
PS C:\> [Environment]::SetEnvironmentVariable("ECS_LOGFILE", "${env:ProgramData}\Amazon\ECS\log\ecs-agent.log", "Machine")
PS C:\> [Environment]::SetEnvironmentVariable("ECS_DATADIR", "${env:ProgramData}\Amazon\ECS\data", "Machine")
PS C:\> # Set this environment variable to "true" to enable IAM roles. Note that enabling IAM roles will make port 80 unavailable for tasks.
PS C:\> [Environment]::SetEnvironmentVariable("ECS_ENABLE_TASK_IAM_ROLE", "false", "Machine")
PS C:\> # Download the agent
PS C:\> $agentVersion = "latest"
PS C:\> $agentZipUri = "https://s3.amazonaws.com/amazon-ecs-agent/ecs-agent-windows-$agentVersion.zip"
PS C:\> $zipFile = "${env:TEMP}\ecs-agent.zip"
PS C:\> Invoke-RestMethod -OutFile $zipFile -Uri $agentZipUri
PS C:\> # Put the executables in the executable directory.
PS C:\> Expand-Archive -Path $zipFile -DestinationPath $ecsExeDir -Force
PS C:\> # Run the agent
PS C:\> cd '$ecsExeDir'; .\amazon-ecs-agent.ps1
PS C:\> # use agentVersion = "latest" for the latest available agent version
PS C:\> $agentVersion = "v1.20.4"
PS C:\> Initialize-ECSAgent -Cluster 'windows' -EnableTaskIAMRole -Version $agentVersion
```

## Advanced Usage
Expand Down

0 comments on commit 3df2358

Please sign in to comment.