-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support URL parameters to populate Dynamic Image Building component #66
Comments
I don’t quite understand the rationale for the redirect and the use of url params in the redirect URL when we have all the information we need in the original URL. We can unpack the Is it possible to render the form under
We’re currently submitting the form via HTTP POST, so the backend would have to be changed to account for the new form-field structure if we make this change. I’d suggest to keep this simple though, and stick to two fields:
|
The backend only gets the built final image information via unlisted choice, it doesn't actually see the repo or ref we send out. So the frontend talks to the binderhub API, provides it with repo, ref and provider, and gets back the built image. This built image is what is actually submitted to the JupyterHub backend. The JupyterHub backend doesn't know anything about repo, ref, etc. The reason for needing the provider be a field is that we support many different providers, not just git: And some of them (like zenodo) do not accept refs, only the 'repo'. Eventually we would need to auto detect the provider from what the user pastes - that's the rationale behind introducing 'detect' regexes in my rewrite (https://github.com/jupyterhub/binderhub/pull/1856/files#diff-b1d57a27bde93c65a3fdd528ffae65f4aabf048cdc545f59f90ea13d489a110cR711). However, right now, I think it's ok to just ask for the repository and the ref (which can be branch, tag, |
I had assumed this is currently not possible, hence the suggested query parameters. I just tested with |
@oliverroick I hear you. I think the rationale for proposing the redirect for me is roughly: Pros
Cons
@oliverroick at the end, I think this idea was driven more by back-end architectural decisions - and to me, it seemed nice for the frontend to not have to worry about these URL compatibility details and can design a flexible query parameter structure. And sorry, I know a lot of this thinking through happened in conversation between me and @yuvipanda - hope some of this context helps, and happy to talk through :)
It's probably helpful to go through the exact flow for the "Dynamic Image Building" widget. Will be good to have @yuvipanda walk us through the details here on our call tomorrow. Roughly as I understand it: there's a separate call to the Binderhub API with the provider, repository and ref and the Binderhub API handles building the image and in the end, returning the URI for the built docker image. We then just include the docker image path (I think in a hidden field) in the final POST request for the form submission. Hopefully that flow will be clear after we go through it together. Thanks @oliverroick for the thoughtful comments - I realize that some of the details here are likely lost in 1:1 conversations between me and @yuvipanda so it's very helpful to have some of these things identified so we can clarify rationale / larger context and get more perspective on some of these choices. |
@yuvipanda do we still need to keep this ticket open? |
When we enable dynamic image building on the hubs, we want users to be able to share URLs with an environment specified to be able to share. Hence, fancy profiles should support populating the dynamic image building fields based on passed in URL parameters.
We eventually want to support a similar / same URL format to what mybinder.org supports, so users would be able to go to a URL like https://staging.hub.openveda.cloud/service/fancy-profile/v2/gh/batpad/foo and be correctly redirected to the hub spawn page and have the dynamic image building component selected with the correct provider and repository based on
gh/batpad/foo
. This redirect would happen server-side and the user would land up on a URL that looks like https://staging.hub.openveda.cloud/hub/spawn?binderProvider=gh&binderRepo=batpad%2Ffoo&binderRef=mainWith those query parameters, the fancy profiles code should pre-fill the dynamic image building fields with the correct values (and select the dynamic image building option).
So, on fancy profiles, I think the work involved is:
binderProvider
,binderRepo
andbinderRef
to populate these fields.The names
binderProvider
,binderRepo
andbinderRef
are very provisional - @yuvipanda let know if you have a better idea for naming here - but also, this URL scheme should not be considered stable and is something we might change down the line.Currently, we won't support handling the case where Profile Options have dynamic image building components within multiple profiles on the page. Currently, if there are multiple profiles with dynamic image building enabled, we can just show an error. In the next PI, we can think through handling selecting profiles in the URL as well, and then make this work for the case when there is a dynamic image building option within multiple profiles. For our current deployments, we will stick to having a single profile.
Refs NASA-IMPACT/veda-jupyterhub#45
cc @oliverroick
The text was updated successfully, but these errors were encountered: