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

Bump overall dependencies #161

Merged
merged 10 commits into from
Sep 11, 2023
Merged

Bump overall dependencies #161

merged 10 commits into from
Sep 11, 2023

Conversation

pjbgf
Copy link
Member

@pjbgf pjbgf commented Apr 14, 2023

Summary of changes:

  • Bump go dependencies and update vendored files.
  • Bump dapper version on drone to v0.6.0.
  • Nginx updated to v1.24.0.
  • Kubectl updated to v1.24.15.
  • Deprecate use of rancher/plugins in favour of the upstream latest version.
  • Deprecate use of rancher/docker in favour of the upstream latest version.

Dockerfile.dapper Outdated Show resolved Hide resolved
@superseb
Copy link
Contributor

vendor folder should be dropped entirely at this point, other repositories have dropped that a long time ago.

@pjbgf
Copy link
Member Author

pjbgf commented Apr 20, 2023

@superseb thank you for the review. Given the size of the PR and the moving parts, do you think those changes can be tackled as a follow-up PR, or should I just add to this?

@pjbgf
Copy link
Member Author

pjbgf commented Apr 21, 2023

@superseb removed Go mod vendoring. PTAL

Dockerfile.dapper Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
package/Dockerfile Outdated Show resolved Hide resolved
package/Dockerfile Outdated Show resolved Hide resolved
@kinarashah
Copy link
Member

kinarashah commented Apr 28, 2023

@pjbgf Do you have an ETA for when Seb's review comments will be addressed? We need a new tag with cri-dockerd bump for v1.26, so I could cherry-pick your commit and update remaining deps if you're busy. Thanks!

@pjbgf
Copy link
Member Author

pjbgf commented Apr 30, 2023

All the changes were made, @superseb @kinarashah. PTAL

DOCKER_URL=DOCKER_URL_${ARCH}

RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker
RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2
Copy link
Contributor

Choose a reason for hiding this comment

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

