Charmcraft bi-Weekly Dev Summary - 2020w21,22

prev (w19,20)

Ops (the operator framework itself)

  • We released 0.6.0 of the operator framework! You can grab it via pip install ops. This is the first “official” release, and includes a few breaking changes from what was in master until very recently. From now on, breaking changes will be announced, and we’ll have a deprecation procedure to ease things in (or rather, out). These breaking changes are:

    • The Framework object’s observe method’s second argument can no longer be an instance, and must be a method on an instance. That is, where previously you could write

      self.framework.observe(self.on.install, self)
      

      as a shortcut, but we found that this pushes people down a path that actually makes their charms less maintainable. Especially when it comes to writing components, it is better to have clearly named functions and clearly defined targets.

      So from now on the only supported way is to explicitly specify the callback method,

      self.framework.observe(self.on.install, self._on_install)
      

      (note we also recommend event handlers to be clearly marked as non-public).

    • Relations’ role attribute is now an enum, and in particular peer relation’s role is now "peer" (it used to be "peers" which was just wrong).

  • This release includes full support for Juju 2.8’s dispatch mechanism, including both use cases of dispatch being a symlink to the charm code, and dispatch being a small shim that executes the charm. The latter is an incremental improvement over what we mentioned in the last dev summary, and is already being used by charmcraft.

  • Model objects now have a name property (populated from JUJU_MODEL_NAME). This was a feature requested by charmers.

  • Lots of incremental API documentation additions. The URL for documentation is still the temporary one, as there are still three more weeks to go before we can potentially move to the one we want.

  • Support for Juju 2.8’s relation-created event. This should’ve been included in the last summary but slipped through the cracks…

Charmcraft

We released charmcraft 0.1.0! You can grab it via pip install charmcraft (soon also available as a snap). This is very much an initial release, and there are a lot of things still to do and things we know we want to do differently, but it works!

In particular, charmcraft build will create a fully functional charm from a barebones structure, such that you don’t need to care about the dispatch or hooks symlinks! Huzzah. We even wrote a nice tutorial (still in progress, once reasonably “done” we’ll also put it on discourse) on how you can use it.

Chatting …

We’re settling in to a bi-weekly cadence for meetings. If you are working on operator framework charms, and haven’t chatted with us yet, please reach out! No changes in the list of charmers we’ve been talking with since the last dev summary, but some changes will happen in the next few weeks as rotations kick in.

next (w23,24)