Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ _bin/
*.swp
*.orig
/agent/version/_version.go
/ecs-init/version/version.go
.agignore
*.sublime-*
.DS_Store
Expand Down
47 changes: 39 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,19 @@ cni-plugins: get-cni-sources .out-stamp build-ecs-cni-plugins build-vpc-cni-plug
# dockerfree build process will build the agent container image from scratch
# and with minimal dependencies
# requires glibc-static

# dockerfree-pause works for both amd64 and arm64
dockerfree-pause:
GOOS=linux GOARCH=amd64 ./scripts/build-pause
./scripts/build-pause

# dockerfree-certs works for both amd64 and arm64
dockerfree-certs:
GOOS=linux GOARCH=amd64 ./scripts/get-host-certs
./scripts/get-host-certs

dockerfree-cni-plugins: get-cni-sources
GOOS=linux GOARCH=amd64 ./scripts/build-cni-plugins
./scripts/build-cni-plugins

dockerfree-agent-image: dockerfree-pause dockerfree-certs dockerfree-cni-plugins static-with-pause
GOOS=linux GOARCH=amd64 ./scripts/build-agent-image
./scripts/build-agent-image

.PHONY: codebuild
codebuild: .out-stamp
Expand Down Expand Up @@ -356,6 +357,36 @@ get-deps-init:
go get golang.org/x/tools/cmd/goimports
go get honnef.co/go/tools/cmd/staticcheck

.amazon-linux-rpm-integrated-done:
./scripts/update-version.sh
cp packaging/amazon-linux-ami-integrated/ecs-init.spec ecs-init.spec
cp packaging/amazon-linux-ami-integrated/ecs.conf ecs.conf
cp packaging/amazon-linux-ami-integrated/ecs.service ecs.service
cp packaging/amazon-linux-ami-integrated/amazon-ecs-volume-plugin.conf amazon-ecs-volume-plugin.conf
cp packaging/amazon-linux-ami-integrated/amazon-ecs-volume-plugin.service amazon-ecs-volume-plugin.service
cp packaging/amazon-linux-ami-integrated/amazon-ecs-volume-plugin.socket amazon-ecs-volume-plugin.socket
tar -czf ./sources.tgz ecs-init scripts misc agent amazon-ecs-cni-plugins amazon-vpc-cni-plugins agent-container VERSION
test -e SOURCES || ln -s . SOURCES
rpmbuild --define "%_topdir $(PWD)" -bb ecs-init.spec
find RPMS/ -type f -exec cp {} . \;
touch .amazon-linux-rpm-integrated-done

amazon-linux-rpm-integrated: .amazon-linux-rpm-integrated-done

.generic-rpm-integrated-done:
./scripts/update-version.sh
cp packaging/generic-rpm-integrated/amazon-ecs-init.spec amazon-ecs-init.spec
cp packaging/generic-rpm-integrated/ecs.service ecs.service
cp packaging/generic-rpm-integrated/amazon-ecs-volume-plugin.service amazon-ecs-volume-plugin.service
cp packaging/generic-rpm-integrated/amazon-ecs-volume-plugin.socket amazon-ecs-volume-plugin.socket
tar -czf ./sources.tgz ecs-init scripts misc agent amazon-ecs-cni-plugins amazon-vpc-cni-plugins agent-container VERSION
test -e SOURCES || ln -s . SOURCES
rpmbuild --define "%_topdir $(PWD)" -bb amazon-ecs-init.spec
find RPMS/ -type f -exec cp {} . \;
touch .generic-rpm-integrated-done

generic-rpm-integrated: .generic-rpm-integrated-done

.generic-rpm-done:
./scripts/update-version.sh
cp packaging/generic-rpm/amazon-ecs-init.spec amazon-ecs-init.spec
Expand All @@ -366,12 +397,10 @@ get-deps-init:
test -e SOURCES || ln -s . SOURCES
rpmbuild --define "%_topdir $(PWD)" -bb amazon-ecs-init.spec
find RPMS/ -type f -exec cp {} . \;
touch .rpm-done
touch .generic-rpm-done

