lxd-ui icon indicating copy to clipboard operation
lxd-ui copied to clipboard

Allow additional simplestream remotes via the ui

Open MrDaGree opened this issue 1 year ago • 2 comments

Unfortunately in its current state, the web ui only allows for the Ubuntu and LinuxContainers simplestreams to be accessible via the web ui. It would be nice if there was some way to allow additional remotes to be used. This then could also expand to have a remote dropdown in the ui when selecting an image.

I had a few ideas. The first would be based on a user.* config setting on the current project the user is attempting to make the instance in. The config setting could be something similar to user.remote.0: https://mysimplestream.remote.com where we can infinitely create additional remotes. You could also define a remote's name via user.remote.0.name: mysimplestream

The other idea was to use the global remote's settings via the lxd api* so then the additional remotes could be accessed from the web ui.

  • * - would have to be implemented to core lxd api

MrDaGree avatar Jul 08 '23 02:07 MrDaGree

Thank you for the request.

You can use a custom image server and select a custom image via the YAML input of the instance launch in the UI (see attached screen below). I understand that is not the "full support" one would expect from a UI.

We are planning to add custom ISO image upload and usage for new instances in some weeks. I think it makes sense to address the custom simplestream support at the same time. Both touch the image selection on instance creation.

One problem with custom image servers is they don't provide a list of images. So the UI can render two text inputs for 1. server address and 2. the image. I like the idea of using user.* values to store config for the UI. That would be one way to manage the custom servers and images. I am not sure if the profile is the right place for it, though. Also user values will be out of date if the custom server changes. I think there is no way to explore the images on a given simplestreams server address, is there?

Screenshot from 2023-07-10 10-09-07

edlerd avatar Jul 10 '23 10:07 edlerd

You can use a custom image server and select a custom image via the YAML input of the instance launch in the UI (see attached screen below). I understand that is not the "full support" one would expect from a UI.

neat! I failed to realize that wasnt hard coded to the Canonical/Linux Containers simplestreams

One problem with custom image servers is they don't provide a list of images. ... I think there is no way to explore the images on a given simplestreams server address, is there?

From my understanding of how simplestreams works, it does in the streams/v1/index.json but that doesnt contain the aliases, variants, etc needed for LXD. I also had this thought while reading over your response that it would be convenient if the LXD api would return its cached (I think it is?) information of images from global remotes and then the UI parses over that (meaning no longer needing to have a copy of public/assets/data/*-images.json) and not needing to duplicate code to parse the streams sort of thing.

Otherwise just another API endpoint on LXD itself to return the global remotes and allowing the UI to parse the simplestreams from that would make more sense in the long term I think of allowing configuring additional remotes

MrDaGree avatar Jul 10 '23 14:07 MrDaGree