Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Document the new resource feature #1122
Conversation
mbruzek
added some commits
May 24, 2016
mbruzek
referenced this pull request
May 25, 2016
Closed
missing docs for implementing Resources and Terms #935
|
This PR addresses 1/2 of issue #935 |
|
@kat-co , @natefinch , please review this material. |
mbruzek
added some commits
May 26, 2016
natefinch
reviewed
May 31, 2016
| +other locations, some charms may be deployed network restricted environments | ||
| +that do not allow access to all areas of the Internet. | ||
| + | ||
| +Starting with version 2 of Juju, users can upload resources to the controller |
natefinch
May 31, 2016
•
Contributor
or Juju charm store (which will be downloaded to the controller as-needed when requested by an installed unit).
(oops, I see this is addressed below)
natefinch
reviewed
May 31, 2016
| + filename: software.zip | ||
| + description: "One line description that is useful when operators need to push it." | ||
| +``` | ||
| +The `filename` is the name of the resource after it has been retrieved. Juju |
natefinch
May 31, 2016
Contributor
"The filename field contains the name of the file that will be created on the unit after the resource has been retrieved from the juju controller."
natefinch
reviewed
May 31, 2016
| + | ||
| +Resources can be uploaded to a local Juju controller, where only charms from | ||
| +that controller can access the resources, or the Juju Charm Store where access | ||
| +is controlled by permissions. |
natefinch
May 31, 2016
Contributor
controlled by the permissions assigned to the charm to which the resources are attached.
|
There should be a section explaining that when you use juju attach, it fires the charm_upgrade hook, so charm authors will need to handle that appropriately. |
natefinch
reviewed
May 31, 2016
| +resource. Note that the resource may get updated on the controller for the | ||
| +service at any time, meaning the cached copy *may* be out of date at any time | ||
| +after `resource-get` is called. Consequently, the command should be run at | ||
| +every point where it is critical for the resource be up to date. |
natefinch
May 31, 2016
Contributor
This is only sort of true. If the resource updates, then the charm will get a charm-upgrade hook firing. You can safely choose to ignore it during charm-update, if you also do resource-get before you need to use the resource. Note that resource-get won't download anything if you already have the most up-to-date version of the resource, so it's safe to just always call resource-get first, since it'll just be a quick API call unless you're out of date.
mbruzek
May 31, 2016
•
Contributor
it'll just be a quick API call unless you're out of date
@natefinch my testing of this feature found this not to be true. I uploaded a resource once, yet every time I called resource-get the debug session hung for a long time presumably fetching the new resource. I checked the hash sum before and after they were always the same but any time I called that method it seemed to me to fetch the whole thing.
|
mostly LGTM with a few suggested tweaks. |
|
I addressed the comments form @natefinch. Some of it was information that I didn't have when writing this documentation. If everything looks OK can I get a review from someone the docs team on the use of "proper" English (or lack-there-of)? |
evilnick
reviewed
Jun 6, 2016
| + | ||
| +Many applications require binary resources in order to be installed. While it is | ||
| +possible for a charm to download the software from the package repositories, or | ||
| +other locations, some charms may be deployed network restricted environments |
evilnick
reviewed
Jun 6, 2016
| +Starting with version 2 of Juju, users can upload resources to the controller | ||
| +or the Juju Charm Store that charms can download. This is useful for Juju | ||
| +models in restrictive network environments and when you want to control the | ||
| +versions of software that is deployed. |
|
Forget about my comments - there are a few too many twiddly bits to be reworded. Will just merge and fix instead Thanks for this work |
evilnick
merged commit 77ddd30
into
juju:master
Jun 6, 2016
|
@evilnick I will fix these now. stand by. |
mbruzek commentedMay 25, 2016
The Juju 2.0 resource feature needs some developer documentation on how to attach resources and how to use this in the charm.
I did not implement this feature, but I did my best at documenting how I understand it works. It could really use a review by the juju-core developers who introduced this feature.
Also it probably needs some work to get up to @evilnick 's standards.