Suite and Charming: The Journey of a Juju Charm

Do You Believe in Magic?

jujumagic
Juju is the best way to deploy, scale, manage, model, move services in cloud environments. All of this can be done in seconds rather than days.

Well I’ll be charmed if that ain’t just a boisterous basket of buzzwords, but here’s a more human translation.

I still have no idea how that all works; it’s like magic to me. So, can you believe that I managed to write a juju charm that made it into the charm store?

juju deploy motivationalspeech

Most computers don’t speak bad German, but if you have *some* coding knowledge and/or determination, then this is where you could step in. All you have to do is believe, and you’ll be charming in no time. 😉

You Could Be Charming (and Contributing)

exemplar

Perhaps, like me, you have a friend or a community who could make use of a charm for a service. In my case, my friend was raving about SuiteCRM, so I decided to start with that since there was no charm in the works at the time (I checked).

Charms can be great on-boarding projects to software-type contributions. Most charming at this point seems to include (but not limited to):
terminal commands, bash script, and SQL (none of which I knew very well before I started). However, charms not only have scripting bits, but they also need icons. So, if you are an artist, then you can reach out to scripting charmers for collaboration. You can also help by growing the community through evangelism. And, having more people involved in your local circle will make things easier.

So, you want to write a juju charm? Then let’s get Kraken[sic] and see how deep the rabbit hole goes.

The official juju “Getting Started” documentation is a good starting point. In addition, I have written a supplementary guide (to be updated) for setting up and navigating the juju environment on a local machine.

I invite you follow my journey, and learn from my mistakes.

WHW I Write a SuiteCRM Charm

I guess that works...

  • Start with the Your First Charm Starts Here! guide.
  • Work on the icon because it seemed like a goal within my reach. Not exactly how I intended.
  • Locate the source of the service for the charm.
    • Charms need to either download or use files included in the charm to install. I eventually opted to have it pull from the git repository.
  • Determine which packages are needed by the service, and include them in the install hook.
    • eg. sudo apt-get install git php5 …
  • Fail my way through writing the other hooks by referencing other hooks from existing charms (see Charm Store).
  • End up with a semi-functional-Frankenstein-monster charm using code from other charms.
  • Start over. (many months later)
  • Learn to be persistent.
  • Copy *extremely* similar charm (SugarCRM), and reverse engineer it to “work” with SuiteCRM.
    • Seriously. Why re-invent the wheel? Props to the SugarCRM charmers!
    • Not as easy as expected.
  • Learn to be patient.
    • That charm isn’t accessible because you didn’t wait for it to finish setting up…
    • juju destroy-environment local
  • Debug. Debug. Debug. Rebug.
  • Learn to be prideless.
  • Reach out to the community for help.
  • Reflect on how I should have consulted knowledgeable people more frequently in my life.
  • Miracle: it works!
  • Submit the charm for review
  • Learn to be patient.
  • Receive gratitude, recommendations, and fixes.
  • Fix some bugs. Break it. Fix it again. Commit changes.
  • Wait in the queue.
  • Get recommended!
  • Success.

I don’t see this as a personal success as much as I see it as a success of the community and the Ubuntu model. I can’t say that I was the best person for the job, but the community was supportive and made the process as painless as possible. Particular shout-outs go to Charles, José, and Kevin, who politely helped me a long the way (if I missed anyone then please let me know).

Being approachable, accessible, and active are keys to community health. Let’s continue to work in this way.

One thought on “Suite and Charming: The Journey of a Juju Charm

Leave a Reply

Your email address will not be published. Required fields are marked *