Remove MAKE_IN_DOCKER, and associated changes#129
Conversation
Codecov Report
@@ Coverage Diff @@
## main #129 +/- ##
=======================================
Coverage 53.08% 53.08%
=======================================
Files 12 12
Lines 486 486
=======================================
Hits 258 258
Misses 210 210
Partials 18 18 Continue to review full report at Codecov.
|
a0791a9 to
43163da
Compare
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| run: | | ||
| docker tag "docker.io/envoyproxy/gateway-dev:$(git rev-parse --short HEAD)" docker.io/envoyproxy/gateway-dev:latest |
There was a problem hiding this comment.
This makes the pushed image to amd64 (CI host arch) from multi arch.
There was a problem hiding this comment.
I think that's fine for now - we need to have one thing working before we worry about having multi-arch. Currently, we have nothing.
01a10a7 to
02b709d
Compare
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| tags: ${{ env.ENVOY_GATEWAY_DEV_IMAGE }}:${{ github.sha }}, ${{ env.ENVOY_GATEWAY_DEV_IMAGE }}:${{ env.ENVOY_GATEWAY_DEV_TAG }} | ||
| tags: docker.io/envoyproxy/gateway-dev:latest |
There was a problem hiding this comment.
we also want to tag and push with the SHA of the commit, can you please revert this
There was a problem hiding this comment.
The sha is already pushed by the earlier make push-multiarch (or, pre-this-pr: is already pushed by a different earlier docker/build-push-action@v3 call)
There was a problem hiding this comment.
ah thanks for pointing it out.
If we left this the way it is, it would be make the CI faster since its leveraging the same cache for the multiple build steps
There was a problem hiding this comment.
IMO, since everything should be doable without GHA, the better solution would be to go the other direction and move the :latest pushing to be a target in the Makefile, but I didn't have the appetite to do that in this PR.
There was a problem hiding this comment.
would prefer if this GHA remains the way it is, since the current changes doesn't improve the existing workflow and keep things consistent
There was a problem hiding this comment.
FTR, I tend to strongly believe that it should be a requirement that you can cut a release even if GHA is down, so I also believe that the push-to-:latest bit should move into a Makefile target.
There was a problem hiding this comment.
@arkodg Completely agree that it should be a separate PR, yes. 🙂
|
|
|
after upgrading |
| kube-uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. | ||
| $(KUSTOMIZE) build pkg/provider/kubernetes/config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f - | ||
|
|
||
| ##@ Kubernetes Build Dependencies |
There was a problem hiding this comment.
any specific reason to rm the current way ?
There was a problem hiding this comment.
Consistency. And this consistent approach has fewer cross-arch headaches as things like "the installer for such-and-such tool doesn't support darwin-arm64 yet".
There was a problem hiding this comment.
not sure how this is more consistent, since the tools here are go based, arch should not play a role. I prefer the existing approach since its less complex (lesser files to maintain)
There was a problem hiding this comment.
Sorry, I had kustomize in particular in mind when I said that; which was using a install_kustomize.sh script rather than go install (and the script does download a pre-compiled binary; hence the concern about arch). For controller-gen and setup-envtest, which were using a simple go install, I guess I should elaborate on why this is better.
Consistency: It isn't possible to do a simple go install for kustomize. For the version that we currently use, you have to add some exclude directives to a go.mod. I'd have to double-check to be sure, but I'm pretty sure that some newer versions also require some resplace directives. So trying to build consistency around basic go install will always have inconsistency with Kustomize. Other tools often end up in similar situations (it hasn't for a while now, but in the past golangci-lint has required replace directives, and may resume doing so in the future). This solution is applicable to any Go program, not just the ones that don't require exclude or replace.
Seamless: Having the version in its own file (go.mod) allows Make to know when it needs to rebuild. Say we land a change that requires us bumping a tool's version; there will surely be several contributors who are confused that their checkout no longer works after a git pull, they wouldn't realize that they need to purge their current binary to get Make to update it. By moving the version number from a Make variable to a separate file, Make can seamlessly updated it for them, and they'll never see breakage.
Reproducibility: When a tool doesn't yet use go.mod or depends on libraries that don't yet use go.mod, the bare go install may end up choosing different indirect-dependency library versions when one of them publishes an update, and cause surprising breakage. This isn't a problem if the tool's go.mod is updated by Go 1.18, but can be a problem if the tool's maintainers are still using and older Go (1.15?).
Maintainability: On the down side, as you mention: there are more files to maintain, but mitigating that is that updating just means editing one line in the go.mod, and then running make go-mod-tidy. And on the upside, dependabot knows how to update go.mod but not how to update a Make variable, so dependabot can help keep our tools up to date.
There was a problem hiding this comment.
thanks for the detailed reasoning, im still not convinced that this is the better approach for this project, and the existing one that is similar to the kubebuilder approach is much simpler to read through and maintain.
apart from this change, the PR LGTM, thanks for the multiple rebases, smaller PRs for specific areas should hopefully reduce such conflicts
Oh dang, macOS |
There was a problem hiding this comment.
I find myself moving my head up and down the screen trying to compute the dependency list.
prefer the current way with the add on dependancy of installing the tool
There was a problem hiding this comment.
That's fair. I don't have a real strong opinion here, but to make an argument for this way:
- Avoiding merge conflicts when 2 different people add 2 different linters
- When adding a linter, there are fewer places where it needs updated. Don't need to define the target in one place, add a
lintdependency in a second place, and alint-depsdependency in a third place. I don't think we should be adding bunches of linters, but as the list grows, this will be a bigger deal.
There was a problem hiding this comment.
this is purely a taste aspect, prefer the existing approach to simplify code maintenance but this comment is non blocking
|
@LukeShu can confirm that |
kflynn
left a comment
There was a problem hiding this comment.
This looks good to me. There are things here that look more complex, but (based on the burned fingers from Emissary) end up being wins in the long term.
There was a problem hiding this comment.
I am loving seeing these @s vanish. 🙂
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| tags: ${{ env.ENVOY_GATEWAY_DEV_IMAGE }}:${{ github.sha }}, ${{ env.ENVOY_GATEWAY_DEV_IMAGE }}:${{ env.ENVOY_GATEWAY_DEV_TAG }} | ||
| tags: docker.io/envoyproxy/gateway-dev:latest |
There was a problem hiding this comment.
FTR, I tend to strongly believe that it should be a requirement that you can cut a release even if GHA is down, so I also believe that the push-to-:latest bit should move into a Makefile target.
Entries in .gitignore aren't rooted unless they start with "/", so a leading "**/" is pointless. Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Arko had trouble with this, because variables were being used before they were defined. In order to make those errors easy to debug, I tacked on --warn-undefined-variables so that these things get called out. Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Rather tha calling each individually. Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
|
v4:
|
youngnick
left a comment
There was a problem hiding this comment.
This LGTM; I think that any further changes would be better done as fresh PRs, the history and context here is getting a little large.
Lizan is OOO this week. Any issues can be addressed in a follow-on PR
Per the vote for #124, remove the
MAKE_IN_DOCKERmagic and instead run commands on the host system. Some of those commands are system-y commands (make,go,python3,docker) and must be installed ahead-of-time on the host system, as documented inDEVELOPER.md(just as Envoy Proxy needs you to install a C compiler). Others (linters,controller-gen) the Makefile builds locally and installs to./tools/bin/in order to pin very specific version (just as Envoy Proxy builds a local copy ofprotoc).With this new assumption that the Makefile controls the
golangci-lintandcodespellversions, I did away with thegolangci/golangci-lint-action@v2andcodespell-project/actions-codespell@masterGitHub Actions, instead having the workflow simply callmake -k lint. However, I was careful that doing so did not disrupt the linters' ability to post annotations to the GitHub diff page; indeed earlier draft versions of this PR intentionally introduced things for both of these linters to complain about in order for me to validate that this still works. You can see that version of things on thelukeshu/borkbranch.As you will soon learn is usual for me, I recommend a commit-by-commit review.
fixes #124