canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.76k stars 642 forks source link

GUI Improvements #3504

Closed andrei-toterman closed 3 months ago

andrei-toterman commented 5 months ago

public side of canonical/multipass-private#618

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.83%. Comparing base (e923e2d) to head (cd8ee04).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3504 +/- ## ======================================= Coverage 88.83% 88.83% ======================================= Files 253 253 Lines 14170 14170 ======================================= Hits 12588 12588 Misses 1582 1582 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

townsend2010 commented 4 months ago

Hey @andrei-toterman!

I'm trying this out and when I click on a running instance to go to its "Shells" page, I'm not getting the automatic login to the shell.

andrei-toterman commented 4 months ago

Hey, @townsend2010! I'll look into it, thanks for pointing it out!

andrei-toterman commented 3 months ago

@sharder996, I can't really reproduce that. Images load just fine for me. Could you perhaps provide some logs? You can find them in ~/snap/multipass/current/data/multipass_gui/multipass_gui.log.

sharder996 commented 3 months ago

@andrei-toterman Here is the log

┌───────────────────
│ 18:28:55.818 (+0:00:00.246720)
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ INFO Sent FindRequest{showImages: true, showBlueprints: false}
└───────────────────
┌───────────────────
│ gRPC Error (code: 9, codeName: FAILED_PRECONDITION, message: failed to download from 'https://cdimage.ubuntu.com/ubuntu-core/16/stable/current/ubuntu-core-16-amd64.img.xz': Host cdimage.ubuntu.com not found, details: [], rawResponse: null, trailers: {})
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ 18:28:55.949 (+0:00:00.378421)
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ ERROR FindRequest{showImages: true, showBlueprints: false} received an error
└───────────────────
┌───────────────────
│ 18:28:55.954 (+0:00:00.383112)
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ INFO Sent VersionRequest{}
└───────────────────
┌───────────────────
│ 18:28:55.956 (+0:00:00.384523)
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ INFO VersionRequest{} received VersionReply{version: 1.15.0-dev.2179+g521c3d87, updateInfo: {}}
└───────────────────
┌───────────────────
│ 18:28:55.956 (+0:00:00.384620)
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ INFO VersionRequest{} is done
└───────────────────
┌───────────────────
│ 18:30:33.120 (+0:01:37.548529)
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ INFO Sent FindRequest{showImages: true, showBlueprints: false}
└───────────────────
┌───────────────────
│ 18:30:33.151 (+0:01:37.579792)
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ INFO FindRequest{showImages: true, showBlueprints: false} received FindReply{showImages: true, imagesInfo: [{os: Ubuntu, release: Core 16, version: 20200818, aliasesInfo: [{alias: core}, {alias: core16}], codename: Core 16}, {os: Ubuntu, release: Core 18, version: 20211124, aliasesInfo: [{alias: core18}], codename: Core 18}, {os: Ubuntu, release: Core 20, version: 20230119, aliasesInfo: [{alias: core20}], codename: Core 20}, {os: Ubuntu, release: Core 22, version: 20230717, aliasesInfo: [{alias: core22}], codename: Core 22}, {os: Ubuntu, release: Core 24, version: 20240603, aliasesInfo: [{alias: core24}], codename: Core 24}, {os: Ubuntu, release: 20.04 LTS, version: 20240606, aliasesInfo: [{alias: 20.04}, {alias: f}, {alias: focal}], codename: Focal Fossa}, {os: Ubuntu, release: 22.04 LTS, version: 20240514, aliasesInfo: [{alias: 22.04}, {alias: j}, {alias: jammy}], codename: Jammy Jellyfish}, {os: Ubuntu, release: 23.10, version: 20240606, aliasesInfo: [{alias: 23.10}, {alias: m}, {alias: mantic}], codename: Mantic Minotaur}, {os: Ubuntu, release: 24.04 LTS, version: 20240608, aliasesInfo: [{alias: 24.04}, {alias: n}, {alias: noble}, {alias: lts}, {alias: default}], codename: Noble Numbat}, {os: Ubuntu, release: 24.10, version: 20240606, aliasesInfo: [{remoteName: daily, alias: 24.10}, {remoteName: daily, alias: o}, {remoteName: daily, alias: oracular}, {remoteName: daily, alias: devel}], codename: Oracular Oriole}, {os: Ubuntu, release: AdGuard Home Appliance, version: 20200812, aliasesInfo: [{remoteName: appliance, alias: adguard-home}], codename: Core 18}, {os: Ubuntu, release: Mosquitto Appliance, version: 20200812, aliasesInfo: [{remoteName: appliance, alias: mosquitto}], codename: Core 18}, {os: Ubuntu, release: Nextcloud Appliance, version: 20200812, aliasesInfo: [{remoteName: appliance, alias: nextcloud}], codename: Core 18}, {os: Ubuntu, release: openHAB Home Appliance, version: 20200812, aliasesInfo: [{remoteName: appliance, alias: openhab}], codename: Core 18}, {os: Ubuntu, release: Plex Media Server Appliance, version: 20200812, aliasesInfo: [{remoteName: appliance, alias: plexmediaserver}], codename: Core 18}]}
└───────────────────
┌───────────────────
│ 18:30:33.151 (+0:01:37.579951)
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ INFO FindRequest{showImages: true, showBlueprints: false} is done
└───────────────────