generic-rpm: .generic-rpm-done

dockerfree-all: dockerfree-agent-image generic-rpm

.deb-done: BUILDROOT/ecs-agent.tar
./scripts/update-version.sh
tar -czf ./amazon-ecs-init_${VERSION}.orig.tar.gz ecs-init scripts README.md
Expand Down Expand Up @@ -428,4 +457,6 @@ clean:
-rm -f ./amazon-ecs-init_${VERSION}*
-rm -f .srpm-done .rpm-done .generic-rpm-done
-rm -f .deb-done
-rm -f .amazon-linux-rpm-integrated-done
-rm -f .generic-rpm-integrated-done
-rm -f amazon-ecs-volume-plugin
2 changes: 1 addition & 1 deletion agent-container/agent-config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"author":"Amazon Web Services, Inc.","config":{"Cmd":["/agent"],"ArgsEscaped":true},"created":"~~timestamp~~","history":[{"created":"~~timestamp~~","author":"Amazon Web Services, Inc.","created_by":"[] + [] === \"\"","empty_layer":true}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:~~digest~~"]}}
{"author":"Amazon Web Services, Inc.","config":{"Cmd":["/agent"],"ArgsEscaped":true},"created":"~~timestamp~~","history":[{"created":"~~timestamp~~","author":"Amazon Web Services, Inc.","created_by":"°o°","empty_layer":true}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:~~digest~~"]}}
3 changes: 1 addition & 2 deletions agent-container/agent-manifest.json
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
[{"Config":"config.json","RepoTags":["amazon/amazon-ecs-agent:~~agentversion~~"],"Layers":["rootfs/layer.tar"]}]

[{"Config":"config.json","RepoTags":["amazon/amazon-ecs-agent:latest"],"Layers":["rootfs/layer.tar"]}]
1 change: 1 addition & 0 deletions agent/acs/client/acs_client_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/acs/client/acs_error_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/acs/handler/acs_handler_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/acs/handler/attach_eni_handler_common_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/acs/handler/attach_instance_eni_handler_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/acs/handler/attach_task_eni_handler_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/acs/handler/heartbeat_handler_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/acs/handler/payload_handler_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/acs/handler/refresh_credentials_handler_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/acs/handler/task_manifest_handler_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/acs/update_handler/updater_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/appmesh/appmesh_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/container_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/container_unix.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build !windows
// +build !windows

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/container_windows.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build windows
// +build windows

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/container_windows_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build windows && unit
// +build windows,unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/containeroverrides_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/containertype_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/port_binding_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/status/containerstatus_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/status/managedagentstatus_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/transitiondependency_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/container/transport_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/ecsclient/client_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/ecsclient/retry_handler_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/ecsclient/utils_amd64_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build amd64 && unit
// +build amd64,unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/ecsclient/utils_arm64_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build arm64 && unit
// +build arm64,unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/eni/eni_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/eni/eniattachment_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/eni/enistatus_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/statechange_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/association_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/status/statusmapping_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/status/taskstatus_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/task_linux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build linux
// +build linux

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/task_linux_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build linux && unit
// +build linux,unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/task_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/task_test_utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/task_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build !linux && !windows
// +build !linux,!windows

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/task_windows.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build windows
// +build windows

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/task_windows_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build windows && unit
// +build windows,unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/taskvolume_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/taskvolume_windows_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build windows && unit
// +build windows,unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/types_unmarshal_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/task/util_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/testutils/container_equal_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/api/testutils/task_equal_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/app/agent_capability_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/app/agent_capability_unix.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build linux
// +build linux

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
1 change: 1 addition & 0 deletions agent/app/agent_capability_unix_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build linux && unit
// +build linux,unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
Expand Down
Loading