Option to configure pip source for murano-agent

With this small changes it becomes possible to instruct murano to
provision murano-agent of version other than latest, or from
custom git branch or from a http source.

Use cases:
* Use agent with custom modifications that are not available in
  PyPI version
* Development of new agent features - agent can be installed from
  the private git repo
* Environments without internet connectivity

Change-Id: Icbea95abf070ef35781474a54461cc34bb9927af
This commit is contained in:
Stan Lagun 2018-01-05 13:15:40 -08:00 committed by zhurong
parent d9cb56fe5b
commit ef3b0d4f7d
4 changed files with 13 additions and 1 deletions

View File

@ -93,6 +93,7 @@ Methods:
"%MURANO_AGENT_CONF%": base64encode($muranoAgentConf)
"%MURANO_AGENT_SERVICE%": base64encode($muranoAgentService)
"%MURANO_AGENT%": base64encode($muranoAgent)
"%PIP_SOURCE%": config(engine, agent_source)
- $userData: $muranoScript.replace($muranoReplacements) + $initScript.replace($scriptReplacements)
- Return: $userData

View File

@ -17,7 +17,7 @@ else
# TODO(kzaitsev): use deb/rpm packages as soon as we can
echo "installing murano agent from pip"
echo "binary not found in PATH: $PATH"
pip install murano-agent
pip install '%PIP_SOURCE%'
fi
muranoAgentConf='%MURANO_AGENT_CONF%'

View File

@ -223,6 +223,9 @@ engine_opts = [
cfg.StrOpt('signing_key', default='~/.ssh/id_rsa',
help=_('Path to RSA key for agent message signing')),
cfg.StrOpt('agent_source', default='murano-agent',
help=_('pip URL/package spec for murano-agent')),
]
# TODO(sjmc7): move into engine opts?

View File

@ -0,0 +1,8 @@
---
features:
- |
A configuration file setting `[engine]/agent_source` was added.
The value is then used for the `pip install` command to install the
murano-agent. Since pip accepts http and git URLs, this can be used
to install agent from the custom git repo or install version other than the
latest.