-
Notifications
You must be signed in to change notification settings - Fork 434
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 async binding operations #137
Comments
+1. I have already run into a scenario where I needed async binding (Google CloudSQL). |
We also had the situation where bindings need to return information, potentially asynchronously. This raises the question of whether it would be better to implement the last_operation function, or a fully fledged GET method on bindings. Would a GET operation cover your use cases? |
Would that be adding additional information in the response to the GET /last_operation? |
I would advocate that we follow the current async pattern of using last
operation.
Adding a new endpoint to get bindings would also mean the bindings are
stored in a retrievable way, which is likely a security issue.
…On 17 Feb 2017 9:32 a.m., "Arun Ramakrishnan" ***@***.***> wrote:
Would that be adding additional information in the response to the GET
/last_operation?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAeB1xfbqr9z7Kv6GX9EvHvc9JnIUiotks5rdWkkgaJpZM4MDStm>
.
|
Unless there is any further discussion I would suggest that @bmelville creates the proposed spec changes on a branch. This can then be shared with the cf-dev mailing list. I would support this feature. Any concerns @shalako? |
@vaikas-google will you be picking up drafting the spec changes in a branch? |
I think so. Though for the next few days I'm not able to get to this due to
other commitments still being on my plate, but I'll tackle this as soon as
I get a chance.
…On Thu, Mar 2, 2017 at 3:14 AM, Alex Ley ***@***.***> wrote:
@vaikas-google <https://github.com/vaikas-google> will you be picking up
drafting the spec changes in a branch?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKwedJQHUXRR7IjbS81SeFRjeY5aVyG_ks5rhqR4gaJpZM4MDStm>
.
|
It is also interesting the spec doesn't include timeout information. Currently, Cloud Foundry times out binding requests after 60 seconds by default. This is configurable by the operator on a global basis, meaning it applies to all brokers. @pmorie does service catalog have any request timeout logic that you are enforcing? |
I've created a branch that adds async binding and unbinding to the spec: View proposed spec (or changes). Please provide any feedback you have on this change. The spec changes are relatively straightforward, making use of the workflows already in place for provisioning, updating and deprovisioning. Thanks! |
Following yesterday's call with the working group, I've updated the branch with an updated spec containing a last operation endpoint for service bindings. Let us know your thoughts, thanks! |
@mattmcneeney I understand that the synchronous binding endpoint However, I don't see the credentials being returned by the last operation c1f610a#commitcomment-21437274 How would platform clients fetch the binding credentials ? |
Good spot @gberche-orange, it should be in the asynchronous response too. I've updated the spec so that credentials (and other information) can be included in the last service binding operation endpoint response. |
@mattmcneeney as we discussed, this seems like the simplest path forward for brokers. It does mean brokers that support async responses would need to hold on to the credentials / be able to retrieve them until "last_operation" is called. |
Thanks for the feedback on this so far everyone. Does anyone else have any further thoughts on the proposed spec? |
thanks @mattmcneeney for the update to the I wonder whether the specification should mandate that the This would make it consistent with the current synchronous behavior for which there is currently no GET endpoint to retrieve credentials, possibly strengthening security by reducing credentials undesired retransmits over the wire, and reducing the duration into which broker should manage credentials state. This would be a more defensive wording than the current
|
An alternative solution would be to add an additional GET endpoint that would return the binding information. The platform talking to the broker could handle permissions on who could actually see any information returned in that call (such as credentials). Additional logic around how long service brokers have to keep credentials for (ie. until the last_operation endpoint has been polled and a 'succeeded' response was returned) seems complex, but you're right that it would work more similarly to the synchronous behaviour. Edit: There may be overlap with issue Fetching current input parameters values (for a service or a binding) regarding the alternative solution mentioned above. |
I don't have strong a opinion on either approach. Potential drawbacks I can think of for new
|
I agree with those drawbacks @gberche-orange. Since this overlaps with issue #159 regarding Fetching current input parameters values (for a service or a binding), we can wait to see what everyone's thoughts are on that issue before making a decision here. |
For those who want to see a diff, I think this is the link: |
Couple of comments:
|
Thanks for the feedback @duglin. In response to the above:
|
Updated spec: link |
@mattmcneeney re: "I'm not sure I understand do we need to add text to say that brokers should be able to return a 200.... Brokers supporting async bindings should return a 202."... right now a broker should return a 202 in response to the provision() and bind() operations, if they're doing to do it asynchronously. However, what's not clear is when the URL for the "last_operation" because valid/alive for the new resource. I think its implied that it should be alive immediately but the spec doesn't say so. Which means, its possible for someone to implement it in such a way that the URL will return a 404 until the resource is fully ready. For example, if they simply accept the incoming request and stick it in a queue, then return a 202. They may not do the work to make the polling endpoint available until something starts to processes that entry the queue. The reason I thought about this is because of a previous comment about error responses to the async polling causing the platform to stop polling. Well, if they stop on a 404 and the broker is kind of goofy and returns a 404 until the resource is ready then the platform will stop prematurely. I think simply adding text along the lines of:
should cover it. |
Aha, I understand. Good spot, the spec was definitely a bit loose. I'll add the above note to the spec for all of the 202 responses. |
@duglin How's this? |
@mattmcneeney looks good - thanks! |
@duglin Regarding handing the credentials (or any other binding related return values) right up front kind of defeats the purpose of the async provisioning. If they take any time to create, then why even bother with the async request? |
@duglin I also think that the binding should be gettable resource and in that case last operation polling should only be used to tell whether the requested resource (binding) was created successfully or if it failed, polluting that response with the resulting resource information seems wonky to me. It's a single GET so the overhead for doing that is minimal and I thought we wanted to make Bindings gettable so why wouldn't we return it there for consistency? By consistency I mean if bindings are gettable resource and hence useful for reconciling differences then wouldn't it make more sense to just have one place to fetch the credentials? |
@vaikas-google I agree that returning it on the 202 makes little sense, but having the spec say it SHOULD be there is going to be problematic - because SHOULD is a soft-MUST. I'd like to get @shalako's take on why it isn't a MUST to better understand the original intent - that might provide some insight into whether we can change it to a MAY instead - which I think is the best we can do on that. My reasons for allowing the creds to flow back on the final last_operation response is that it just feels like a waste of effort to force all platforms to issue a second request every time. Also not everyone will support GET so we'll need to get the creds for an async request w/o it. Which means there will be some scenarios where the last_op response will be the only way to get the creds - so for consistency it seems like it should be in there regardless of whether GET is supported or not. |
Seems like since there are no brokers that support async ops for bindings (this is for bindings only, right?), it seems that we have a bit of an opportunity to create a good flow that makes sense. So, one could say that in order to support async bindings, you have to do couple of things:
So, broker writer must support 202 + last_operation + GET to get async bindings support. |
That is certainly an option, but then we're inconsistent with async provisioning. I'm also not sure we can require GET since that mandates stateful brokers. I suspect that might be why the 202 is supposed to return the creds, but that's just a guess. We should discuss this tomorrow... although, @mattmcneeney may not be on the call. |
Returning no information in the last_operation call for bindings is
actually consistent with async service instance provisioning, where the
dashboard URL (the only data you can get from a provision) is returned
alongside the 202 Accepted.
Although it would mean brokers having to support another endpoint, I would
definitely support the workflow where the async binding last_operation call
only returns a {"state":"succeeded"} and then the GET binding endpoint
should be called to get binding specific information. I think this helps
avoids the difficult questions such as how long should the last operation
data be held onto, and what happens once it has been called (does the data
disappear?).
Any brokers who can't do this because they are stateless etc can continue
to use synchronous bindings.
…On Tue, 12 Sep 2017 at 06:41, Doug Davis ***@***.***> wrote:
That is certainly an option, but then we're inconsistent with async
provisioning. I'm also not sure we can require GET since that mandates
stateful brokers. I suspect that might be why the 202 is supposed to return
the creds, but that's just a guess.
We should discuss this tomorrow... although, @mattmcneeney
<https://github.com/mattmcneeney> may not be on the call.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AG7UzMDENBQrDnsoB1TGG-OHuqMORA2mks5shhmfgaJpZM4MDStm>
.
|
I'm not following the "how long" question. If we're going to mandate GET then there's no real data to hold on to for last_op, at least in the successful case since last_op will know the operation was successful since the broker should have all of the info needed. Yes, returning no other info on last_op is consistent with async provision, but I would like to suggest that we allow creds on the async provision last_op response to be consistent with our new async binding. I say this because I can imagine a case where a stateless broker can't support GET in general but is willing to hold on to the state long enough to return the last_op response- like we expect them to do today for async provision. And in that case they can probably hold on to the creds too for that short amount of time. At the f2f we opted to not introduce the more correct set of URLs because we didn't want to be inconsistent or offer more than one way to do something. By having async bindings look so different from async provision it feels like we're back-tracking on that consistency decision and leaving the spec in kind of a weird state. |
The how long question referred to how long should that last operation
endpoint with binding data live for, what happens if it is called again
after returning succeeded with data, etc. I'm not saying it's not a
solution, just that there a few edge cases that we may be able to forget
about by relying on a GET endpoint that should always return the binding
data. (But then again, that raises the question of how many times binding
credentials will be returned by that endpoint!)
…On Tue, 12 Sep 2017 at 06:56, Doug Davis ***@***.***> wrote:
I'm not following the "how long" question. If we're going to mandate GET
then there's no real data to hold on to for last_op, at least in the
successful case since last_op will know the operation was successful since
the broker should have all of the info needed.
Yes, returning no other info on last_op is consistent with async
provision, but I would like to suggest that we allow creds on the async
provision last_op response to be consistent with our new async binding. I
say this because I can imagine a case where a stateless broker can't
support GET in general but is willing to hold on to the state long enough
to return the last_op response- like we expect them to do today for async
provision. And in that case they can probably hold on to the creds too for
that short amount of time.
At the f2f we opted to not introduce the more correct set of URLs because
we didn't want to be inconsistent or offer more than one way to do
something. By having async bindings look so different from async provision
it feels like we're back-tracking on that consistency decision and leaving
the spec in kind of a weird state.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AG7UzC4VSenLkV-wIlZi1c3cq37eCQ4Rks5shhzxgaJpZM4MDStm>
.
|
I would think GET endpoint should return the binding data for as long as the resource (binding) is around. |
I'm not too concerned with making the async binding flow exactly match the async provision flow. If we're talking ideal design, I could even see the argument that the async provision response should NOT return the dashboard URL, as that is also something that might take a while to get set up correctly, and its presence is more an artifact of not having GETs in the spec at that time. Ultimately, in my opinion the GET is the most consistent and clear way to get the credentials back. I view credentials as out of scope of what an operation resource is meant to do, which is a generic resource that just reports on the status of an ongoing/completed process. And supporting credentials being passed back with the 202 but not being accessible is just a headache for the platform and I suspect not a common use case. If you're going to support binding asynchronously then I think it's perfectly fine to say you have to be stateful at that point. |
Doug, are you suggesting that last_op return credentials only once? That seems scary from the perspective of idempotency and could easily lead to lost data. I will also +1 Kibbe's suggestion that in a true async provisioning world, even dashboard URL may not be available until the instance has been provisioned. Any async operation must allow for the results of that operation to be made available only after it completes. |
@bmelville no, I'm suggesting that async bindings should have a similar UX as async provisioning to provide consistency between the two. Whether last_op can be called again, even after its said the op is done, is not clear in the spec and I would be fine with it returning the same data over and over until the broker decides to "not remember" that operation any more. Let me try to be a bit more clear since I probably wasn't in the past....
That's at least my current thinking on it. |
My issue is with the first two points. Why is it important?
and for service instances:
I think we're getting distracted by the dashboard URL because apparently it can be precomputed ahead of time, but has no bearing on the actual resource (Service Instance) being created and mixing that with the result of the operation is making things more complicated. I'd argue again that baking returning information from the last_operation is a bad idea because then you:
So, your second to last point is what I'd like to focus on. We're designing a new experience for async bindings. If you are saying that the broker can return the credentials (multiple times, mind you since we can't assume that things don't fall on the floor) in the last_operation, it clearly has to hang onto them somehow (or be able to get a mapping from last operation to them and if that's the case, then they could more than likely return or compute the mapping from the serviceinstance/binding as well in order to compute the value for last_operation), and I have a hard time seeing how you could return them in the last_operation but not in the get response. I'm sure such a system could be built, but I'm not sure how realistic it is. |
I missed last week's call in which you may have discussed this, but I agree with many of the points above. Summarising my thoughts:
I'm going to make a change to the spec regarding my last point here, and it would be great to discuss this again on next week's call? |
Branch updated: https://github.com/mattmcneeney/servicebroker/blob/async-bindings/spec.md |
I agree with your points, except for dashboard_url being a red herring. The URL may be specific to a dynamic IP or port, which may not be known until provisioned in the async process. I think this can be captured as a separate issue. Edit: #170 already exists. |
I think we're all saying the same thing. In the current model the
dashboard_url is assumed to be available before the provisioning finishes.
This might not be a great assumption as we've all mentioned :)
…On Fri, Sep 15, 2017 at 8:07 AM, Brendan Melville ***@***.***> wrote:
I agree with your points, except for dashboard_url being a red herring.
The URL may be specific to a dynamic IP or port, which may not be known
until provisioned in the async process. I think this can be captured as a
separate issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKwedJvtQcdufCO0DzMZO7Et6qT36twjks5sipLKgaJpZM4MDStm>
.
|
A couple of nits on the status codes for binding (here):
|
Good points @kibbles-n-bytes - branch updated! How do the interested folks feel about this branch now? Spec: https://github.com/mattmcneeney/servicebroker/blob/async-bindings/spec.md Diff against get-endpoints: mattmcneeney/servicebroker@get-endpoints...mattmcneeney:async-bindings |
Thanks @mattmcneeney! We should also document |
Good point. That made me re-check the 422 description for Bindings. I only had one error described regarding the required |
Can we close this in favor of #334 ? |
@duglin fine by me as long as folks are happy to continue discussions on the PR |
👍 |
Binding to an instance may encapsulate a long running workflow, similar to creating an instance. This might include provisioning new user accounts in a service, setting up firewalls, etc. It seems like the Bind API would benefit from the same last_operation model that Provision uses, and I'd like to get feedback from others who may have more context around this.
Latest proposal: https://github.com/mattmcneeney/servicebroker/blob/async-bindings/spec.md#binding
The text was updated successfully, but these errors were encountered: