<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Is that because of the rollback actually creates version #3 that's<br>
"newer" but lacks the rolled-back commits?<br>
So there are some "merge" conflict if folks, that cloned #2, want to<br>
pull from version #3 but their branch contains a commit the origin<br>
lacks now?<br>
Or rather that the published bits of the version #2 doesn't exist<br>
anymore at all?</blockquote><div><br></div><div>The first one.  It would be like if someone force-pushed to the git repository, removing the last couple of commits of history.  It's basically the same problem.<br></div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span class="m_82625765169244713gmail-im">
</span>Does it mean a publication directory git tree is built anew every time<br>
a rollback happens?<br></div></blockquote><div><br></div><div>What it would have to do is take the existing git tree and apply new commits on top to return the contents of the repository to the state you want to roll it back to.<br></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"><div>So Pulp history and the original project history are meant to be different?<br>
Can there be ever conflicts?<br></div></blockquote><div><br></div><div>It's not that they're <i>meant</i> to be different, but I think it is an unavoidable problem if you want to do rollbacks in Pulp.<br></div><div><br></div><div>The source git repository for the project, whether it's on github or the admin's machine, is separate from Pulp's copy. The second you add a commit to one and not the other (by doing rollback w/ linear git history from the client's perspective), the histories will diverge.  It's unavoidable, that's just how git works.  You can keep the content of the files in the repo identical but the history will never be equivalent again.<br></div><div><br></div><div>Basically, it is mutually exclusive to have:<br></div><div><br></div><div>* Pulp not be the "master" git repository e.g. the admin is syncing / uploading it from somewhere else<br></div><div>* maintain linear git history</div><div>* be able to do rollbacks in Pulp</div><div>* keep identical git history between Pulp and the git repository being synced / uploaded into Pulp<br></div><div><br></div><div>One of them has to give.<br></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 28, 2018 at 8:01 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"><div class="HOEnZb"><div class="h5">On Sat, May 26, 2018 at 2:23 AM, Daniel Alley <<a href="mailto:dalley@redhat.com">dalley@redhat.com</a>> wrote:<br>
> @Brian<br>
><br>
> I agree with a lot of those points, but I would say that we're not just<br>
> competing against hodgepodge collections of "scripts", but also against<br>
> writing small microservice-y Flask apps that only implement the API for one<br>
> content type.<br>
><br>
> Also, rollback is not something Pulp would necessarily be able to offer with<br>
> respect to history-sensitive content and metadata, like git repositories, or<br>
> the Cargo example I provided.  It's still something the plugin writer would<br>
> have to implement themselves in this case.<br>
><br>
> @Jeff<br>
><br>
>> perhaps a new component of a Publication like PublishedDirectory that<br>
>> references an OSTree/Git repository created in /var/lib/pulp/published.<br>
><br>
><br>
> I like the idea generally, but I don't think it would be able to be a<br>
> component of a Publication.  I think it would need to be an alternative to a<br>
> Publication which fulfills a similar function.<br>
><br>
> The fundamental problem is this scenario:<br>
><br>
> You upload a git repository with a git repository plugin<br>
> You publish and distribute version 1 of the git repository<br>
> You publish and distribute version 2 of the git repository<br>
> A client downloads the git repository<br>
> You notice a problem and decide to roll back to version 1.  A publication of<br>
> version 1 already exists, which you distribute.<br>
> Clients have a broken git history.  New clients can download the old version<br>
> but anyone who has already downloaded version 2 will not be able to roll<br>
> back to version 1 by pulling from Pulp<br>
<br>
</div></div>Just trying to understand the situation:<br>
Is that because of the rollback actually creates version #3 that's<br>
"newer" but lacks the rolled-back commits?<br>
So there are some "merge" conflict if folks, that cloned #2, want to<br>
pull from version #3 but their branch contains a commit the origin<br>
lacks now?<br>
Or rather that the published bits of the version #2 doesn't exist<br>
anymore at all?<br>
<span class=""><br>
><br>
> We need to prevent step 5 from happening.<br>
><br>
> There are a couple of possible solutions to this problem:<br>
><br>
> As a Pulp admin, you ignore Pulp's rollback functionality.  Instead of using<br>
> Pulp to roll back, you manually revert the commits using git, and upload a<br>
> new version of the repository to Pulp as "version 3".  You then distribute<br>
> version 3 instead of version 1.  You understand that if you were to publish<br>
> and old version using Pulp, it would misbehave for clients that tried to<br>
> pull / update instead of cloning.<br>
<br>
</span>In my opinion folks needing Pulp to track a git(-like) repo are<br>
probably interested in more workflows than just the clone.<br>
<span class=""><br>
><br>
> As a Pulp admin / plugin writer / user, you know that the client for the<br>
> content type will never try to pull or update, only clone.  Therefore it is<br>
> not a problem for you and can be ignored.<br>
<br>
</span>The cloning might be equivalent of just snapshotting the tree at a<br>
particular commit and just publishing a plain tar.gz w/o the git<br>
structures.<br>
Limiting but clean?<br>
<span class=""><br>
><br>
> As a Plugin writer, whenever you publish a new version of the git<br>
> repository, you delete or invalidate every publication for previous versions<br>
> for the distribution base path.  If a Pulp admin wants to roll back, they<br>
> need to create a new Publication.  The Plugin knows to apply revert commits<br>
> on top of the repository to keep history linear.<br>
><br>
> But really we've just pushed the problem forwards.  What happens when you<br>
> want to upload future versions?  Now history of the git repository in Pulp<br>
> is different from the Pulp admin's git repo history<br>
> This is only acceptable for content types where the history is immaterial to<br>
> the content itself. Probably viable for Cargo, but probably not a Git<br>
> content type.<br>
><br>
<br>
</span>Does it mean a publication directory git tree is built anew every time<br>
a rollback happens?<br>
So Pulp history and the original project history are meant to be different?<br>
Can there be ever conflicts?<br>
<span class=""><br>
<br>
> As a Plugin writer, you ignore publications entirely.  You don't make it<br>
> possible to do the wrong thing. You have something along the lines of a<br>
> "PluginManagedDirectory" which core does not try to mess with.  If you want<br>
> to implement rollback functionality, you do it through your own API where<br>
> the side effects are more easily controlled and reasoned about.<br>
<br>
</span>+1 seems like the cleanest way to me<br>
<span class=""><br>
><br>
> I have doubts about whether Option 3 is viable - it seems like making it<br>
> work reliably would be difficult.<br>
<br>
</span>I'd say option #1 and #3 are the same, #3 adding the complexity of<br>
automating the rollback in Pulp,<br>
option #2 and #4 are the same in the sense of Pulp staying away from<br>
the incompatible workflow a content type has while providing a limited<br>
functionality subset to the consumer. In addition, #4 allows for Pulp<br>
service/host to provide both the Pulp-specific, limited functionality<br>
as well as the incompatible, content-type specific workflows from a<br>
"single" point. This might be a benefit to some folks.<br>
<br>
<br>
Option #5: somehow make core Pulp (content versioning) compatible with<br>
the Git model ;)<br>
<br>
--<br>
milan<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> On Fri, May 25, 2018 at 5:05 PM, Brian Bouterse <<a href="mailto:bbouters@redhat.com">bbouters@redhat.com</a>> wrote:<br>
>><br>
>> I think Pulp does have enough value proposition over a script-based<br>
>> alternative to make it worthwile for all of those types of plugins. Here are<br>
>> a few points I think about:<br>
>><br>
>> * scalability. A common story users tell is that scripts work well up<br>
>> until a point. Doing it for an entire organization, or when content comes<br>
>> from many places, or with more than a few people involved in maintaining the<br>
>> content, it becomes unmaintainable.<br>
>><br>
>> * Stacks of content. Often a group of content goes together, but each<br>
>> piece of content is updated separately. For instance with Ansible roles, you<br>
>> may use many of them together to deploy something, but each role may receive<br>
>> changes separately. I think of all this content together as a "stack".<br>
>> Keeping everything up to date can be challenging. Managing that change with<br>
>> scripts can be hard and fragile. Also the ability to rollback quickly an<br>
>> confidently is something Pulp can offer.<br>
>><br>
>> * Organizing content is easier. Having an API that you can use to organize<br>
>> content is easier than doing lots and lots of git yourself or with scripts.<br>
>><br>
>> * Tasking. Long running tasks (and a lot of them) can be unweildy, and<br>
>> Pulp makes that very organized and run very well.<br>
>><br>
>> * Static and vulnerability analysis. We're seeing interest in using<br>
>> analysis projects like Clair (<a href="https://github.com/arminc/clair-scanner" rel="noreferrer" target="_blank">https://github.com/arminc/<wbr>clair-scanner</a>) to<br>
>> scan content in Pulp. By bringing all the content into one place, and that<br>
>> place having a tasking system that plugin writers can control how their<br>
>> content can be analyzed continuously.<br>
>><br>
>> Also +1 to jortel's idea. I think that's a great idea and exactly what we<br>
>> need.<br>
>><br>
>><br>
>> On Thu, May 24, 2018 at 1:33 PM, Jeff Ortel <<a href="mailto:jortel@redhat.com">jortel@redhat.com</a>> wrote:<br>
>>><br>
>>><br>
>>><br>
>>> On 05/17/2018 07:46 AM, Daniel Alley wrote:<br>
>>><br>
>>> Some content types are not going to be compatible with the normal<br>
>>> sync/publish/distribute Pulp workflows, and will need to be live API-only.<br>
>>> To what degree should Pulp accomodate these use cases?<br>
>>><br>
>>> Example:<br>
>>><br>
>>> Pulp makes the assumptions that<br>
>>><br>
>>> A) the metadata for a repository can be generated in its entirety by the<br>
>>> known set of content in a RepositoryVersion, and<br>
>>><br>
>>> B) the client wouldn't care if you point it at an older version of the<br>
>>> same repository.<br>
>>><br>
>>> Cargo, the package manager for the Rust programming language, expects the<br>
>>> registry url to be a git repository.  When a user does a "cargo update",<br>
>>> cargo essentially does a "git pull" to update a local copy of the registry.<br>
>>><br>
>>> Both of those assumptions are false in this case. You cannot generate the<br>
>>> git history just from the set of content, and you cannot "roll back" the<br>
>>> state of the repository without either breaking it for clients, or adding<br>
>>> new commits on top.<br>
>>><br>
>>> A theoretical Pulp plugin that worked with Cargo would need to ignore<br>
>>> almost all of the existing Pulp primitives and very little (if any) of the<br>
>>> normal Pulp workflow could be used.<br>
>>><br>
>>> Should Pulp attempt to cater to plugins like these?  What could Pulp do<br>
>>> to provide a benefit for such plugins over writing something from scratch<br>
>>> from the ground up?  To what extent would such plugins be able to integrate<br>
>>> with the rest of Pulp, if at all?<br>
>>><br>
>>><br>
>>> I think OSTree and Ansible plugins will be in the same boat as Cargo.  In<br>
>>> the case of OSTree, libostree does the heavy lifting for sync and publishing<br>
>>> and I suspect the same is true for Git based repositories.  We should<br>
>>> consider way to best support distributing (serving) content in core for<br>
>>> these content types.  I suspect this will mainly entail something in the<br>
>>> content app and perhaps a new component of a Publication like<br>
>>> PublishedDirectory that references an OSTree/Git repository created in<br>
>>> /var/lib/pulp/published.  This may benefit Maven as well.<br>
>>><br>
>>><br>
>>><br>
>>> We don't have to commit to anything pre-GA but it is a good thing to keep<br>
>>> in mind.  I'm sure there are other content types out there (not just Cargo)<br>
>>> which would face similar problems.  pulp_git was inquired about a few months<br>
>>> ago, it seems like it would share a few of them.<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>
>>><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>
>>><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>
>><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>
><br>
</div></div></blockquote></div><br></div>