GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.openstack.org — Plugins — DevStack documentation Plugins¶The OpenStack ecosystem is wide and deep, and only growing more so every day. The value of DevStack is that it’s simple enough to understand what it’s doing clearly. And yet we’d like to support as much of the OpenStack Ecosystem as possible. We do that with plugins. DevStack plugins are bits of bash code that live outside the DevStack tree. They are called through a strong contract, so these plugins can be sure that they will continue to work in the future as DevStack evolves. Prerequisites¶If you are planning to create a plugin that is going to host a service in the
service catalog (that is, your plugin will use the command
Plugin Interface¶DevStack supports a standard mechanism for including plugins from external repositories. The plugin interface assumes the following: An external git repository that includes a
Plugins are registered by adding the following to the localrc section
of They are added in the following format: [[local|localrc]] enable_plugin <NAME> <GITURL> [GITREF]
An example would be as follows: enable_plugin ec2-api https://opendev.org/openstack/ec2-api plugin.sh contract¶
source $PATH/TO/plugin.sh <mode> [phase]
The current full list of
Example plugin¶An example plugin would look something as follows.
# settings file for template enable_service template
# plugin.sh - DevStack plugin.sh dispatch script template function install_template { ... } function init_template { ... } function configure_template { ... } # check for service enabled if is_service_enabled template; then if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then # Set up system services echo_summary "Configuring system services Template" install_package cowsay elif [[ "$1" == "stack" && "$2" == "install" ]]; then # Perform installation of service source echo_summary "Installing Template" install_template elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then # Configure after the other layer 1 and 2 services have been configured echo_summary "Configuring Template" configure_template elif [[ "$1" == "stack" && "$2" == "extra" ]]; then # Initialize and start the template service echo_summary "Initializing Template" init_template fi if [[ "$1" == "unstack" ]]; then # Shut down template services # no-op : fi if [[ "$1" == "clean" ]]; then # Remove state and transient data # Remember clean.sh first calls unstack.sh # no-op : fi fi Plugin Execution Order¶Plugins are run after in tree services at each of the stages
above. For example, if you need something to happen before Keystone
starts, you should do that at the Multiple plugins can be specified in your System Packages¶Devstack based¶Devstack provides a custom framework for getting packages installed at an early phase of its execution. These packages may be defined in a plugin as files that contain new-line separated lists of packages required by the plugin Supported packaging systems include apt and dnf across multiple distributions. To enable a plugin to hook into this and install package dependencies, packages may be listed at the following locations in the top-level of the plugin repository:
Although there a no plans to remove this method of installing
packages, plugins should consider it deprecated for bindep¶The bindep project has become the defacto standard for OpenStack projects to specify binary dependencies. A plugin may provide a It is also possible to use the if use_library_from_git "diskimage-builder"; then GITREPO["diskimage-builder"]=$DISKIMAGE_BUILDER_REPO_URL GITDIR["diskimage-builder"]=$DEST/diskimage-builder GITBRANCH["diskimage-builder"]=$DISKIMAGE_BUILDER_REPO_REF git_clone_by_name "diskimage-builder" setup_dev_lib -bindep "diskimage-builder" fi will result in any packages required by the Using Plugins in the OpenStack Gate¶For everyday use, DevStack plugins can exist in any git tree that’s accessible on the internet. However, when using DevStack plugins in the OpenStack gate, they must live in projects in OpenStack’s gerrit. This allows testing of the plugin as well as provides network isolation against upstream git repository failures (which we see often enough to be an issue). Ideally a plugin will be included within the However, some times a DevStack plugin might be used solely to
configure a backend service that will be used by the rest of
OpenStack, so there is no “project tree” per say. Good examples
include: integration of back end storage (e.g. ceph or glusterfs),
integration of SDN controllers (e.g. ovn, OpenDayLight), or
integration of alternate RPC systems (e.g. zmq, qpid). In these cases
the best practice is to build a dedicated
Legacy project-config jobs¶To enable a plugin to be used in a gate job, the following lines will
be needed in your # Because we are testing a non standard project, add the # our project repository. This makes zuul do the right # reference magic for testing changes. export PROJECTS="openstack/ec2-api $PROJECTS" # note the actual url here is somewhat irrelevant because it # caches in nodepool, however make it a valid url for # documentation purposes. export DEVSTACK_LOCAL_CONFIG="enable_plugin ec2-api https://opendev.org/openstack/ec2-api" Zuul v3 jobs¶See the See Also¶For additional inspiration on devstack plugins you can check out the Plugin Registry. this page last updated: 2025-01-07 10:51:03
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |