Hi Dan and Stéphane,

thank you very much for the support.

So, what is the solution choice?

Probably, the better choice is `urls` or `mirrors` so it's possible
inside LXD code handle failover with a secondary mirror.

So, for a recap:

Solution a)

{
 "datatype": "image-downloads",
 "updated": "Sat, 04 May 2013 01:58:57 +0000",
 "content_id": "sabayon:images:download",
 "products": {
  "sabayon:0.1:arm": {
   "arch": "arm",
   "stream": "devel",
   "versions": {
    "20190111": {
     "items": {
      "uec.tar.gz": {
       "ftype": "lxc.tar.gz",
       "urls": [
           "http://mymirror.edu/lxd-images/sabayon/myimages.tar.gz";,
           "http://mymirror2.edu/lxd-images/sabayon/myimages.tar.gz";
       ],
       "sha256": "xxxxxx",
       "md5": "797e2d488c799eab0a8eb09a9c1ff4a3",
       "size": 7314153
      },
...
}

>From LXD client-side the logic could be that if `urls` is not empty I
get a random entry from url array and I try to fetch image else use path
field as now.

Solution b)

{
 "datatype": "image-downloads",
 "updated": "Sat, 04 May 2013 01:58:57 +0000",
 "content_id": "sabayon:images:download",
 "products": {
  "sabayon:0.1:arm": {
   "arch": "arm",
   "stream": "devel",
   "versions": {
    "20190111": {
     "items": {
      "uec.tar.gz": {
       "ftype": "lxc.tar.gz",
       "path": "/lxd-images/sabayon/myimage.tar.gz",
       "mirrors": [
           "http://mymirror.edu";,
           "http://mymirror2.edu/sabayon/";
       ],
       "sha256": "xxxxxx",
       "md5": "797e2d488c799eab0a8eb09a9c1ff4a3",
       "size": 7314153
      },
...
}

With this solution, `mirrors` contains the hostname with an optional
prefix and from LXD client-side if mirrors have values then a random
field of mirrors field is used and value of path field is used for
creating image URL (mirrors[0]+path)

Please, let me know how we want to proceed so I try to push a PR to LXD
project after my holidays.

Thanks again.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1833435

Title:
  RFC: Add url/urls/mirrors attribute for product items

To manage notifications about this bug go to:
https://bugs.launchpad.net/simplestreams/+bug/1833435/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to