Me and @heitor has been discussing alot about how to work with versions, workloads and status with juju and we are both massively confused.
We have a few terms used: “app”, “charm”, “unit”, “version”, “workload”. It has taken us a while to form a consistent model on how to work with these and I’m moving this discussion here to get some eyes on this.
If we can’t figure this out and agree - new charmers will not either.
As we stand now, we believe that “application” = “charm” and that the “workload” = “version”.
This is applied on the application level.
If this is true, this is massively confusing in the “ops” framework since the construct to set is not on the APP level, but on the UNIT level:
self.unit.set_workload_version(self._nextcloud_version())
This is really misleading. Wouldn’t it be a better way to set this value as:
self.unit.app.set_workload_version(self._nextcloud_version())
At the moment, we tent to believe that there is also a “unit_workload”, whereas its clearly no such thing - or is there?
Nevertheless, mixing “version” with “workload” is a mix of terminologies and a developer might think that these (version and workload) are different things?
Now, this leads up to even more questions about how to present “the underlying service version/workload”
Today, we have “juju status” to play with here and the “update-status” hook.
The interpretation this status differ massively between me and Heitor which makes things problematic when trying to collaborate over charming.
Heitor thinks that status should not reflect the underlying service at all, but rather only represent juju related statuses.
Me, on the other hand, tend to like to present the underlying service status here.
Juju doesn’t say what is right and wrong, but leads up to massively different kind of charms. It would be better if we could figure out a clear good-vs-bad here, this being a core piece of juju.
I think this is a bad situation and could partially be mitigated by restricting developers ability to alter a “charm-workload-version-status” and move this to metadata.yaml or a version
file which is already becoming part of charmhub requirements? E.g. forcing a charmer to have a version file which juju then set as “workload/version” on the app level.
That would reduce the issue to only deal with:
- What “juju status” should reflect in terms of underlying service, or, juju internals.
- Having a consistent terminology about charm=app, version=workload
Or, have we missed out on key concepts here?