Juju Charm - Glance Simplestreams Sync
Go to file
James Page fd3d2b7610 Switch to using snap for simplestreams tools
Switch over to using the new simplestreams snap instead of using
the largely unmaintained packaging in distro (and various PPA's).

This drops direct integration with the simplestreams codebase
in preference to just calling the sstream-mirror-glance command
with the correct parameters.

This commit includes refactoring of 'custom_properties' handling
which was actually broken - there was no loading of the yaml
formatted list, which was probably overkill, so the option now
takes a space separated list of key=value pairs, for example:

 custom_properties="hw_firmware_type=uefi hw_vif_multiqueue_enabled=true"

Fix version comparison in script wrapper.

Drop Trusty support - snaps on Trusty are awkward requiring new
kernel versions and trusty support was only retained for upgrade
purposes anyway.

Drop unsupported Xenial OpenStack versions.

Fixup CA cert handling to use any charm installed CA cert (including
that provided via the certificates relation) and install cert
to snap compatible location for simplestreams to use.

Add basic action to perform image sync on demand an refactor
the glance simplestreams sync wrapper to work within a hook
context to support the action.

Disable automatic scheduling of image syncs by default as this
tends to be racey during deployment resulting in images being
synced to glance unit local storage.

Add bionic-ussuri bundle and make it the default smoke test.

Deprecate source and key options - no longer required for
deployment with snap.

Change-Id: I730df6b7f5955ddfeea5b8de15490ac083823f5a
Func-Test-PR: https://github.com/openstack-charmers/zaza-openstack-tests/pull/321
2020-06-18 08:50:02 +01:00
actions Switch to using snap for simplestreams tools 2020-06-18 08:50:02 +01:00
charmhelpers Updates for 20.08 cycle start for groovy and libs 2020-06-02 14:30:43 +01:00
files Switch to using snap for simplestreams tools 2020-06-18 08:50:02 +01:00
hooks Switch to using snap for simplestreams tools 2020-06-18 08:50:02 +01:00
lib Update tox, requirements, add initial func tests framework 2018-04-06 22:06:49 +00:00
templates Merge "Add custom_properties config option" 2019-12-03 12:38:20 +00:00
tests Switch to using snap for simplestreams tools 2020-06-18 08:50:02 +01:00
unit_tests Switch to using snap for simplestreams tools 2020-06-18 08:50:02 +01:00
.gitignore Update series metadata, test combos and readme 2018-04-10 14:33:49 +00:00
.gitreview OpenDev Migration Patch 2019-04-19 19:40:14 +00:00
.stestr.conf Replace ostestr with stestr in testing framework. 2019-03-07 17:11:21 -05:00
.zuul.yaml Switch to Ussuri jobs 2019-12-03 16:54:34 +08:00
actions.yaml Switch to using snap for simplestreams tools 2020-06-18 08:50:02 +01:00
charm-helpers-hooks.yaml Sync charm/ceph helpers, tox, and requirements 2019-09-30 22:10:06 -05:00
config.yaml Switch to using snap for simplestreams tools 2020-06-18 08:50:02 +01:00
copyright Update copyright date 2018-05-08 12:37:36 -05:00
HACKING.md Add doc pointing contributors to charm-guide 2019-07-16 09:42:57 +02:00
LICENSE Relicense to Apache2 2018-05-08 12:30:29 -05:00
Makefile Migrate from Amulet to Zaza 2019-09-12 22:41:32 +12:00
metadata.yaml Switch to using snap for simplestreams tools 2020-06-18 08:50:02 +01:00
README.md Add ssl_ca option to enable to gss 2019-01-11 09:37:56 +00:00
requirements.txt Sync charm/ceph helpers, tox, and requirements 2019-09-30 22:10:06 -05:00
setup.cfg Initial baseline from bzr 2017-04-10 09:00:27 +01:00
test-requirements.txt Misc tidy up for flake8 upgrade 2020-06-03 12:02:17 +01:00
tox.ini Add py38 tox target 2020-06-11 06:45:23 +01:00

Known Issues

https://bugs.launchpad.net/charm-glance-simplestreams-sync

Overview

This charm provides a service that syncs your OpenStack cloud's available OS images in OpenStack Glance with the available images from a set of simplestreams mirrors, by default using cloud-images.ubuntu.com.

It will create a user named 'image-stream' in the 'services' tenant. If swift is enabled, glance will store its images in swift using the image-stream username.

It can optionally also store simplestreams metadata into Swift for future use by juju. If enabled, it publishes the URL for that metadata as the endpoints of a new OpenStack service called 'product-streams'. If using Swift is not enabled, the product-streams service will still exist, but nothing will respond to requests to its endpoints.

The charm installs a cron job that repeatedly checks the status of related services and begins syncing image data from your configured mirrors as soon as all services are in place.

It can be deployed at any time, and upon deploy (or changing the 'run' config setting), it will attempt to contact keystone and glance and start a sync every minute until a successful sync occurs.

Requirements

This charm requires a relation to keystone. It also requires a running glance instance, but not a direct relation to glance. It connects to glance via its endpoint as published in keystone.

Usage

juju deploy glance-simplestreams-sync [--config optional-config.yaml]
juju add-relation keystone glance-simplestreams-sync

Configuration

The charm has the following configuration variables:

run

run is a boolean that enables or disables the sync cron script. It is True by default, and changing it from False to True will schedule an immediate attempt to sync images.

use_swift

use_swift is a boolean that determines whether or not to store data in swift and publish the path to product metadata via the 'product-streams' endpoint.

NOTE Changing the value will only affect the next sync, and does not currently remove an existing product-streams service or delete potentially stale product data.

frequency

frequency is a string, and must be one of 'hourly', 'daily', 'weekly'. It controls how often the sync cron job is run - it is used to link the script into /etc/cron.$frequency.

region

region is the OpenStack region in which the product-streams endpoint will be created.

mirror_list

mirror_list is a yaml-formatted list of options to be passed to Simplestreams. It defaults to settings for downloading images from cloud-images.ubuntu.com, and is not yet tested with other mirror locations. If you have set up your own Simplestreams mirror, you should be able to set the necessary configuration values.

ssl_ca

This is used, optionally, to verify the certificates when in ssl mode for keystone and glance. This should be provided as a base64 encoded PEM certificate.