<div dir="ltr"><div>I just submitted a PR[0] for uploading Artifacts. The API supports creating Artifacts, listing all Artifacts, and viewing details of an Artifact. Updates of Artifacts via REST API are disabled. On upload of a file, all possible checksums are calculated and compared to any checksums provided by the user. Any inconsistencies are raised as validation errors.<br><br></div>I am now starting to work on the story[1] #2872 for creating Content units from Artifacts. <br><div><div class="gmail_extra"><br><br>[0] <a href="https://github.com/pulp/pulp/pull/3080">https://github.com/pulp/pulp/pull/3080</a><br>[1] <a href="https://pulp.plan.io/issues/2872">https://pulp.plan.io/issues/2872</a><br><br><div class="gmail_quote">On Thu, Jul 6, 2017 at 6:23 PM, Dennis Kliban <span dir="ltr"><<a href="mailto:dkliban@redhat.com" target="_blank">dkliban@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I added 2 more stories based on the discussion we've had so far. Please provide feedback here or on the tickets.<br><br><a href="https://pulp.plan.io/issues/2872" target="_blank">https://pulp.plan.io/issues/28<wbr>72</a><br><a href="https://pulp.plan.io/issues/2873" target="_blank">https://pulp.plan.io/issues/28<wbr>73</a><br></div><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 30, 2017 at 2:23 PM, Brian Bouterse <span dir="ltr"><<a href="mailto:bbouters@redhat.com" target="_blank">bbouters@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>@jortel I think what you've written is what we should do. I think we can get a race-condition free implementation with this many-to-many table with the database transaction including the the filesystem operations. +1 to adding the relative path to the join table also.<br><br></div>I'm also not sure about including <name> in File.path <--- FileField:  MEDIA_ROOT/files/digest[0:2]/d<wbr>igest[2:]/<name>  If there were collisions, having <name> would allow you to store two Files with different contents but the same hash. It's highly, highly improbable even if Pulp is storing billions of files, but it could happen. A content addressable store (not including <name>) would never be able to handle this case.<br><br>Even still, I think we should disinclude the name from the path to the Artifact and just have it be the digest. Having a fully addressable File storage will be awesome, and a bit more complex code in core is worth it (I think). FWIW, I also don't think it will be that hard to get right.<br><br></div>As a side point, I think when a file with the same sha256 is uploaded a second time it should be rejected rather than silently accepting it.<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="gmail-m_8686761943892371789h5">On Fri, Jun 30, 2017 at 12:00 PM, Jeff Ortel <span dir="ltr"><<a href="mailto:jortel@redhat.com" target="_blank">jortel@redhat.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-m_8686761943892371789h5">Ah, I missed adding the relative path to the join table.  This is a fine idea as well.<br>
<div class="gmail-m_8686761943892371789m_-7422510997084026670HOEnZb"><div class="gmail-m_8686761943892371789m_-7422510997084026670h5"><br>
On 06/30/2017 10:15 AM, Michael Hrivnak wrote:<br>
><br>
> Jeff, earlier in the thread we talked about using the through table to hold the path. I think that's the right<br>
> place, because the path would be a property of the relationship between an artifact and a content unit. It<br>
> also occurred to me that the file name could be different for different content, so maybe the path would need<br>
> to include the filename. That seems a bit weird, but I think it has to be the case if we use a many-to-many<br>
> relationship.<br>
<br>
</div></div><br></div></div><span>______________________________<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></span></blockquote></div><br></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></div></blockquote></div><br></div></div></div>