Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.

Commit 8f21c8b

Browse files
committed
Update to support Agent 1.2.0 with Telemetry
1 parent 74adf47 commit 8f21c8b

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

ecs-init/config/common.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func AgentTarball() string {
7070

7171
// AgentRemoteTarball is the remote location of the Agent image, used for populating the cache
7272
func AgentRemoteTarball() string {
73-
return "https://s3.amazonaws.com/" + s3Bucket + "/ecs-agent-v1.1.0.tar"
73+
return "https://s3.amazonaws.com/" + s3Bucket + "/ecs-agent-v1.2.0.tar"
7474
}
7575

7676
// AgentRemoteTarballMD5 is the remote location of a md5sum used to verify the integrity of the AgentRemoteTarball
@@ -82,3 +82,11 @@ func AgentRemoteTarballMD5() string {
8282
func DesiredImageLocatorFile() string {
8383
return CacheDirectory() + "/desired-image"
8484
}
85+
86+
func CgroupDirectory() string {
87+
return "/cgroup"
88+
}
89+
90+
func ExecDriverDirectory() string {
91+
return "/var/run/docker/execdriver"
92+
}

ecs-init/docker/docker.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const (
2727
agentIntrospectionPort = "51678"
2828
logDir = "/log"
2929
dataDir = "/data"
30+
execDriverDir = "/var/lib/docker/execdriver"
31+
readOnly = ":ro"
3032
)
3133

3234
// Client enables business logic for running the Agent inside Docker
@@ -164,6 +166,8 @@ func (c *Client) getHostConfig() *godocker.HostConfig {
164166
config.AgentDataDirectory() + ":" + dataDir,
165167
config.AgentConfigDirectory() + ":" + config.AgentConfigDirectory(),
166168
config.CacheDirectory() + ":" + config.CacheDirectory(),
169+
config.CgroupDirectory() + ":" + config.CgroupDirectory() + readOnly,
170+
config.ExecDriverDirectory() + ":" + execDriverDir + readOnly,
167171
}
168172
portBindings := map[godocker.Port][]godocker.PortBinding{
169173
agentIntrospectionPort + "/tcp": []godocker.PortBinding{

ecs-init/docker/docker_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ func validateCommonCreateContainerOptions(opts godocker.CreateContainerOptions,
236236

237237
hostCfg := opts.HostConfig
238238

239-
if len(hostCfg.Binds) != 5 {
240-
t.Errorf("Expected exactly 5 elements to be in Binds, but was %d", len(hostCfg.Binds))
239+
if len(hostCfg.Binds) != 7 {
240+
t.Errorf("Expected exactly 7 elements to be in Binds, but was %d", len(hostCfg.Binds))
241241
}
242242
binds := make(map[string]struct{})
243243
for _, binding := range hostCfg.Binds {
@@ -248,6 +248,8 @@ func validateCommonCreateContainerOptions(opts godocker.CreateContainerOptions,
248248
expectKey(config.AgentDataDirectory()+":/data", binds, t)
249249
expectKey(config.AgentConfigDirectory()+":"+config.AgentConfigDirectory(), binds, t)
250250
expectKey(config.CacheDirectory()+":"+config.CacheDirectory(), binds, t)
251+
expectKey(config.CgroupDirectory()+":"+config.CgroupDirectory()+":ro", binds, t)
252+
expectKey(config.ExecDriverDirectory()+":/var/lib/docker/execdriver:ro", binds, t)
251253

252254
if len(hostCfg.PortBindings) != 1 {
253255
t.Errorf("Expected exactly 1 element to be in PortBindings, but was %d", len(hostCfg.PortBindings))

packaging/amazon-linux-ami/ecs-init.spec

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
Name: ecs-init
16-
Version: 1.0
17-
Release: 5%{?dist}
16+
Version: 1.2.0
17+
Release: 1%{?dist}
1818
Group: System Environment/Base
1919
Vendor: Amazon.com
2020
License: Apache 2.0
@@ -27,9 +27,9 @@ Source1: ecs.conf
2727

2828
BuildRequires: golang
2929

30-
Requires: docker > 1.5.0, docker <= 1.6.2
30+
Requires: docker >= 1.6.0, docker <= 1.6.2
3131
Requires: upstart
32-
Requires(post): docker > 1.5.0
32+
Requires(post): docker >= 1.6.0
3333

3434
%global init_dir %{_sysconfdir}/init
3535
%global bin_dir %{_libexecdir}
@@ -132,6 +132,10 @@ if [ -e %{running_semaphore} ]; then
132132
fi
133133

134134
%changelog
135+
* Tue Jun 6 2015 Samuel Karp <skarp@amazon.com> - 1.2.0-1
136+
- Update versioning scheme to match Agent version
137+
- Cache Agent version 1.2.0
138+
- Mount cgroup and execdriver directories for Telemetry feature
135139
* Mon Jun 1 2015 Samuel Karp <skarp@amazon.com> - 1.0-5
136140
- Add support for Docker 1.6.2
137141
* Mon May 11 2015 Samuel Karp <skarp@amazon.com> - 1.0-4

0 commit comments

Comments
 (0)