Why deviate from the default binary install like in every other project? Based on their own docs, go get/go install is discouraged (https://golangci-lint.run/usage/install/#install-from-source). This also blocks auto updating because it doesn't match our generic rules.

Copy link
Member Author

Choose a reason for hiding this comment

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

The change was aligned with the current version in master which uses go get.

This has now changed to use upstream's install.sh instead.

package/Dockerfile Outdated Show resolved Hide resolved
FROM nginx:1.21.6-alpine
FROM nginx:1.24.0-alpine

ENV DOCKER_VERSION=23.0.3
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this tested to be compatible with the oldest Docker we support?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not completely sure what version we do support, but generally that is defined via DOCKER_API_VERSION, which we are not setting in this project apart from the entrypoint.sh. What API version is this project meant to support?

@kinarashah can you please help testing this?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can override the rke-tools image to test using the system_images option in cluster.yml (CLI only)

Basically comes down to API support for the versions we do support (see support matrix)

Copy link
Member Author

Choose a reason for hiding this comment

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

Aligned this with support matrix, and bumped to latest patch: 20.10.25.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with 23.0.3 as long as its API compatible with the versions we support. But in the PR I am viewing it still says 23.0.3 while you say you bumped it to 20.10.25

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice spot, that is now fixed as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I kept the docker within the 20.x series as that is aligned with other projects and our support matrix.

The choice of 20.10.24 over 20.10.25, was due to although the project has a tag for 20.10.25, it does not have the artefacts published for them.

@superseb
Copy link
Contributor

superseb commented May 1, 2023

One final question is if we are going for Go 1.20 in 2.7 Q2 release as we are moving to k8s 1.26 which is 1.19, do we want to keep that version across the board or is it up to the teams?

@kpsingh219
Copy link

Is it possible to know when this will be merged ?

@pjbgf pjbgf force-pushed the bump-deps branch 3 times, most recently from 0e0c861 to 7936f85 Compare July 10, 2023 12:05
@pjbgf
Copy link
Member Author

pjbgf commented Jul 10, 2023

@kpsingh219 I am not entirely sure. It will largely dependent on reviews and testing.

@pjbgf
Copy link
Member Author

pjbgf commented Jul 10, 2023

One final question is if we are going for Go 1.20 in 2.7 Q2 release as we are moving to k8s 1.26 which is 1.19, do we want to keep that version across the board or is it up to the teams?

I think the main constraint is running supported version only. Apart from that, I would assume that's up to the teams/projects.

@pjbgf pjbgf force-pushed the bump-deps branch 2 times, most recently from ecd9765 to aa14d98 Compare July 12, 2023 12:54
macedogm
macedogm previously approved these changes Jul 13, 2023
Copy link
Member

@macedogm macedogm left a comment

Choose a reason for hiding this comment

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

Approving from a pure security perspective regarding the bumps. We still need @kinarashah's review and probably tag someone from QA to test all the pieces together.

FROM nginx:1.24.0-alpine

ENV DOCKER_VERSION=23.0.3
ENV PLUGINS_VERSION=v1.2.0
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is a nit, but naming it more specifically allows us to put this automated bump in Renovate with a more descriptive variable (for example CNI_PLUGINS_VERSION instead of PLUGINS_VERSION)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good shout, amended it accordingly.

@pjbgf pjbgf force-pushed the bump-deps branch 3 times, most recently from 2374c1b to f7721f7 Compare August 3, 2023 07:01
@manuelbuil
Copy link
Contributor

Note that CNI plugins v0.9.1 included flannel binary but v1.2.0 does not include it. Flannel has its own repo now: https://github.com/flannel-io/cni-plugin

@pjbgf
Copy link
Member Author

pjbgf commented Aug 3, 2023

@manuelbuil thank you for pointing that out, that should be fixed now. PTAL

I noticed that all the plugins are being kept on /tmp and only a few are copied over to /opt/cni/bin. At no point flannel is copied over (as far as I can see), is that intentional?

@manuelbuil
Copy link
Contributor

@manuelbuil thank you for pointing that out, that should be fixed now. PTAL

I noticed that all the plugins are being kept on /tmp and only a few are copied over to /opt/cni/bin. At no point flannel is copied over (as far as I can see), is that intentional?

You are pointing to weave script which is another CNI plugin. All plugins should go into /opt/cni/bin but I think the code that adds that plugin to rke is the one responsible to copy those binaries

@pjbgf
Copy link
Member Author

pjbgf commented Aug 3, 2023

You are pointing to weave script which is another CNI plugin.

@manuelbuil That was intentional, as that was I trying to highlight the current version on master. All plugins are copied into /tmp and not to /opt/cni/bin. Within the code base the only copy across to the latter directory is via the weave cni script.

As per latest tag published 3 months ago:
image

@pjbgf
Copy link
Member Author

pjbgf commented Aug 3, 2023

Following up from off-line chat with @manuelbuil, we will keep binaries as per current public image. If necessary, a future PR will move things around.

I added a test to verify all binaries being packaged up are in place and are valid for the target architecture.

@pjbgf
Copy link
Member Author

pjbgf commented Aug 3, 2023

The build is failing as confd is not a valid arm64 binary. Ideally we would fix that (rancher/confd#8) and bump the version. The good news is that the tests work.

pjbgf added 10 commits August 16, 2023 13:16
- github.com/minio/minio-go/v7 to version 7.0.52.
- github.com/sirupsen/logrus to version 1.9.0.
- github.com/urfave/cli to version 1.22.12.

Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
It looks like the rancher fork of plugins was created in
order to add arm64 support. Given that upstream supports
that architecture natively nowadays, this has been removed.

Ref:
rancher/plugins#2
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Moved all the environment var declarations to the top of
the Dockerfile, for easier maintainance going forwards.

Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Migrate from the deprecated golint to golangci-lint + revive,
and during the process the depracted io/ioutil package was also
migrated.

Instead of manually downloading the docker CLI within dapper,
that is now installed with zypper instead.

Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
This change was needed as flannel was previously baked into the
cni plugins, but this is no longer the case.

Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Verify expected binaries on the target image,
ensuring they are valid for the target architecture.

Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
The previous version had an invalid arm64 image, this bump
should fix it.

Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
@pjbgf
Copy link
Member Author

pjbgf commented Aug 16, 2023

PR rebased.

Copy link

@doflamingo721 doflamingo721 left a comment

Choose a reason for hiding this comment

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

Changes looks good to me.

@superseb superseb merged commit 5604180 into rancher:master Sep 11, 2023
@superseb
Copy link
Contributor

@pjbgf please create an issue which can be used to QA this PR

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.

7 participants