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

Upgrade to go 1.22 #8125

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

bryantbiggs
Copy link
Member

@bryantbiggs bryantbiggs commented Jan 10, 2025

Description

1.21 reached end of support in August of 2024.
1.22 was chosen because there were errors thrown on 1.23 - tabled for later date.

This PR is a bit larger than usual given the way the prior Docker images were configured in order to update the go version. Previously, it appears that you would need to perform the following to update the go version:

  1. Create your git branch
  2. Update the go version references throughout the codebase to the desired version
  3. Build and push the eksctl "build" image to ECR. This means that only maintainers with write access to ECR can update go versions, and this is done locally! Not great
  4. Grab the sha digest of the "build" image pushed to ECR, update the main Dockerfile with the new digest
  5. Proceed to open pull request with changes

This is interesting for two reasons:

  1. It requires a human in the loop which opens up various issues in terms of supply chain, access, and does not allow OSS contributions for this update
  2. The "build" image includes a lot of dev type tooling (helm, kubectl, aws-iam-authenticator, etc.) but the eksctl binary is copied out of this dev build image into the resulting final image. If this psuedo development environment image was of value, there are probably better ways to achieve this using multi-stage builds and removing the need to have a person push the intermediate image to ECR from their local machine

To simplify, this PR removes the dev build image entirely which removes the majority of the complexity in this process. The resulting image that is pushed to ECR is based on other K8s/EKS images. I did not get a chance to dig into the code generation and whether any of that is used in the resulting final executable or if that is only for testing, but there could be further simplification - tabled for a later date.

With this changes, we therefore can remove the following:

  • The .requirements file is removed which avoids version skew issues; any binaries needed are instead installed via go install ... in the Makefile before their use
    • This removes the need for the install-build-deps Make target
  • With building the binary in the final image, the eksctl-build image, scripts, and manifests are removed
    • This removes the .github/workflows/ecr-publish-build.yaml workflow
    • This removes the need for Makefile.docker
  • .github/workflows/build-all-distros-nightly.yaml workflow is removed since its redundant of the CI checks, and has been failing for some time
  • .github/workflows/cache-dependencies.yaml workflow is removed since there are already a number of cache points in the workflows and we are over-caching which is rendering this moot
    image

With this change, an outside OSS contributor can now update the version go and build, test, and validate that change before creating a PR without any maintainer involvement.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the userdocs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes
  • (Core team) Added labels for change area (e.g. area/nodegroup) and kind (e.g. kind/improvement)

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@bryantbiggs bryantbiggs added skip-release-notes Causes PR not to show in release notes dependencies Pull requests that update a dependency file area/tech-debt Leftover improvements in code, testing and building labels Jan 10, 2025
@bryantbiggs bryantbiggs force-pushed the feat/go-1-22 branch 2 times, most recently from 08c2a18 to 7e205f8 Compare January 10, 2025 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tech-debt Leftover improvements in code, testing and building dependencies Pull requests that update a dependency file skip-release-notes Causes PR not to show in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant