Description
Install Cloud Weather Report along with its toolchain needed for testing
charms in the context of a CI.
Overview
This subordinate charm prepares a Jenkins master node to test Juju artifacts
(charms and bundles). All tests are isolated in a LXC container.
Deployment
A working Juju installation is assumed to be present. If Juju is not yet set
up, please follow the getting-started instructions prior to deploying this
charm.
This charm is intended to be deployed as part of the cwr-ci bundle:
juju deploy cs:~juju-solutions/cwr-ci
Note: CWR requires Juju 2.1.0 or greater.
This will deploy Jenkins with this charm acting as the charm/bundle test
mechanism. More information about this deployment can be found in the
bundle readme.
Status
This charm provides extended status to indicate when it is ready:
juju status
This is particularly useful when combined with watch to track the on-going
progress of the deployment:
watch -c juju status --color
The message column will provide information about this unit's state.
Network-Restricted Environments
Charms can be deployed in environments with limited network access. To deploy
in this environment, configure a Juju model with appropriate proxy and/or
mirror options. See Configuring Models for more information.
Configuration
Custom Test Container
As mentioned earlier, all tests are isolated in a LXC container. The default
container image includes all software necessary to run cwr. Optionally,
you may provide your own container image. To create an image, see the
./scripts/build-cwrbox-image utility. Use your custom image by either:
-
Attaching a resource to this charm:
juju attach cwr cwrbox=./myimage.tgz
-
Configuring this charm with the URL/key of a remotely hosted image:
juju config cwr \
cwrbox_image=\
cwrbox_keys=
Grant Access to CWR
To run tests, this charm needs access to your controller(s) to create models
and allocate resources needed to run charm/bundle tests. The steps required to
do this are covered in detail in the Getting Started section of the
cwr-ci bundle readme. A summary of the procedure is as
follows:
- Add a user to your controller(s)
- Grant
add-modelpermissions to the new user(s) - Run the
register-controlleraction - Run the
set-credentialsaction - Optionally run the
store-loginaction
Usage
The test capabilities of this charm are covered in detail in the Workflows
section of the cwr-ci bundle readme. At a glance, the
following usage scenarios are supported via charm actions:
- Test a charm when a commit is made to a charm source repository
- Test a charm when a release is created in a Github charm source
repository - Test a charm when a pull request is created in a Github charm source
repository - Test a bundle when an included charm is updated in the Charm Store
Resources
Community
#jujuon Freenode- Juju mailing list
- Juju community
Technical
CWR leverages a plethora of tooling from the Juju ecosystem.
Details can be found at the following project links:
Configuration
- subnet
- (string) Subnet to use for LXD containers, such as 10.0.0.1/24. Must not conflict with other routable subnets. If left blank, a random 10.x.x.1/24 subnet will be selected.
- cwrbox_image
- (string) URL from which to retrieve the cwrbox LXD image. The image can also be provided as a Juju resource, with the resource being used in favor of this URL if available. The signature will be fetched as this URL with '.sig' added.
- https://s3.amazonaws.com/jujubigdata/cwrbox/cwrbox.tar.gz
- package_status
- (string) The status of service-affecting packages will be set to this value in the dpkg database. Valid values are "install" and "hold".
- install
- extra_packages
- (string) Space separated list of extra deb packages to install.
- cwrbox_keys
- (string) List of keys trusted to sign the cwrbox LXD image. Keys can be either full keys, or full fingerprints (without spaces). Key IDs (short nor long) cannot be used.
- - 5762CA76ABD635A79185394EDB6E071B449C78B1 # johnsca@apache.org - 41990B866D39752AFCF2BB48CA9FECE740A9923F # kwmonroe@apache.org
- install_keys
- (string) List of signing keys for install_sources package sources, per charmhelpers standard format (a yaml list of strings encoded as a string). The keys should be the full ASCII armoured GPG public keys. While GPG key ids are also supported and looked up on a keyserver, operators should be aware that this mechanism is insecure. null can be used if a standard package signing key is used that will already be installed on the machine, and for PPA sources where the package signing key is securely retrieved from Launchpad.
- install_sources
- (string) PPAs from which to install LXD and Juju
- - ppa:juju/stable - ppa:ubuntu-lxc/lxd-stable