multipass icon indicating copy to clipboard operation
multipass copied to clipboard

Remove obsolete appliances

Open ricab opened this issue 10 months ago • 6 comments

What are you trying to do? Multipass still offers images from 5 years ago. Here's part of the output of multipass find:

appliance:adguard-home                        20200812         Ubuntu AdGuard Home Appliance
appliance:mosquitto                           20200812         Ubuntu Mosquitto Appliance
appliance:nextcloud                           20200812         Ubuntu Nextcloud Appliance
appliance:openhab                             20200812         Ubuntu openHAB Home Appliance
appliance:plexmediaserver                     20200812         Ubuntu Plex Media Server Appliance

They are still based on core18.

What's your proposed solution? Stop offering these images in Multipass entirely.

ricab avatar May 28 '25 11:05 ricab

Hi @ricab

Perhaps, I can help with this. As far as I understand - To fix this issue, I need to do two things.

  1. Fix the find command to not to fetch these obsolete appliances and
  2. update the docs accordingly in https://github.com/canonical/multipass/blob/main/docs/tutorial/index.md and https://github.com/canonical/multipass/blob/main/docs/reference/command-line-interface/find.md

For fixing the find command I investigated the repository. I looked at the find command implementation in https://github.com/canonical/multipass/blob/main/src/client/cli/cmd/find.cpp and it looks like it makes a RPC call to find method using return dispatch(&RpcMethod::find, request, on_success, on_failure); This find method returns the FindReply stream as stated in https://github.com/canonical/multipass/blob/main/src/rpc/multipass.proto.

I tried to locate the remote url and thus navigate to daemon_config.cpp and in DaemonConfigBuilder I saw https://github.com/canonical/multipass/blob/105744b484f79de3de42eecdd2c8d194ce8bd92f/src/daemon/daemon_config.cpp#L183-L185

What do I exactly need to do? Is anyone of the maintainer needs to remove those obsolete images from the remote url? or do we need to change the url to something else that does not have the obsolete images, or do we need to filter the output of RPC call to remove these obsolete images? Or else let me know If I am missing something.

ayaankhan98 avatar Jun 10 '25 08:06 ayaankhan98

Hi @ayaankhan98, thank you for your interest in helping out with this. I think that removing that remote is the main thing. I am not sure if there is any other code that was only needed because of the appliances, which would then become orphaned. I'd need to look, but if there was any, we'd need to remove it too.

ricab avatar Jun 11 '25 14:06 ricab

Hi @ayaankhan98, thank you for your interest in helping out with this. I think that removing that remote is the main thing. I am not sure if there is any other code that was only needed because of the appliances, which would then become orphaned. I'd need to look, but if there was any, we'd need to remove it too.

Yes, that makes sense. I will also check for code that only needed because of appliances, and revert you back.

ayaankhan98 avatar Jun 12 '25 05:06 ayaankhan98

Hi @ricab, I have explored the repository and able to trace the appliances code base. Below is the summary of the findings.

Image Host & Remotes: https://github.com/canonical/multipass/blob/105744b484f79de3de42eecdd2c8d194ce8bd92f/src/daemon/ubuntu_image_host.h#L35-L44

src/daemon/ubuntu_image_host.h: This header file defines appliance_remote and classes like UbuntuVMImageHost and UbuntuVMImageRemote. These are involved in fetching and managing image information, including those from an "appliance" source.

https://github.com/canonical/multipass/blob/105744b484f79de3de42eecdd2c8d194ce8bd92f/src/daemon/daemon_config.cpp#L168-L185

src/daemon/daemon_config.cpp: This file initializes UbuntuVMImageHost with different remotes, including one for mp::appliance_remote which points to "https://cdimage.ubuntu.com/", "ubuntu-core/appliances/". This is likely the source of the obsolete appliance images.

Client-Side Logic (GUI and CLI): https://github.com/canonical/multipass/blob/105744b484f79de3de42eecdd2c8d194ce8bd92f/src/client/gui/lib/catalogue/catalogue.dart#L45-L47

https://github.com/canonical/multipass/blob/105744b484f79de3de42eecdd2c8d194ce8bd92f/src/client/gui/lib/catalogue/catalogue.dart#L53-L67

https://github.com/canonical/multipass/blob/105744b484f79de3de42eecdd2c8d194ce8bd92f/src/client/gui/lib/catalogue/catalogue.dart#L99-L111

src/client/gui/lib/catalogue/catalogue.dart: This Dart file for the GUI contains logic to sort and filter images. It has an applianceFilter and specific sorting logic that treats "applianceImages" differently. If appliances are removed or their handling changes, this UI code would need updates.

docs/reference/command-line-interface/find.md: The documentation for the multipass find command explicitly lists appliance: prefixed images (e.g., appliance:adguard-home). This documentation will need to be updated

Testing: https://github.com/canonical/multipass/blob/105744b484f79de3de42eecdd2c8d194ce8bd92f/tests/test_daemon.cpp#L1435-L1436 tests/test_daemon.cpp: There are test cases, specifically in INSTANTIATE_TEST_SUITE_P(Daemon, LaunchWithNoExtraNetworkCloudInit, ...) that include launching appliance images like "appliance:openhab" and "appliance:nextcloud". These tests would need to be removed or modified.

Documentation & Examples: README.md, docs/tutorial/index.md, docs/how-to-guides/manage-instances/create-an-instance.md, and docs/how-to-guides/manage-instances/launch-customized-instances-with-multipass-and-cloud-init.md: These files mention and show examples of appliance images in the output of multipass find or in launch commands. They will need to be updated to reflect the removal of these obsolete appliances.

And lastly, this file also contains something related to appliances but I think it is not related to this issue. Nevertheless, please have a look at this as well. https://github.com/canonical/multipass/blob/105744b484f79de3de42eecdd2c8d194ce8bd92f/data/cloud-init-yaml/cloud-init-anbox.yaml#L1-L4

Let me know if this looks good, then I can proceed forward to edit these files, and meanwhile the maintainers can update the remote url content.

ayaankhan98 avatar Jun 13 '25 20:06 ayaankhan98

Hey @ayaankhan98, that looks about right. The cloud-init-anbox.yaml one is indeed unrelated.

ricab avatar Jun 16 '25 10:06 ricab

Great! will create a PR addressing the changes as discussed above.

ayaankhan98 avatar Jun 16 '25 20:06 ayaankhan98

@ricab (and anyone else interested): I'm looking at this and had a couple implementation questions before I go too far:

  1. Are all "appliances" obsolete now and in the future? Or do we plan on adding some new appliances eventually?
  2. Would it be best to mark them as obsolete and hide them by default, but with a flag to show them in multipass find? Or are they so outdated that we should just rip out the code right away?

For (2), my gut feeling here is to mark them as obsolete now and either remove them in a future version or else start publishing up-to-date appliances. Maybe that's not strictly necessary here, but having a migration window for anyone using these appliances (does anyone use them?) would be polite.

jimporter avatar Sep 15 '25 18:09 jimporter

Hi @jimporter, there is no evidence of any significant usage in our metrics and, even if there were, we'd probably want to guide people away from those images. Anyway, after a bunch of time, a decision was finally made to clean that stuff up and I think we'd be better off not having to maintain any related code. It remains in git's history, so if appliances were somehow reborn, we could get it.

ricab avatar Sep 15 '25 22:09 ricab