Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LXD UI #29

Closed
almereyda opened this issue Nov 7, 2023 · 7 comments
Closed

LXD UI #29

almereyda opened this issue Nov 7, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@almereyda
Copy link

almereyda commented Nov 7, 2023

The LXD Snap brings an LXD UI since v5.14:

Is there a chance this could be included in these LXD builds here?

As per the definition of the snap, this only seems to copy some static files into an expected location, and is then available?

https://github.com/canonical/lxd-pkg-snap/blob/1b5997236d12a73a402a711e1dd3d9274eb43045/snapcraft.yaml#L1523-L1544

ui.enabled=true then exports an environment variable with the location of the UI:

https://github.com/canonical/lxd-pkg-snap/blob/1b5997236d12a73a402a711e1dd3d9274eb43045/snapcraft/commands/daemon.start#L449-L453

LXD activates the UI, if this variable is present and set:

https://github.com/canonical/lxd/blob/1be6a0bc5e65a157d32afbac4b24ee3b0d8fc791/lxd/api.go#L70-L71

Would it be possible to replicate these steps with the COPR and RPM build infrastructure?

Else I've seen plans in Incus land to repackage it, which could be used as a reference point.

@ganto
Copy link
Owner

ganto commented Nov 9, 2023

Thanks for the hint. I'll have a look at it.

@ganto ganto added the enhancement New feature or request label Nov 11, 2023
@ganto
Copy link
Owner

ganto commented Nov 12, 2023

I was able to build a first version of the lxd-ui RPM. Unfortunately it was only successful for x86_64.

You can give it a try by installing the package dnf install lxd-ui and manually adding the LXD_UI variable to the lxd service e.g. via systemctl edit lxd.service:

[Service]
LXD_UI=/usr/share/lxd-ui/ui

@almereyda
Copy link
Author

almereyda commented Nov 13, 2023

Many thanks for the effort, very well done and received.

Even though I had adapted the snippet to read

[Service]
< LXD_UI=/usr/share/lxd-ui/ui
> Environment=LXD_UI=/usr/share/lxd-ui/ui

LXD would not bind to the expected port :8443, until I had activated the API with lxc config set core.https_address :8443.

Then I was greeted with a way to set the token for the certificate that was offered, and could manage the service.

Should this issue remain open, until the package also builds for other platforms?

@ganto
Copy link
Owner

ganto commented Nov 16, 2023

Ah, sorry about the wrong service snipped.

Btw. thanks for all the links that you posted. They help me a lot.

Now I'm still struggling with some Javascript build issues. I'd like to leave the issue open until I fixed that. Hopefully it will keep me motivated to fix it soon.

@almereyda
Copy link
Author

Cool, go on. People will be surprised to hear that this even exists and just works™

@ganto
Copy link
Owner

ganto commented Nov 19, 2023

The lxd-ui package is now available for all Fedora architectures. With >=lxd-5.18-0.2 I also adjusted the lxd systemd service so that the path to the UI (and the documentation) must no longer be set manually.

How to enable the UI is now also explained in the wiki. I hope this should be good enough for everyone interested to figure out how to use it.

@ganto ganto closed this as completed Nov 19, 2023
@almereyda
Copy link
Author

almereyda commented Nov 23, 2023

You were faster than Incus, which is a little nice.

@almereyda almereyda mentioned this issue Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants