-
Notifications
You must be signed in to change notification settings - Fork 67
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 BFF dev mode for local K8s testing #560
Conversation
daaf24e
to
5a65ae9
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.
Everything looks great, only nit would be parametrization of ports.
if err != nil { | ||
return "", err | ||
} | ||
|
||
if app.config.DevMode { | ||
serviceDetails.ClusterIP = "localhost" |
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.
Just to bring the internal conversation here, it would be really interesting to parametrize the port too, that way we can get whatever port users might have used for port-forwarding.
5a65ae9
to
fc0e126
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.
Tested and works great, only last nit: can you expand the docs to reflect this new logic?
fc0e126
to
a6d3962
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, just one thing to take a look at!
@@ -83,11 +84,17 @@ func resolveBearerToken(k8s integrations.KubernetesClientInterface, header http. | |||
return bearerToken, nil | |||
} | |||
|
|||
func resolveModelRegistryURL(id string, client integrations.KubernetesClientInterface) (string, error) { | |||
serviceDetails, err := client.GetServiceDetailsByName(id) | |||
func resolveModelRegistryURL(id string, app *App) (string, error) { |
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.
I'm not a fan of passing a pointer to the app struct into this function. It's meant as a utility function so I would stick to value semantics and add params for each value it requires.
An alternative would be to convert this function into a method of the app struct and use a receiver param to access what you need.
I'm happy with either of the above.
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.
Agree with Alex here.
Signed-off-by: Griffin-Sullivan <gsulliva@redhat.com>
a6d3962
to
c9921e8
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.
just to a second review after my comment above ^
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
Excelent work here!
@lucferbux: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
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.
Great work, thanks Griffin!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexcreasy, lucferbux The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
This PR allows developers to run a local MR cluster in kind and port forward their service to work with the BFF running locally.
How Has This Been Tested?
Follow the dev guide all the way to step 4.
Port forward with:
Run the BFF with:
and the UI in a separate terminal.
You should see an empty MR that you can interact with (make models, versions, archive, restore, etc)
Merge criteria:
DCO
check)If you have UI changes