[openstack-dev] Glance Tasks

George Reese george.reese at imaginary.com
Thu Nov 14 13:32:40 UTC 2013


One critical reasons why tasks rather than resource status may be required is because:

a) The system state may not be sufficient at time of POST/PUT to generate a “minimum viable resource” and we don’t want to risk timeouts waiting for the “minimum viable resource"
b) There may be more stuff about the workflow worth tracking beyond simple status, including the ability to act on the workflow

Did the new Glance Tasks stuff make it into Havana? If so, I agree with keeping in the new Glance Tasks stuff because I am violently opposed to breaking backwards portability under any circumstances. If not, I worry the new approach establishes a precedence that others may mistakenly use.

Also, as a side note, I think there should be a separate, shared tasks tracking component (ooh, something new for “OpenStack core” :)) that is the central authority on all task management. Glance (and Nova and everyone else) would interact with this component to create and update task status, but clients would query against it. It would also have it’s own API.

That way, a client subsystem could be handed a random task from an arbitrary OpenStack component and easily know the semantics for getting information about it.

-George

On Nov 14, 2013, at 2:30 AM, Mark Washenberger <mark.washenberger at markwash.net> wrote:

> Responses to both Jay and George inline.
> 
> 
> On Wed, Nov 13, 2013 at 5:08 PM, Jay Pipes <jaypipes at gmail.com> wrote:
> Sorry for top-posting, but in summary, I entirely agree with George here. His logic is virtually identical to the concerns I raised with the initial proposal for Glance Tasks here:
> 
> http://lists.openstack.org/pipermail/openstack-dev/2013-May/009400.html
> and
> http://lists.openstack.org/pipermail/openstack-dev/2013-May/009527.html
> 
> In my understanding, your viewpoints are subtly different.
> 
> George seems to agree with representing ongoing asynchronous tasks through a separate 'tasks' resource. I believe where he differs with the current design is how those tasks are created. He seems to prefer creating tasks with POST requests to the affected resources. To distinguish between uploading an image and importing an image, he suggests we require a different content type in the request.
> 
> However, your main point in the links above seemed to be to reuse POST /v2/images, but to capture the asynchronous nature of image verification and conversion by adding more nodes to the image state machine.
> 
> 
> 
> Best,
> -jay
> 
> 
> On 11/13/2013 05:36 PM, George Reese wrote:
> Let’s preface this with Glance being the part of OpenStack I am least
> familiar with. Keep in mind my commentary is related to the idea that
> the asynchronous tasks as designed are being considered beyond Glance.
> The problems of image upload/import/cloning/export are unlike other
> OpenStack operations for the most part in that they involve binary data
> as the core piece of the payload.
> 
> Having said that, I’d prefer a polymorphic POST to the tasks API as
> designed.
> 
> Thanks. I think we'll move forward with this design for now in Glance. But your alternative below is compelling and we'll definitely consider as we add future tasks. I also want to say that we could probably completely adopt your proposal in the future as long as we also support backwards compatibility with the current design, but I can't predict at this point the practical concerns that will emerge.
>  
> But I’m much more concerned with the application of the tasks
> API as designed to wider problems.
> 
> I think this concern is very reasonable. Other projects should evaluate your proposal carefully.
>  
> 
> Basically, I’d stick with POST /images.
> 
> The content type should indicate what the server should expect.
> Basically, the content can be:
> 
> * An actual image to upload
> * Content describing a target for an import
> * Content describing a target for a clone operation
> 
> Implementation needs dictate whether any given operation is synchronous
> or asynchronous. Practically speaking, upload would be synchronous with
> the other two being asynchronous. This would NOT impact an existing
> /images POST as it will not change (unless we suddenly made it
> asynchronous).
> 
> The response would be CREATED (synchronous) or ACCEPTED (asynchronous).
> If ACCEPTED, the body would contain JSON/XML describing the asynchronous
> task.
> 
> I’m not sure if export is supposed to export to a target object store or
> export to another OpenStack environment. But it would be an async
> operation either way and should work as described above. Whether the
> endpoint for the image to be exported is the target or just /images is
> something worthy of discussion based on what the actual function of the
> export is.
> 
> -George
> 
> On Nov 12, 2013, at 5:45 PM, John Bresnahan <john at bresnahan.me
> <mailto:john at bresnahan.me>> wrote:
> 
> George,
> 
> Thanks for the comments, they make a lot of sense.  There is a Glance
> team meeting on Thursday where we would like to push a bit further on
> this.  Would you mind sending in a few more details? Perhaps a sample
> of what your ideal layout would be?  As an example, how would you
> prefer actions are handled that do not effect a currently existing
> resource but ultimately create a new resource (for example the import
> action).
> 
> Thanks!
> 
> John
> 
> 
> On 11/11/13, 8:05 PM, George Reese wrote:
> I was asked at the OpenStack Summit to look at the Glance Tasks,
> particularly as a general pattern for other asynchronous operations.
> 
> If I understand Glance Tasks appropriately, different asynchronous
> operations get replaced by a single general purpose API call?
> 
> In general, a unified API for task tracking across all kinds of
> asynchronous operations is a good thing. However, assuming this
> understanding is correct, I have two comments:
> 
> #1 A consumer of an API should not need to know a priori whether a
> given operation is “asynchronous”. The asynchronous nature of the
> operation should be determined through a response. Specifically, if
> the client gets a 202 response, then it should recognize that the
> action is asynchronous and expect a task in the response. If it gets
> something else, then the action is synchronous. This approach has the
> virtual of being proper HTTP and allowing the needs of the
> implementation to dictate the synchronous/asynchronous nature of the
> API call and not a fixed contract.
> 
> #2 I really don’t like the idea of a single endpoint (/v2/tasks) for
> executing all tasks for a particular OpenStack component. Changes
> should be made through the resource being impacted.
> 
> -George
> 
> --
> George Reese (george.reese at imaginary.com
> <mailto:george.reese at imaginary.com>)
> t: @GeorgeReese               m: +1(207)956-0217
> <tel:%2B1%28207%29956-0217>               Skype: nspollution
> 
> 
> 
> 
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> <mailto:OpenStack-dev at lists.openstack.org>
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> --
> George Reese (george.reese at imaginary.com
> <mailto:george.reese at imaginary.com>)
> t: @GeorgeReese               m: +1(207)956-0217
> <tel:%2B1%28207%29956-0217>               Skype: nspollution
> 
> 
> 
> 
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
George Reese (george.reese at imaginary.com)
t: @GeorgeReese               m: +1(207)956-0217               Skype: nspollution



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20131114/3885b80e/attachment.html>


More information about the OpenStack-dev mailing list