juju / amulet

Testing harness and tools for Juju Charms
Other
17 stars 33 forks source link

Add Support for Juju Storage #112

Open Yrrsinn opened 8 years ago

Yrrsinn commented 8 years ago

This is needed for testing charms that depend on the juju-storage feature, these charms come with

A charm can be deployed with different storage provider (e.g. loop or ebs for block) $ juju deploy <charm> --storage <name>=<pool>,<size>,count

This could be expressed as an extension of Deployment.add(), e.g. .add( 'servicename', storage={servicestorage:{'pool': 'ebs', 'size': 1024, 'count': 3}})

Juju-Storage also provides the possibility to add storage to already deployed units $ juju storage add <unit> <name>=<pool>,<size>,count

I'm not sure how the adding (removing) of storage should be expressed in terms of amulet.

Trying to add this support myself, I stopped when I realize that amulet makes use of juju-deployer. juju-deployer does not provide support for juju-storage (not sure if it is expressible in the bundle-format, was not able to create a bundle using juju-gui export on a deployment with juju-storage)

marcoceppi commented 8 years ago

To expand, d.unit should also have a storage_add and storage_remove primitives which Juju has. I completely agree this needs to be added, especially since storage exists in Juju today.

As for the deployer bits, this is in a weird phase change since Juju 2.0 adds native support for bundles, and storage I believe is a part of that primitive, we may need to add storage to deployer as part of this. We can also work around this by transparently supporting it where .add takes a storage parameter, executes a bundle, then invokes the storage add bits via the API after the bundle completes (or in parallel).

@tvansteenburgh opinions on the best approach for this?

@Yrrsinn we'll schedule this in for something we try to tackle very soon to unblock you and others writing charms with storage.

mitechie commented 8 years ago

@axw added support to native bundle deploy with storage a bit ago and it's in 2.0. https://github.com/juju/bundlechanges/blob/2618de2ad622b29a396a826628d4a81b8562d6b2/changes_test.go#L1106

I understand that the deployer doesn't but I wonder if it can pass those settings on without interpreting. That one will have to be a different look/chunk of work.

cholcombe973 commented 7 years ago

This is a blocker for me also on the gluster charm.

tkuhlman commented 7 years ago

I just created PR #169 which address this.