<div dir="ltr">Thanks for you comments Stuart!<div><br></div><div>I also have some thoughts on this matter: first of all, I never liked how locations are implemented in glance v2, and not just because of inconsistencies in multiple locations per one image, but for the reason that there are no differences between internal and external locations. </div><div>So, I think we're on right track with glare's implementation. But I suppose we can improve it even more:  in my understanding, the service generally does not work with external data. I will try to explain with an example:</div><div><br></div><div>Let's assume that we have a link to external ubuntu image ( <a href="http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso">http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso</a> ). When user adds this link to his image artifact, Glare doesn't validate it, it just creates a blob instance in DB (optionally user may specify a checksum).</div><div>When user requests 'show' on his image, the blob url will look like this: {"url": "<a href="http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso">http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso</a>"}, and if user wants to download it, the image won't be proxied with glare - it will be a direct download from <a href="http://ubuntu.com">ubuntu.com</a> from the client.</div><div><br></div><div>In case of internal locations their urls are {"url": "/artifacts/images/<image_id>/file"} and these downloads are done with Glare as a proxy between the client and internal cloud storage, like Swift. </div><div><br></div><div>For compatibility, internal urls should work with external blobs as well, but there will be a redirect to the external url: "/artifacts/images/<image_id>/file" -> "<a href="http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso">http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso</a>".</div><div><br></div><div>We can discuss it on the artifact meeting at 1730 UTC on Mondays at #openstack-meeting-alt</div><div><br></div><div>Best,</div><div>Mike</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 2, 2016 at 1:16 PM,  <span dir="ltr"><<a href="mailto:stuart.mclaren@hp.com" target="_blank">stuart.mclaren@hp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Kairat,<br>
<br>
I think it's great to try and tease through the various issues here.<br>
I added some comments to the etherpad.<br>
<br>
-Stuart<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Hello all,<br>
<br>
I would like to start to describe some design decisions we made in Glare<br>
code (<a href="https://review.openstack.org/#/q/topic:bp/glare-api+status:open" rel="noreferrer" target="_blank">https://review.openstack.org/<wbr>#/q/topic:bp/glare-api+status:<wbr>open</a>).  If<br>
you are not familiar with Glare I suggest you to read the following spec:<br>
<br>
<a href="https://github.com/openstack/glance-specs/blob/master/specs/newton/approved/glance/glare-api.rst" rel="noreferrer" target="_blank">https://github.com/openstack/g<wbr>lance-specs/blob/master/specs/<wbr>newton/approved/glance/glare-<wbr>api.rst</a><br>
<br>
I hope it will help other folks to understand Glare approach and provide<br>
some constructive feedback for Glare. I think that we can also use Glare<br>
solution for Glance in near future to address some drawbacks we have in<br>
Glance.<br>
<br>
Glare locations<br>
<br>
Glance and Glare have possibility to set some external url as<br>
image(artifact) location. This feature is quite useful for users who would<br>
like to refer to some external image or artifact (for example, Fedora image<br>
on official Fedora site) and not to store this image or artifact in the<br>
cloud.<br>
<br>
External locations in Glance have several specialities:<br>
<br></span>
  1.<span class=""><br>
<br>
  It is possible to setup multiple locations for an image. Glance uses<br>
  special location strategy to define which location to use. This strategy<br>
  defined in glance codebase and can be configured in glance conf.<br></span>
  2.<br>
<br>
  Glance doesn?t differ image locations specified by url and image<span class=""><br>
  locations uploaded to Glance backend. Glance has some restrictions about<br>
  which urls to use for locations (see Glance docs for more info).<br>
<br>
<br>
Glare external locations designed in different way to address some<br>
drawbacks we have in Glance. So the approach is the following:<br>
<br></span>
  1.<br>
<br>
  Glare doesn?t support multiple locations, you can specify dict of blobs<span class=""><br>
  in artifact type and add url for each blob in dict. User must define a<br>
  name(f.e. region name or priority) for blob in dict and this name can be<br>
  used to retrieve this blob from artifact. So decision about which location<br>
  to use will be outside of Glare.<br></span>
  2.<span class=""><br>
<br>
  Glare adds a special flag to database for external locations. So they<br>
  will be treated differently in Glare when delete artifact. If blob value is<br></span>
  external url then we don?t need to pass this url to backend and just delete<span class=""><br>
  the record in DB. For now, Glare allows only http(s) locations set but it<br>
  may be extended in future but the idea still the same: external location<br>
  are just records in DB.<br></span>
  3.<span class=""><br>
<br>
  Glare saves blob size and checksum when specifying external url. When<br>
  user specified url Glare downloads the blob by url, calculates its size and<br>
  checksum. Of course, it leads to some performance degradation but we can<br>
  ensure that the external blob is immutable. We made this because security<br>
  seems more important for Glare than performance. Also there are plans to<br>
  extend this approach to support subscriptions for external locations so we<br>
  can increase secureness of that operation.<br>
<br>
<br>
I think that some of the features above can be implemented in Glance. For<br>
example, we can treat our locations as only read-only links if external<br>
flag will be implemented.  It will allow us to ensure that only blobs<br>
uploaded through the Glance will be managed.<br>
<br>
Additionally, if we will calculate checksum and size for external urls, we<br>
can ensure that  all multiple locations refers to the same blob. So<br>
management of multiple locations(deletion/creation) can be more secure.<br>
Also we can ensure that the external url blob was not changed.<br>
<br>
I understand that we need a spec for that but I would like to discuss this<br>
at high level first. Here is etherpad for discussion:<br>
<a href="https://etherpad.openstack.org/p/glare-locations" rel="noreferrer" target="_blank">https://etherpad.openstack.org<wbr>/p/glare-locations</a><br>
<br>
<br>
Best regards,<br>
Kairat Kushaev<br></span>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.openstack.org/pipermail/openstack-dev/attachments/20160801/5e88c6c1/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.openstack.org/pi<wbr>permail/openstack-dev/attachme<wbr>nts/20160801/5e88c6c1/attachme<wbr>nt-0001.html</a>><br>
<br>
------------------------------<br>
<br>
______________________________<wbr>_________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.<wbr>org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-dev</a><br>
<br>
<br>
End of OpenStack-dev Digest, Vol 52, Issue 2<br>
******************************<wbr>**************<br>
<br>
</blockquote>
<br>
______________________________<wbr>______________________________<wbr>______________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.op<wbr>enstack.org?subject:unsubscrib<wbr>e</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-dev</a><br>
</blockquote></div><br></div>