I see this happening on Ubuntu and Windows (possibly macOS, too). I suspect when the GUI comes up, networking hasn't been completely initialized yet so the GUI fails to retrieve images. After pressing "Refresh", often it takes several seconds before images actually show up. I'm not sure if this delay is coming from the daemon waiting for a response from the server, but it would be nice if there was some sort of indication that pressing the refresh button is actually doing something.

andrei-toterman commented 3 months ago

Hey, @sharder996! Yes, I can only think that the issue is the daemon not managing to complete the request immediately after startup. I agree that a loading spinner is needed on refresh.

andrei-toterman commented 3 months ago

Hey, @sharder996. Can you please go into more details about issue number 1? Just to be sure that I understand what's wrong. I really understand your concern about issue number 2. Unfortunately, I never encountered it on any platform. One possible solution would be to implement automatic retries alongside the refresh button. The initial response from the daemon would still be a failure, but at least the user wouldn't have to manually refresh every time. Or we could just delay the request a little bit, so that the networking has enough time to come up? When you encounter the issue and you click refresh, does it work on the first try or do you need to refresh multiple times?

sharder996 commented 3 months ago

I think you can ignore issue #1. I'm not able to reproduce anymore. The issue I was seeing was that the autostart file was missing at the symlink destination. Perhaps the issue was coming from after effects of having an older version of the GUI snap installed on my system and installing the latest GUI edge snap rectified it.

In regard to the Failed to retrieve images issue, I'm not sure using --force-update would make any difference. After starting my PC and logging in, it takes about 15secs for networking to come up. During that time, multipass find requests from the GUI or CLI always reply with the Host cdimage.ubuntu.com not found. Using --force-update makes no difference as networking is not up yet.

andrei-toterman commented 3 months ago

Hmm, then I'm not really sure what the right solution would be. 15 seconds is definitely too much delay to add to the find request in the hopes that networking is up by that time. Automatic retires with backoff might be a little overkill for this scenario, given that it's a request that only needs to complete once. But still, it could be a solution. Opinions?

andrei-toterman commented 3 months ago

As discussed today, automatic retries are not a priority and should not go into this PR. So I don't think there is any issue left to resolve, right?

sharder996 commented 3 months ago

Not from me. I believe @ricab wanted to take a look at this as well.

andrei-toterman commented 3 months ago

Yes, definitely!

ricab commented 3 months ago

Draft/undraft to try to kick CI.

ricab commented 3 months ago

Oops, @andrei-toterman I just tried again and I still have the autostart issue :confused:

ricab commented 3 months ago

OK, it is working now!