-
Notifications
You must be signed in to change notification settings - Fork 521
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
buildsys: extend external-files
to vendor go modules
#2378
Conversation
Force pushed to address failing GitHub actions needing |
eb1bcc4
to
d1f326b
Compare
d1f326b
to
e50dbb3
Compare
Force pushed to address |
e50dbb3
to
cd46653
Compare
cd46653
to
508c08b
Compare
Force pushed to address not having to unwrap here: - dg_args
- .go_mod_cache
- .to_str()
- .context(error::InputFileSnafu)
- .unwrap()
+ dg_args
+ .go_mod_cache
+ .to_str()
+ .context(error::InputFileSnafu)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it looks like you will need to make other updates, added a couple small nits to the list.
508c08b
to
0a3d118
Compare
Force pushed to address nits / spelling mistakes ✏️ |
I've found some issues with using Vendoring approachI found these issues as I'm trying to build the $ make ecr-credential-provider
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPROXY=direct go build \
-trimpath \
-ldflags="-w -s -X k8s.io/component-base/version.gitVersion=v1.22.3-dirty" \
-o=ecr-credential-provider \
cmd/ecr-credential-provider/*.go
make: /bin/bash: Argument list too long
make: *** [Makefile:38: ecr-credential-provider] Error 127
|
Added another commit to address latest review comments: Now, when Adds sane defaults for several of the bundling options. I will plan to squash this into a co-authored commit upon approval, but this was a bit more of a change that seemed to warrant it's own intermittent commit |
@stmcginnis - I think something is wrong with the cloud-provider-aws I am able to pull down the tar with
and unpack it with:
Then, going into that directory, I can vendor the code. But when I attempt to manually run a
which is super weird. It's asking me to run a So, running
The
But checking out their
My presumption is their I also wonder if Can we ask them to cut a new, up to date tag / tar with the right go.mod? |
Go would update the go.mod file, so I had assumed that would resolve any issues before vendoring. But I think you're right there. I found there is a newer v1.24.1. tag and the dependency issues have since been cleaned up (with one minor change still stale). That seems to be enough that it fixed whatever was happening though:
Glad this is at least captured here as I think we may run into other weirdness like this as we add other go packages. But looks like I can at least proceed for now. And this change looks good to me. Again, just wanted to capture some weirdness so there's some record of it. |
@stmcginnis Awesome!!! 👏🏼 glad that works!! And yes, glad it's captured here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this out with the work I'm doing. I'm still working through other issues, but I've gotten past the part covered by this and everything appears to be working well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Lots of nits but I don't see anything major missing.
Added another commit which reworks how the bundling script is used by Now, instead of attempting to feed a long script delimited by Further documentation in comments in code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. In terms of the commits:
- I'd "unsquash" the first one and have two separate commits for the
hotdog
andoci-add-hooks
changes. - There's at least one typo in the second commit message
- You can squash all the
buildsys
commits together as the first patch in the series (probably you were planning to do this).
Using the `bundle-*` keys on `packag.metadata.build-package.external-files`, buildsys can vendor Go dependencies into a new archive (leaving the prestine upstream archive intact). Both archives may then be used to build the package in an isolated environment. toosl/docker-go now also retrieves the `GOSUMDB` environment variable from the host. Co-authored-by: John McBride <jpmmcb@amazon.com> Co-authored-by: Samuel Karp <skarp@amazon.com> Signed-off-by: John McBride <jpmmcb@amazon.com>
Co-authored-by: John McBride <jpmmcb@amazon.com> Co-authored-by: Samuel Karp <skarp@amazon.com> Signed-off-by: John McBride <jpmmcb@amazon.com>
Co-authored-by: John McBride <jpmmcb@amazon.com> Co-authored-by: Samuel Karp <skarp@amazon.com> Signed-off-by: John McBride <jpmmcb@amazon.com>
412418c
to
867506d
Compare
Force pushed to flesh out the commit structure per @bcressey's recommendations and address a few nits! Removed changes to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with #2377 and it looks like everything works as expected.
Issue number:
Closes #2052
Closes #2053
Description of changes:
This patch carries many of the changes from #2053 but adds recommendations from subsequent code reviews.
The
external-files
interface has been extended to now take several optional `bundle-* modifiers that enable it to consume an upstream archive, unpack it, vendor it's go module dependencies, and create a new archive with those vendored go dependencies.Further, this enables a possible future paradigm of vendoring many modules from a single
external-files
. With this PR, only "go" is supported inbundled-modules
.Testing done:
Builds 👍🏼
and launching an ecs instance looks 👍🏼
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.