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

go mod and vendor update #3534

Merged
merged 8 commits into from
Jan 25, 2023
Merged

go mod and vendor update #3534

merged 8 commits into from
Jan 25, 2023

Conversation

sparrc
Copy link
Contributor

@sparrc sparrc commented Jan 18, 2023

Summary

Diffs of direct dependencies in go.mod file:
awslabs/go-config-generator-for-fluentd-and-fluentbit@55d4fd2...8959c62
d-tux/udev@82fe5be...a12666f
didip/tollbooth@v3.0.2...v4.0.2
moby/moby@77e06fd...bd33bbf
prometheus/client_golang@v0.9.4...v1.7.1
prometheus/client_model@14fe0d1...v0.2.0
prometheus/common@v0.4.1...v0.10.0
https://cs.opensource.google/go/x/net/+/1bab6f366d9ec8c152f8735b2e359822ef75e3bd...refs/tags/v0.5.0
https://cs.opensource.google/go/x/sys/+/87e55d71481061dc6dcfb9a4953c896af893c130...refs/tags/v0.4.0
https://cs.opensource.google/go/x/tools/+/ef97713d99aa4e69742aa68fd45a63247b5d3ea0...refs/tags/v0.1.12
grpc/grpc-go@v1.48.0...v1.52.0

Note these are reverting to an older version in this commit:
golang/mock@v1.4.1...v1.6.0

bbolt is reverting from 1.3.6 to 1.3.5, it appears the 1.3.6 release tag was never promoted to a release and never will be in bbolt repo (see 'latest' release is 1.3.5): https://github.com/etcd-io/bbolt
etcd-io/bbolt@v1.3.5...v1.3.6
also see etcd-io/bbolt#326

Implementation details

Go modules were re-inited to fix build dependencies.

Backwards-incompatible package changes were mostly pinned to versions that don't require any changes to the agent codebase (except for minor changes in tollbooth and winio packages), so almost all changes in this PR are in the vendor/ directory.

The docker library pinning breaks windows builds though, so as a temporary fix one file in that docker client library for windows is manually pinned to the latest version via curl (see below).

The rest of the libraries will be updated in phases in follow-up PRs (and will require agent code changes).

cd agent/
rm -rf go.mod go.sum vendor/
go mod init github.com/aws/amazon-ecs-agent/agent
# downgrade for ContainerCreate interface changes
go get github.com/docker/docker@v19.03.13
# downgrade because of breaking change in library path (/current package is gone) 
go get github.com/containernetworking/cni@v0.8.1
# downgrade because of breaking change in library path (/current package is gone)
go get github.com/containernetworking/plugins@v0.8.6
# downgrade because of breaking change in library path (cgroups/v2 is replaced by cgroups/cgroup2)
go get github.com/containerd/cgroups@v1.0.4
# downgrade for ASM SDK interface changes that break mocks and unit tests 
go get github.com/aws/aws-sdk-go@v1.36.0
go mod tidy
# fix minor github.com/didip/tollbooth int64 -> float64 type change in library:
vim handlers/task_server_setup.go +81
go mod vendor

temporary windows build fix:

curl -o "vendor/github.com/docker/docker/pkg/system/filesys_windows.go" "https://raw.githubusercontent.com/moby/moby/f058afc861c2f56bf9e97472e99df65c6493e694/pkg/system/filesys_windows.go"

Testing

unit tests, integ tests, functional tests

Description for the changelog

Enhancement: Update go version in module file, update most vendored build dependencies to latest library.

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sparrc sparrc requested a review from a team as a code owner January 18, 2023 17:46
@sparrc sparrc force-pushed the go-mod-tidy-vendor-v2 branch 7 times, most recently from 7b48915 to 3d93e35 Compare January 18, 2023 21:20
@sparrc sparrc force-pushed the go-mod-tidy-vendor-v2 branch 10 times, most recently from 107ea3e to a92871b Compare January 24, 2023 23:56
@@ -24,18 +25,14 @@ jobs:
echo "invalid GO version"
exit 1
fi
echo "::set-output name=GO_VERSION::$go_version"
- uses: actions/setup-go@v2
echo "GO_VERSION=$go_version" >> $GITHUB_OUTPUT
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is incorporating part of the change from #3487

@@ -149,16 +149,15 @@ ifneq (${BUILD_PLATFORM},aarch64)
endif

test:
${GOTEST} -tags unit -coverprofile cover.out -timeout=60s ./agent/...
cd agent && GO111MODULE=on ${GOTEST} ${VERBOSE} -tags unit -mod vendor -coverprofile ../cover.out -timeout=60s ./... && cd ..
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updating to latest go version in the modules file requires us to fully buy-in to modules here, so that is why these make targets are being updated.

@sparrc sparrc merged commit b019481 into aws:dev Jan 25, 2023
sparrc added a commit that referenced this pull request Jan 26, 2023
sparrc added a commit that referenced this pull request Jan 26, 2023
TestSquidProxy functional test is failing 100% of the time on this commit. Reverting to investigate why this test is failing.

This reverts commit b019481.
sparrc added a commit that referenced this pull request Jan 26, 2023
sparrc added a commit to sparrc/amazon-ecs-agent that referenced this pull request Jan 27, 2023
* go mod and vendor update

* unit test upd

* go mod tidy, go mod vendor on mac

* try to fix windows winio dependency change in docker lib

* hack: fix windows build

* upgrade containernetworking/plugins

* resolve some accidental downgrades

* fix github actions
sparrc added a commit to sparrc/amazon-ecs-agent that referenced this pull request Jan 28, 2023
* go mod and vendor update

* unit test upd

* go mod tidy, go mod vendor on mac

* try to fix windows winio dependency change in docker lib

* hack: fix windows build

* upgrade containernetworking/plugins

* resolve some accidental downgrades

* fix github actions
@sparrc sparrc mentioned this pull request Jan 30, 2023
sparrc added a commit that referenced this pull request Jan 30, 2023
* go mod and vendor update

* unit test upd

* go mod tidy, go mod vendor on mac

* try to fix windows winio dependency change in docker lib

* hack: fix windows build

* upgrade containernetworking/plugins

* resolve some accidental downgrades

* fix github actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants