I would like to know more about Juju cache.

After I start a charm and Juju provisions a machine for the first time, the charm will be downloaded and all dependencies installed (apt-get, etc). This process can be very long.

Once the charm has been build, configured and deployed once, can JuJu provision more instances of the same charm pre-built and configured?

I presume that's what the cache is for, but the documentation is not very explicit: https://jujucharms.com/docs/stable/charms-deploying

How does Juju tracks the state of the charm if it works that way?

1 Answer 1


The charm cache holds the charm so that it doesn't need to go and download the charm every time. Every new instance that is spun up needs to have the charm and all dependencies installed, each instance is a fresh machine.

If this set up takes a very long time, as you said, you can write your charm to use or create containers.

Remember, charms are a collection of scripts they can do whatever you want.

  • I read that Juju doesn't allow custom images anymore, that i have to use an ubuntu offical release like Trusty or Precise. How can i install all dependencies in advance then? Even if i use containers or vagrant box, i still need to download it and provision it. That will be faster but still slow for quick scaling ... What's the best practice for quick deploy? I have ffmpeg to compile at bootup and all its dependencies to resolve. It's pretty slow. Vagrant box seems the solution. Other ideas ?
    – koxon
    Jun 4, 2014 at 20:01
  • I commonly put all assets inside the charm that way they are cached and it doesn't need to go and download anything from the open web.
    – hatch
    Jun 4, 2014 at 21:17
  • Thanks Hatch. Looking more into this I see that a charms is composed mostly of hooks: juju.ubuntu.com/docs/authors-charm-writing.html. Should I put my assets in a separate folder?
    – koxon
    Jun 6, 2014 at 19:44
  • You can, most would put them in an assets/ folder. Also if this answer is correct click the checkmark to mark it as such.
    – hatch
    Jun 9, 2014 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.