-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 vtadmin docker image #10543
add vtadmin docker image #10543
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
652a85f
to
5e70d2e
Compare
3c8e35c
to
846a6ae
Compare
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.
it seems to me that all the test failures are due to the process.env
=> env
change. have you tried debugging locally?
as for the linter, you can npm lint:fix
(or something similar, it's in the readme!)
846a6ae
to
ed78100
Compare
yeah I saw where it was failing but no idea on how to fix it yet. |
Hey @L3o-pold, have you tried making this a function instead of a var like so:
I'll take a deeper look at your PR as well, that's just a javascript-y hunch 😃 What shows up here: https://github.com/vitessio/vitess/pull/10543/files#diff-f416f8984539bc33ec2516f3ffecb14ee9450f3e8e3582fabba942308eeb0b0fR30 when you run? (or is it that vtadmin won't spin up at all?) EDIT |
the problem is that in any case, once we get that working, you're going to want to update the before/after mock infra (see http.test.ts for an example, which is explicitly mocking |
The goal of using With this you can build a vtadmin dist version and allow people to edit those var when running the frontend. For example building a Vtadmin docker image and let users specify their own |
@L3o-pold Ah my eyes totally missed that. It doesn't look right assigning to NodeJs.ProcessEnv. Are we able to access the variables we need simply by exporting an
Additionally, how would you feel about using cookies instead? We've had success on private forks setting cookies for env variables and then doing something like (pseudo-y code):
Would either of those work? |
@ajm188 did a trick for fixing the CI. IMO cookie is ok only if we plan of adding an UI to edit those settings live. |
@notfelineit this[1] totally would have worked, but there are tests for the error handler that mutate the [1] "this" meaning your suggestion here
|
@ajm188 could you link to the tests mutating process.env? That sounds like funny test behavior 🤔 |
Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com>
2ad5e5a
to
f64a87a
Compare
Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com>
f64a87a
to
a48147b
Compare
Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com>
a7049a0
to
54b879b
Compare
Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com>
Since vtadmin is its own image, the example usage in the description needs to be changed to reflect that. |
Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com>
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.
This is looking good to me. It looks like all feedback has been addressed
- no changes to bootstrap images
- no changes to lite images
- distro (bullseye in the example) is not hard-coded, it is passed to the release script
- working example (confirmed with PR author via slack) in the description
If anyone finds problems with this after we merge it, we can fix it forward.
* add-vtadmin-docker-image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * env as function, update tests and code Signed-off-by: Andrew Mason <andrew@planetscale.com> Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * feat: fix remaining env usages to be function calls Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * add vtadmin build result in the bootstrap image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * fix vtadmin web cleaning Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * add vtadmin docker image entrypoint Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * add the possibility to custom vtadmin web port in Docker image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * fix vtadmin docker port Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * fix vtadmin entrypoint Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * set default vtadmin docker user as vitess Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * do not build vtadmin frontend in the bootstrap image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * build vtadmin frontend only in vtadmin docker image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * vtadmin replace sed and custom entrypoint with config.js file Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * remove vitess web files in lite docker image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * move vtadmin config into a specific directory Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * restore vtadmin web file in mysql57 lite docker image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> Co-authored-by: Andrew Mason <andrew@planetscale.com> Co-authored-by: Manan Gupta <manan@planetscale.com>
* add-vtadmin-docker-image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * env as function, update tests and code Signed-off-by: Andrew Mason <andrew@planetscale.com> Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * feat: fix remaining env usages to be function calls Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * add vtadmin build result in the bootstrap image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * fix vtadmin web cleaning Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * add vtadmin docker image entrypoint Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * add the possibility to custom vtadmin web port in Docker image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * fix vtadmin docker port Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * fix vtadmin entrypoint Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * set default vtadmin docker user as vitess Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * do not build vtadmin frontend in the bootstrap image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * build vtadmin frontend only in vtadmin docker image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * vtadmin replace sed and custom entrypoint with config.js file Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * remove vitess web files in lite docker image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * move vtadmin config into a specific directory Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> * restore vtadmin web file in mysql57 lite docker image Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com> Co-authored-by: Andrew Mason <andrew@planetscale.com> Co-authored-by: Manan Gupta <manan@planetscale.com> Co-authored-by: Léopold Jacquot <leopold.jacquot@gmail.com> Co-authored-by: Andrew Mason <andrew@planetscale.com> Co-authored-by: Manan Gupta <manan@planetscale.com>
Description
Add vtadmin docker image. Add the possibility to serve the vtadmin frontend inside docker image.
For now it's using node serving binary to serve the content but it could be change to have a single-component vtadmin.
Frontend have been modified in order to be able to change env var at the run time (not only build time).
Usage in k8s looks like this:
Related Issue(s)
Checklist
Deployment Notes