canonical / charms.reactive

Framework for developing charms and relations using the reactive pattern
Apache License 2.0
21 stars 34 forks source link

Should charms.reactive support multi-platform charms? #109

Open AdamIsrael opened 7 years ago

AdamIsrael commented 7 years ago

This is a question raised in the Juju docs: how can we support multi-platform charms, i.e., Ubuntu, Centos, and Windows?

Could we do something like having platform-specific layers that can be auto-detected by the base layer?

Who is writing charms targeted at Centos and/or Windows now that could give input on this?

Here's an example of someone building a charm for centos. https://github.com/lenovo/workload-solution/wiki/python2-charm

axw commented 7 years ago

Charms do not support multiple OSes in Juju, but I do think it would be reasonable and very useful to have common layers that can be used to build OS-specific charms. e.g. a while ago I was trying to set up my own private CI for Juju, running Jenkins workers on both Ubuntu and Windows. Having to learn Powershell just for the latter killed my motivation.

I hacked up charms.reactive a while ago to get it working on Windows, and it wasn't overly intrusive. I had Python automatically installed using the web installer, though it probably should be a self-contained installer as a resource for offline deployments. I don't recall the changes I had to make to the Python code, I've almost certainly lost them, but I don't recall there being a huge amount to change.

ajkavanagh commented 7 years ago

charm-helpers (the python library that is used to support charm writing in Python) does have preliminary support for multiple platforms. There is the start of the some centos support in the core.host and core.fetch parts of the library, which deals with where to get code from (apt or rpm/yum) and abstracts the different ways that the charms discover facts about the host that the charm (and managed) software is running on.

A windows abstraction could also be added at the host/fetch parts of the library which would help in writing more platform agnostic charms. In terms of layers, I guess a 'fetch' type layer that is agnostic could be worked up, using say, the apt layer as a model?

On Fri, Jun 16, 2017 at 7:55 PM, Adam Israel notifications@github.com wrote:

This is a question https://github.com/juju/docs/issues/362 raised in the Juju docs: how can we support multi-platform charms, i.e., Ubuntu, Centos, and Windows?

Could we do something like having platform-specific layers that can be auto-detected by the base layer?

Who is writing charms targeted at Centos and/or Windows now that could give input on this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/juju-solutions/charms.reactive/issues/109, or mute the thread https://github.com/notifications/unsubscribe-auth/AAipe_AZMvbstQsbxkLxIR49YPrPPeXxks5sEs-pgaJpZM4N80DB .

-- Alex Kavanagh - Software Engineer Cloud Dev Ops - Solutions & Product Engineering - Canonical Ltd