Problems creating a charm logo (icon.svg)

I’m trying to follow the guide to create the “icon.svg” for one of my charms and I’m having problems.

The logo looks great in inkscape.

However, in charmuhub.io it looks nothing like it.

image

… The above… Yes, this is just weird and user-unfriendly:

It also looks crap in the juju dashboard, so no means to test the logo:

image

This happens to me all the time and the instructions are not up to date either with what actually goes on.

Also, there is no way to preview the work - so I have to go through a complete release cycle to test. E.g.

  • edit the icon.svg
  • charmcraft pack
  • charmcraft upload
  • charmcraft release
  • reload charmhub (not knowing if it will cache previous images or not)

Since this process REQUIRES me to have a stable release, whats my option?

Also, consider this from a charm developers perspective. Spending hours and hours to get a nice looking logo, not getting it to work properly or getting stuck in a nasty upgrade/patch cycle with no means to test reliably the result, this, adds to a bad feeling about whole process of creating quality charms.

This sounds frustrating.

Charmhub is loading the placeholder image that it uses when it can’t find a logo, so my guess is that a tool in some part of the process was not happy with the format.

Have you tried inspecting the compressed .charm file to verify that the image is there, in the expected place?

@facundo do you have any advice on troubleshooting?

Hello!

No specific recommendations :frowning:

The icon.svg file is automatically managed by Charmcraft, so it should be included in the final .charm file without needing to do anything special.

@erik-lonroth is your charm’s project public so we can take a look to the icon you created? thanks!

https://github.com/erik78se/charm-lxdware/tree/main/lxd-dashboard

Hello Erik! I was about to try it and saw that the logo was updated 11 days ago. The problem of this logo not being shown in Charmhub persists with this new version? Thanks!

FTR, the icon.svg file is packed and looks fine:

~/canonical/building-charms$ git clone git@github.com:erik78se/charm-lxdware.git
Clonando en 'charm-lxdware'...
remote: Enumerating objects: 32, done.
remote: Counting objects: 100% (32/32), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 32 (delta 5), reused 32 (delta 5), pack-reused 0
Recibiendo objetos: 100% (32/32), 12.57 KiB | 4.19 MiB/s, listo.
Resolviendo deltas: 100% (5/5), listo.

~/canonical/building-charms$ cd charm-lxdware/

~/canonical/building-charms/charm-lxdware/lxd-dashboard (main)$ charmcraft pack
Packing the charm                                                                                                                                                                        
Created 'lxd-dashboard_ubuntu-20.04-amd64_ubuntu-22.04-amd64.charm'.                                                                                                                     
Charms packed:                                                                                                                                                                           
    lxd-dashboard_ubuntu-20.04-amd64_ubuntu-22.04-amd64.charm                                                                                                                            

~/canonical/building-charms/charm-lxdware/lxd-dashboard (main)$ unzip -p lxd-dashboard_ubuntu-20.04-amd64_ubuntu-22.04-amd64.charm icon.svg | file -
/dev/stdin: SVG Scalable Vector Graphics image

~/canonical/building-charms/charm-lxdware/lxd-dashboard (main)$ 

But it still looks like crap in the interface whereas it looks good in inkscape.

@erik-lonroth I tried to find the charm page in Charmhub but could not; it’s not public yet, right? Can you paste here a screenshot showing how you see the logo in the page? Thanks!

I’ll message you in the Mattermost chat. Deploy lxd-dashboard using Charmhub - The Open Operator Collection

Ah, your Charm is not published into stable channel yet! That’s why the web page is showing a generic “not found the icon” image…

From the “how to create an icon for your charm” page that you linked above:

BEWARE: unless your charm has (or has had at some point) a release in the stable channel, the icon will not be visible. That is because charmhub only updates the metadata for a charm on stable channel releases (by design). So either release to stable and then roll it back, or wait until your charm is ready for a “stable” stable release.

Oh… shit. That’s not very easy to spot. A user (such as myself) wouldn’t spot this at all. I would really suggest that the icon would be replaced by a “dummy” icon or information that “what you see is not what you get”.

This sent me off iterating multiple times and I expect this question will end up here multiple times in the future to much annoyance.

Also, its impossible for me now to get an idea of how the icon will look unless I publish a “stable” release of this charm - which is by no means stable. Also not a good situation.

Maybe @roadmr could enlighten us about the source of this behaviour and if there are plans to improve/change…

Hi!

The behavior was conceived to be consistent with snaps’ “update metadata on release to stable” - it’s partly why it is how it is.

On first upload, we do populate the metadata with what the snap contains, since otherwise there would be nothing :slight_smile: But after that, Facundo is right that we only update on releases to stable.

While that particular behavior is not likely to change, we would like to provide a metadata API similar to that of snapcraft.io, where one could update the icon without requiring a charm upload. This has not been done yet, so for now the best I could offer is to publish the charm to stable to update the icon, then immediately close the stable channel to leave it only on edge.

I don’t know where juju-dashboard gets the icons - I would think it should get it from the deployed charm but that appears not to be the case. That’s more of a question for the juju-dashboard folks.

  • Daniel

Right, so there is no solution to this issue in the near future.

I think I begin to see a problem here with the juju-dashboard, charmhub, ops and juju not being well coordinated for these issues.

It happens often that I get ping-ponged between these “projects” that are all part of the Juju ecosystem.

I know this is a completely different issue, so I’ll leave that for now.

Thanx for the attention though.

To all involved: I remind you that there’s an open issue on this: https://github.com/canonical/charmhub.io/issues/1357#issuecomment-1199221524

I think that should cover this issue as well?

check it out! Charm icon validator

1 Like