<div dir="ltr"><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br class="m_-4729726215603621045gmail-Apple-interchange-newline">1. There is redundant "differencing" code in all plugins. The Changeset interface requires the plugin writer to determine what units need to be added and those to be removed. This requires all plugin writers to write the same non-trivial differencing code over and over. For example, you can see the same non-trivial differencing code present in<span> </span><a href="https://github.com/pulp/pulp_ansible/blob/d0eb9d125f9a6cdc82e2807bcad38749967a1245/pulp_ansible/app/tasks/synchronizing.py#L217-L306" style="color:rgb(17,85,204)" target="_blank">pulp_ansible</a>,<span> </span><a href="https://github.com/pulp/pulp_file/blob/30afa7cce667b57d8fe66d5fc1fe87fd77029210/pulp_file/app/tasks/synchronizing.py#L114-L193" style="color:rgb(17,85,204)" target="_blank">pulp_file</a>, and<span> </span><a href="https://github.com/pulp/pulp_python/blob/066d33990e64b5781c8419b96acaf2acf1982324/pulp_python/app/tasks/sync.py#L172-L223" style="color:rgb(17,85,204)" target="_blank">pulp_python</a>. Line-wise, this "differencing" code makes up a large portion (maybe 50%) of the sync code itself in each plugin.<br></blockquote><div><br></div><div>I agree that core could provide some of this logic. However, I'm not sure that the changeset is the right scope. The more monolithic the tool, the less flexible we will be, so I hope that we can provide a tool that is separate from the changeset. This way, a plugin can determine for themselves what needs to be added and removed, if the general way doesn't work for them. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2. Plugins can't do end-to-end stream processing. The Changesets themselves do stream processing, but when you call into changeset.apply_and_drain() you have to have fully parsed the metadata already. Currently when fetching all metadata from Galaxy, pulp_ansible takes about 380 seconds (6+ min). This means that the actual Changeset content downloading starts 380 seconds later than it could. At the heart of the problem, the fetching+parsing of the metadata is not part of the stream processing.<br class="m_-4729726215603621045gmail-Apple-interchange-newline"></blockquote><div><br></div><div>I can see how this isn't ideal, curious to see how you would address it.</div><div> <br></div></div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"></span><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 9, 2018 at 5:38 AM, Milan Kovacik <span dir="ltr"><<a href="mailto:mkovacik@redhat.com" target="_blank">mkovacik@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Brian,<br>
<br>
thanks for the proposal!<br>
<span class=""><br>
On Fri, Apr 6, 2018 at 4:15 PM, Brian Bouterse <<a href="mailto:bbouters@redhat.com">bbouters@redhat.com</a>> wrote:<br>
> Several plugins have started using the Changesets including pulp_ansible,<br>
> pulp_python, pulp_file, and perhaps others. The Changesets provide several<br>
> distinct points of value which are great, but there are two challenges I<br>
> want to bring up. I want to focus only on the problem statements first.<br>
><br>
> 1. There is redundant "differencing" code in all plugins. The Changeset<br>
> interface requires the plugin writer to determine what units need to be<br>
> added and those to be removed. This requires all plugin writers to write the<br>
> same non-trivial differencing code over and over. For example, you can see<br>
> the same non-trivial differencing code present in pulp_ansible, pulp_file,<br>
> and pulp_python. Line-wise, this "differencing" code makes up a large<br>
> portion (maybe 50%) of the sync code itself in each plugin.<br>
<br>
</span>+1; DRY is always better<br>
<span class=""><br>
><br>
> 2. Plugins can't do end-to-end stream processing. The Changesets themselves<br>
> do stream processing, but when you call into changeset.apply_and_drain() you<br>
> have to have fully parsed the metadata already. Currently when fetching all<br>
> metadata from Galaxy, pulp_ansible takes about 380 seconds (6+ min). This<br>
> means that the actual Changeset content downloading starts 380 seconds later<br>
> than it could. At the heart of the problem, the fetching+parsing of the<br>
> metadata is not part of the stream processing.<br>
><br>
> Do you see the same challenges I do? Are these the right problem statements?<br>
> I think with clear problem statements a solution will be easy to see and<br>
> agree on.<br>
<br>
</span>Totally, esp. on these, easier-to-see-the-value-of ones.<br>
<br>
Cheers,<br>
milan<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Thanks!<br>
> Brian<br>
><br>
> ______________________________<wbr>_________________<br>
> Pulp-dev mailing list<br>
> <a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
><br>
<br>
______________________________<wbr>_________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
</div></div></blockquote></div><br></div>