Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charm storage metadata #77

Merged
merged 6 commits into from Jan 9, 2015
Merged

Charm storage metadata #77

merged 6 commits into from Jan 9, 2015

Conversation

axw
Copy link
Contributor

@axw axw commented Nov 17, 2014

We introduce a new "storage" attribute to charm metadata, which describes required and optional storage for a charm. Each may be raw block devices, or file systems. The charm declares the name, type and some restrictions on the storage, and the administrator specifies how to fulfil that storage when deploying the charm.

The metadata format is based on the storage phase 1 scope document:
https://docs.google.com/a/canonical.com/document/d/1-9ZPfdgpkj2R9mBG_tlSclGGyK3tRpMf2L4C37mzYD8/edit#bookmark=id.6abw2ee0ebgm

which is mostly the same as described in the spec: https://docs.google.com/a/canonical.com/document/d/1OhaLiHMoGNFEmDJTiNGMluIlkFtzcYjezC8Yq4nAX3Q/edit

Note that the spec was never signed off, and the scope document is yet to be reviewed. This metadata format is subject to change, and should not be documented until it is finalised. In the short term, this unblocks further work on storage in Juju (which should be uncontroversial).

There are also two new hook kinds defined for notifying units of storage attachment and detachment.

// Shared indicates that the storage is shared between all units of
// a service deployed from the charm. It is an error to attempt to
// assign non-shareable storage to a "shared" storage requirement.
Shared bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd personally like to see, for each of these attributes and where applicable, a comment indicating what the default value is if not explicitly specified in the metadata. The defaults are specified in the schema definition elsewhere, but this is where the main doc for the meaning of each attribute is, so someone reading the code may find it useful. YMMV.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@wallyworld
Copy link
Member

provisional LGTM pending william's approval

)

// Storage represents a charm's storage requirement.
type Storage struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we be explicit about serialization names throughout please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do, though I'm reluctant to increase the use of bson tags here. I'll whip up a patch tomorrow to duplicate the Meta structure in juju/state.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked Rog about this, and he said that Meta is being used directly in the charm store code. So I went ahead and added bson tags with names to everything.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yuck, but, ok :/

@axw
Copy link
Contributor Author

axw commented Dec 5, 2014

@fwereade PTAL.

Charms will be able to specify what
their storage requirements/wants are.
- consistent bson tags on Meta, Relation, Storage
- fix CountMax default value, and test
- No more filesystem
- No more persistent
- Change count to multiple.range
- Add description field

I have not yet added minimum size or
properties: these can be added later.
@axw
Copy link
Contributor Author

axw commented Jan 6, 2015

PTAL. I've updated again to match recent changes to the spec.

  • No more filesystem (i.e. filesystem type preference)
  • No more persistent (this is configured by the user, on the storage pool)
  • Change count to multiple.range
  • Add description field

I have not yet added minimum size or properties: these can be added later.

@fwereade
Copy link
Contributor

fwereade commented Jan 9, 2015

LGTM

axw added a commit that referenced this pull request Jan 9, 2015
@axw axw merged commit c4e615f into juju:v4 Jan 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants