-
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
[vtadmin-api] Add static file service discovery implementation #7229
[vtadmin-api] Add static file service discovery implementation #7229
Conversation
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
…VTGates in discovery_static_file_test.go Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
e041d75
to
0a7df91
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.
Looks good to me. If you do have two two requests I would make are
- Add in a full example json as a comment in the main implementation file.
- Add in malformed json to one of the tests.
@dkhenry Oh both really good suggestions! Thank you, I will do this. :D |
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.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.
lgtm
Signed-off-by: Sara Bee 855595+doeg@users.noreply.github.com
Description
Two changes in this PR:
:15991
in./docker/local/run.sh
so that vtadmin (running outside of Docker) can issue requestsThe best part is that now we can run vtadmin-api and vtadmin-web locally, using a local Vitess (in Docker or otherwise). 🎉 So we can add data fetching (and real data) to vtadmin-web 😈 finally the fun begins.
We can enhance this later on by watching the cluster config file(s) for changes so updates don't require a restart of vtadmin-api.
Many thanks as always to @ajm188 for answering my eight million golang questions! 💛
Running it locally
First, you'll want to run Vitess itself locally. 😸 I always run Vitess using Docker but this works fine with uncontainerized local Vitess too.
(@shlomi-noach, thank you again for the fix in #7213!)
Second, you'll need to create an empty vtgate credentials file to avoid the gRPC dialer bug mentioned in #7187. Location and filename don't matter since you'll be passing this in as a flag; I put mine at
/Users/sarabee/id1-grpc_vtgate_credentials.json
:Third, you'll want to create a cluster configuration file. This is the "static file" part of "static file service discovery". Assuming you're using the standard local Vitess set-up, you can steal this file as-is. (It comes with an entry for a bogus vtgate host to demonstrate that tagging works.) Again, filename and location don't matter since we'll be passing in the path as a flag; I put mine at
/Users/sarabee/vtadmin-cluster1.json
.Fourth, build this branch if you haven't already:
Fifth, start up vtadmin-api but make sure to update the filepaths for the vtgate creds file and static service discovery file you created above!
Sixth and finally, we can curl vtadmin-api and get a valid response! 🎉
Related Issue(s)
Checklist
Deployment Notes
N/A since vtadmin isn't in the deployment path :D
Impacted Areas in Vitess
Components that this PR will affect: