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

Add vtctldclient container image #16318

Merged
merged 4 commits into from
Jul 2, 2024

Conversation

runewake2
Copy link
Contributor

@runewake2 runewake2 commented Jul 2, 2024

Introduces the vtctldclient image.

Description

vtctldclient is a typed replacement of vtctlclient which has been deprecated since Vitess v18. A vtctlclient image has continued to be published however and a vtctldclient image is absent from the projects published images. This introduces vtctldclient to resolve this and so that vtctlclient can be removed at a later point.

Related Issue(s)

Fixes #16288

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required
    • Note: this adds a new image which likely needs a Docker Hub readme. It's unclear to me how to author that.

Deployment Notes

This change should not impact the broader vitess code and is isolated to the container image and the docker build processes (adds a new image). A description of the image will need to be added (the vtctlclient description is minimal but could be reused for this)

Copy link
Contributor

vitess-bot bot commented Jul 2, 2024

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsBackportReason If backport labels have been applied to a PR, a justification is required NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Jul 2, 2024
@github-actions github-actions bot added this to the v21.0.0 milestone Jul 2, 2024
@runewake2 runewake2 force-pushed the swronski/vtctldclient-container branch from 1e9b048 to fba947f Compare July 2, 2024 20:15
@frouioui frouioui added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: Docker Component: vtctldclient and removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Jul 2, 2024
@frouioui
Copy link
Member

frouioui commented Jul 2, 2024

this adds a new image which likely needs a Docker Hub readme. It's unclear to me how to author that

We do not have that and I don't think we necessarily need one, from the user point of view: they go to DockerHub and use the images available there.

@frouioui frouioui marked this pull request as ready for review July 2, 2024 20:26
@frouioui frouioui marked this pull request as draft July 2, 2024 20:26
@frouioui
Copy link
Member

frouioui commented Jul 2, 2024

Sorry, I marked this as Ready for review, but I am unsure if on your side it is, I reverted back to Draft. Feels free to mark it as ready.

@runewake2 runewake2 marked this pull request as ready for review July 2, 2024 20:27
Updates copyright of vtctldclient dockerfile

Co-authored-by: Florent Poinsard <[email protected]>
Signed-off-by: Sam Wronski <[email protected]>
Copy link
Member

@frouioui frouioui left a comment

Choose a reason for hiding this comment

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

This looks good to me! Thank you for this contribution 🙌🏻

$> docker build -t vitess/test-vtctldclient:latest ./docker/binaries/vtctldclient 
$> docker run -it docker.io/vitess/test-vtctldclient:latest bash 
root@0cddf19e73fe:/# which vtctldclient 
/usr/bin/vtctldclient
root@0cddf19e73fe:/# vtctldclient --version 
vtctldclient version Version: 21.0.0-SNAPSHOT (Git revision 780abdd9c4017f08c29f26c7883abd5081b525d2 branch 'main') built on Tue Jul  2 19:23:58 UTC 2024 by vitess@buildkitsandbox using go1.22.4 linux/amd64

Comment on lines +22 to +27
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install jq curl -qq --no-install-recommends && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming jq and curl are in here for debugging? I know they're in the other Dockerfiles, so I don't want to gate this change on it, but should we think about moving to distroless for most of these binaries? The only ones offhand I can think of that need Linux might be vttablet since it uses installs the mysql client.

Copy link
Member

Choose a reason for hiding this comment

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

Eventually we should think about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those are mostly to align with the existing vtctlclient image. I can remove the entire RUN layer since I don't think any of the apt-get functionality is required for this to work if that'd be preferred.

Copy link
Member

Choose a reason for hiding this comment

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

I think what you are proposing right now is fine. IMHO moving to distroless should eventually be done to all images in a subsequent PR so we have something consistent.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed, this PR is great as is to stay consistent with vtctlclient

@frouioui frouioui merged commit 3db70b6 into vitessio:main Jul 2, 2024
92 checks passed
@runewake2 runewake2 deleted the swronski/vtctldclient-container branch July 2, 2024 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Docker Component: vtctldclient Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: vitess/vtctldclient container image
3 participants