-
Notifications
You must be signed in to change notification settings - Fork 390
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
API refactor process #358
Comments
From @rgbkrk:
|
I agree that launching with an explicit POST is best, with the eventstream only retrieving logs, never triggering a new build. This would solve several of the unused container issues we have had. The only wrinkle I see is how to handle that resource id without violating the shared state question. In memory would obviously be the easiest solution, but if we are sharding Binders that will be an impediment. Maybe we can encode all of that info in the evenstream URL:
but now I've introduced the same problem, because to fix our eventstream problem, the eventstream URLs must be consumable. Maybe that info could be in the username? I'm not sure how to do that reliably without races, though. We handle this pretty well right now with builds, just not launches. This is thanks to builds being run in deterministic pod IDs, to which we hook up logs. I guess if the launch itself were in a similarly specified pod, it would also work?
This sounds really attractive! Binder is responsible for picking the username, so we can know this at any point we want. The harder part would be registering the handler for the URL. This is where building on top of JupyterHub gets in the way a bit, because doing this would mean Binder handling some Hub URLs. This could mean talking to the Hub proxy directly, or it could mean routing based on path in the ingress. Either way, it's potentially fiddly. |
So the state that needs to be persisted is:
I've been thinking we could use encrypted JWT for this.
This has the following nice properties:
|
I should note that @willingc @betatim and I discussed this yesterday and figured the first steps are:
This is probably easy quick first fixes. |
I realized we don't have to encrypt our JWTs, just using simple signed ones is good enough for all the things we need to do. |
Would this include parameters like
in general can you try remembering to spell out acronyms for us less technically-savvy? :-) I assume you're talking about https://jwt.io/ yeah? Documenting the current API I think would be a good start either way so 👍 from me on that point |
Whoops, I'll try to remember to link acronyms first time I use them. We merged documentation for the API at #366 now. |
Cool! Thanks for letting me know about the PR...been super scattered since
I've been bouncing around Paris the last few days so still catching up :-)
…On Thu, Dec 21, 2017 at 10:32 PM Yuvi Panda ***@***.***> wrote:
Whoops, I'll try to remember to link acronyms first time I use them.
We merged documentation for the API at #366
<#366> now.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#358 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABwSHfitpWtpsV3ReS_VZ_AVzbma5uOfks5tCs5dgaJpZM4REwse>
.
|
Some what out of context comment: why do we need to store the username? The logs only depend on the repository so we can share them with all users. |
With the current API, we need this because it's not a build request, it's a build & launch request on a single event stream. We consolidate the build logs, which are per-repo, but the eventstream is specific to each launch request, which is per-user. Since @yuvipanda's proposal explicitly splits build from launch, I don't think we do anymore. We don't need to create the user until build has completed and launch is requested (step 3), unless I'm missing something. |
Adding a second API version is probably also going to reveal that we want less logic in the Handlers and more in objects, because incrementing the version means leaving the old handlers in place and creating new ones. Any logic shared between the v1 and v2 build handlers will likely be duplicated unless it resides in another object. This points to keeping Handler code small going forward. |
One question about jwt: Is there a reason for signing at all? What's the benefit of jwt over, say, b64-encoded JSON? From the API perspective, it's an opaque blob, so encoding doesn't matter and can change (we could happily switch from b64 to jwt without an API change), I was just curious about choosing an additional technology vs simple existing standards. |
@minrk the reason for JWT is mostly so we can trust the tokens coming in, so users aren't gaining access to other people's running servers. |
Has there been any movement on this? We just got burned by what sounds like an open eventsource on the nbinteract page |
Our current API has a bunch of problems:
This issue would be to gather constraints and feature requests various audiences want so we can come up with an evolved new design for our API that enables the various use cases we want to support.
Some use cases off the top of my head:
/me puts operations hat on
From an operational perspective, I think the only constraint is:
Others, feel free to chime in with workflows you would like to enable, current problems with the API and constraints you want to put on the API.
/cc @rgbkrk @minrk @betatim since I've heard them talk about this before. Feel free to tag others too.
Note that we should continue to support the current API while building the new one, and make the new one the 'v2' API :)
The text was updated successfully, but these errors were encountered: