<div dir="ltr">Just to be clear, neither of these solutions were intended to solve these user stories. To me, the immediate need that prompted this discussion was to answer the question "how do we store created objects on tasks?" This is for task #3033[0]. My goal was to design just enough to answer that question. <div><br></div><div>[0] <a href="https://pulp.plan.io/issues/3033" target="_blank">https://pulp.plan.io/<wbr>issues/3033</a></div><div class="gmail_extra"><br clear="all"><div><div class="m_5300337663613357202gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br></div><div>David<br></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Tue, Nov 14, 2017 at 3:24 PM, Jeff Ortel <span dir="ltr"><<a href="mailto:jortel@redhat.com" target="_blank">jortel@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 11/14/2017 01:24 PM, Brian Bouterse wrote:<br>
> Thanks for all the discussion! I agree there are improvements to be made here.<br>
><br>
> I don't think either of these proposals solve all the problems without creating a few new ones. Rather than<br>
> saying +1 to either, I want to talk about the goals and use cases a bit more. Here is a list of 3 related use<br>
> cases that Pulp currently *can't* do, along with some commentary on the state of why. Once we decide on what<br>
> we think users need, figuring out how to make it should be straightforward.<br>
><br>
> 1) As a user, I can know if a task is current locking a worker or not. Say they need to take a worker offline.<br>
> They have no way of knowing if that is safe to do at this moment without this info. Pulp internally knows this<br>
> information, but I don't believe this is visible to the user currently. This is useful info for debugging that<br>
> we regularly have to pull from the db. Regardless of either proposal, we still need to decide if this will be<br>
> included in the Task viewset. I'm +1 to adding this use case to the MVP explicitly. Do people feel this use<br>
> case should be added to the MVP?<br>
<br>
</span>+1<br>
<span><br>
><br>
> 2) As a user, I can filter for tasks by the resource locked, e.g. repo 'foo', without forming a special search<br>
> string to search by. Currently the 'resource' field in the TaskTag model stores a string like<br>
> 'repository:foo'. Even if you know the name 'foo' you need to search via substring (inefficient and maybe<br>
> dangerous).You also can't search by other properties like the UUID, feed, etc because to Pulp it's just a<br>
> string 'repository:foo'. It doesn't know that is actually repository xxxxx-yyyy-yyyy-zzzzzzz with a name='foo'.<br>
<br>
</span>I would like to see this use case expanded (into several cases) to include a description of why a user wants<br>
to do this.  What are they trying to accomplish.  Like: "As a user, I want to search for tasks pending for a<br>
repository because I'm trying to understand why my task isn't running yet."<br>
<br>
This applies to #3 as well.<br>
<span><br>
><br>
> 3) As a user, I can filter for tasks by operation type (e.g. sync). Currently we have no way to do this. The<br>
> data model doesn't even have a field to capture this information. This feature seems simple from a high level,<br>
> but determining the specific taxonomy of those operation types it can get messy. We have 'sync' and 'publish',<br>
> those are pretty clear. What about 'update' like a publisher/importer/repo attribute update? How about 'add'<br>
> and 'remove' content? What if both add and remove happen in the same operation? Is that two tags or a new one?<br>
> If we're going to talk about this feature we need to call out the use cases more specifically. A series of use<br>
> cases like: "As a user, I can filter for tasks labeled with the 'sync' operation" could work.<br>
><br>
> Another way to accomplish use case (3) is to record the actual task name as a string, e.g.<br>
> 'pulpcore.app.tasks.importer.s<wbr>ync'. This won't work well either because we DRY up our tasks, especially<br>
> update, so I think the simple taxonomy is still the way forward for that feature. <a href="https://pulp.plan.io/issues/3038" rel="noreferrer" target="_blank">https://pulp.plan.io/issues/30<wbr>38</a><br>
<br>
</span>Agreed.  Exposing and relying on an implementation detail like "pulpcore.app.tasks.importer.s<wbr>ync" would be bad.<br>
<span><br>
><br>
> Each proposal affects these use cases, but neither of them totally enables all of them. Aside from solving<br>
> them, what do others thing about these use cases and the current state of Pulp3 w.r.t them? Thanks for all the<br>
> discussion.<br>
><br>
> -Brian<br>
><br>
><br>
</span>> On Thu, Nov 9, 2017 at 3:43 PM, Dennis Kliban <<a href="mailto:dkliban@redhat.com" target="_blank">dkliban@redhat.com</a> <mailto:<a href="mailto:dkliban@redhat.com" target="_blank">dkliban@redhat.com</a>>> wrote:<br>
<div><div class="m_5300337663613357202h5">><br>
>     On Mon, Nov 6, 2017 at 2:17 PM, David Davis <<a href="mailto:daviddavis@redhat.com" target="_blank">daviddavis@redhat.com</a> <mailto:<a href="mailto:daviddavis@redhat.com" target="_blank">daviddavis@redhat.com</a>><wbr>> wrote:<br>
><br>
>         Originally I scheduled a meeting for tomorrow but on second thought, I figured a pulp-dev thread would<br>
>         be more inclusive than a meeting. I hope to get this resolved by the end of this week and if not then<br>
>         maybe we can have a meeting.<br>
><br>
>         This is to design out the replacement of task tags in Pulp 3. I’ve got feedback from a few other<br>
>         developers in terms of how to do that so I wrote up a sort of outline of the problem and two possible<br>
>         proposals. Looking for feedback/questions/etc on what people prefer.<br>
><br>
><br>
>         Background<br>
>         ---<br>
><br>
>         In Pulp 2, tasks have tags that either provide a task name/description or info on what resources a<br>
>         task acts on. Tasks also have reserved resources, which provide a way for tasks to lock a particular<br>
>         resource.<br>
><br>
>         In Pulp 3, we have models TaskTag and ReservedResource[0]. Tasks are associated with the resources<br>
>         they work on via TaskTag. If a resource is locked, a ReservedResource record is created in the db and<br>
>         then removed from the db once the resource is unlocked.<br>
><br>
><br>
>         Problem<br>
>         ---<br>
><br>
>         The task tag model doesn't really fit Pulp 3. It's perhaps too generic and totally unnecessary (see<br>
>         Proposal 1), or it could be redesigned to accomodate other things (see Proposal 2).<br>
><br>
>         Also, we need to support created resources (e.g. publications) with tasks. Refactoring task tags might<br>
>         provide an opportunity to do so.<br>
><br>
><br>
>         User stories<br>
>         ---<br>
><br>
>         As an authenticated user, I can see what resource(s) a task acted on.<br>
>         As an authenticated user, I can search for a tasks based on what resource they acted on.<br>
><br>
><br>
>         Proposal 1<br>
>         ---<br>
><br>
>         Since tags and reserved resources in Pulp 3 will only store information about a particular repository<br>
>         (not 100% sure here), it should be possible to simplify the data model. We could ditch both TaskTag<br>
>         and ReservedResource models and just have a direct relationship between Tasks and Repositories (e.g.<br>
>         TaskRepository). This model could also have some sort of field to indicate whether a particular field<br>
>         is locked (e.g. is_locked). Unlike ReservedResource, this relationship would be persisted—only the<br>
>         is_locked field would be updated when a task is done.<br>
><br>
><br>
>         Proposal 2<br>
>         ---<br>
><br>
>         We could keep the TaskTag relationship (perhaps even rename it to TaskResource) and we could add a<br>
>         field to indicate the nature of the relationship between task and resource (e.g. created, updated,<br>
>         etc). This field could not only capture what TaskTag is currently used for but also stuff like created<br>
>         resources (e.g. publications). We could also have a field to indicate which task resources are locked<br>
>         (e.g. is_locked).<br>
><br>
><br>
>     I like proposal number 2.<br>
><br>
><br>
><br>
</div></div>>         This would be useful for <a href="https://pulp.plan.io/issues/3033" rel="noreferrer" target="_blank">https://pulp.plan.io/issues/30<wbr>33</a> <<a href="https://pulp.plan.io/issues/3033" rel="noreferrer" target="_blank">https://pulp.plan.io/issues/3<wbr>033</a>>.<br>
<span>><br>
><br>
>         Questions<br>
>         ---<br>
><br>
>         - What proposal do we want to adopt?<br>
>         - When do we need to address these changes?<br>
>         - Do we really need to allow users to search tasks by a resource/repo at all?<br>
><br>
><br>
>         [0] <a href="https://git.io/vF8iH" rel="noreferrer" target="_blank">https://git.io/vF8iH</a><br>
><br>
>         David<br>
><br>
>         _____________________________<wbr>__________________<br>
>         Pulp-dev mailing list<br>
</span>>         <a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a> <mailto:<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a>><br>
>         <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailma<wbr>n/listinfo/pulp-dev</a> <<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailma<wbr>n/listinfo/pulp-dev</a>><br>
><br>
><br>
><br>
>     _____________________________<wbr>__________________<br>
>     Pulp-dev mailing list<br>
>     <a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a> <mailto:<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a>><br>
>     <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailma<wbr>n/listinfo/pulp-dev</a> <<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailma<wbr>n/listinfo/pulp-dev</a>><br>
<div class="m_5300337663613357202HOEnZb"><div class="m_5300337663613357202h5">><br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> Pulp-dev mailing list<br>
> <a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/pulp-dev</a><br>
><br>
<br>
</div></div><br>______________________________<wbr>_________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/pulp-dev</a><br>
<br></blockquote></div><br></div></div>