Have a bundle with two local charms, how to share the bundle & charms privately?`

Hi Juju community,

After a lot of motivation(& even more help) from @erik-lonroth , I now have two juju charms that are relating and connecting with one another. I can even bundle them up locally and it seems so far so good, BUT… how do I share this now with my colleague ?

I have 2 charms, privately held in a git repo that requires a SSH key to authenticate and download. I have this bundle:

series: bionic
    charm: local:bionic/ibgateway-25
    num_units: 1
    - "81"
    charm: cs:postgresql-207
    num_units: 1
    - "83"
    charm: local:bionic/sample-thrift-charm-57
    num_units: 1
    - "80"
  "80": {}
  "81": {}
  "83": {}

I think in time, I will be more than happy to release something publicly… upload to charm store here in the internet which would obviously make it all very easy… but until then if I want to share it with my colleague… how do I use the bundle properly and privately?

So far I just git clone charm1_proj and git clone charm2_proj to their respective dirs… manually hit juju deploy . on each directory… and then finish off with a juju deploy postgresql pg-a… but with the bundle I am now looking to point to some local store? Do I tell my colleagues to edit the local:bionic/ibgateway-25 into a full path to whereever they clone to?

Big thanks to @erik-lonroth, whom I hope to also share this thrift related charm with soon… as it continues to generalize and perhaps later help juju instantiate thrift based microservices more easily.

In your charm: parameter, just input the path to the charm, like charm: "/my/directory/my-charm"

1 Like

The way to go here is to use the charmstore feature of “private namespaces”.

This allows you to create charms and upload them and restricting access to those private charms via “Launchpad Teams”. You can create and administer those teams in https://launchpad.net/

Private charms will only be visible and deployable to members of the launchpad team (namespace).

The process is the following:

  1. Create a team in https://launchpad.net/, lets say: myteam

  2. Build your charm, lets say: mycharm

  3. Use the charm push command and push to the namespace of your team. If your teams name is myteam, the command will look something like:

charm push . cs:~myteam/mycharm

  1. Then you release the charm to a channel, lets say stable.

charm release cs:~myteam/mycharm-1 --channel stable

5 .After that, you grant permissions to your team, myteam:

charm grant cs:~myteam/mycharm-1 myteam --channel stable

(To make the charm public to the world, you instead grant access to the special user everyone as:
charm grant cs:~myteam/mycharm-1 everyone --channel stable)

Members of the launchpad myteam can now deploy mycharm given they logged in to charmstore with the username beloning to “myteam”:

juju deploy cs:~myteam/mycharm-1

Users can list available charms belonging to a team/namespace with the command:

charm list

A note to all this is that the charmstore is undergoing alot of work at the moment to move into the “snapstore” format. So, I would love to hear comments on this workflow from @timClicks or other people with more insights here.

Finally, you can find a great article on this topic: https://cloud.garr.it/support/kb/juju/publish_to_jujustore/

1 Like