* With default region, it was not possible
to correctly determine keystone endpoint
for a set of actions: nova, mistral etc.
because they use the same default region
for keystone endpoint if none provided.
Keystone endpoint should rather be gotten
using keystone_authtoken.region_name config
option.
Note: fix does not affect keystone actions.
Keystone actions use auth_uri from context as
an endpoint.
Change-Id: I8abd59790d4bf60ed71ae3100492b782c35ad6ce
* Added 'triggered_by' into 'runtime_context' of task execution
in the form:
[
{
'task_id': '123-123-123',
'event': 'on-success'
},
...
]
This allows to do backtracking of task execution history, i.e.
we can see what task and on what event initiated the run of the
given task.
* Minor style changes.
TODO:
* Support 'join' task use case
* Add 'runtime_context' into task execution REST resource
Change-Id: I20e5d0d282527ea7996ff5f84eb11bc9c6e843fe
Partially implements: blueprint mistral-previous-tasks
* Method rest_utils.get_all() was not composed efficiently enough.
It applied 'resource_function' to potentially load additional
fields even if only specific fields were requested by a user.
This patch fixes this by splitting the whole logic of the method
into cases when specific fields are requested and when they are
not.
* Added the method from_tuples() to rest resources to optimize
loading of db objects in case if only specific fields are
requested. Method from_dict() and from_db_model() are now
based on it.
Change-Id: I318c07f0c86e8aec404ae2357c3c10bf3ca6bed3
* Using method from_db_model() of REST resources where possible
which is more efficient than from_dict() that requires one more
object in memory (a dict)
* Minor style changes
Change-Id: Ie1f3137bee94328f2af676a0831e30c1cf212f47
Now keystone_authtoken.region_name is used
both for requesting admin keystone endpoint
and default region for openstack actions.
Default region doesn't work for environments
with keystone in 1 region and mistrals in many
regions.
Due to above just specifying default_region name
separately for openstack actions can solve the problem
Closes-Bug: #1691660
Change-Id: I1eeea298feca45de37d77d791e1548ec5e7161a1
AdHoc actions can be defined using YAQL and Jinja2 expressions in the
same way as Tasks, but they could not access the associated context
data because the context was not available when the expression is
evaluated. This patchset passes the task and workflow context into
the AdHocAction object so that the inputs can be evaluated using the
available context, and the context data will be available for
reference.
Added a test to verify that the env() works in AdHoc Actions.
Change-Id: Ib95604d3d494a443e852bc7f5eee24f398b1648c
Closes-Bug: 1690158
This patch updates the docker README file to include the --link arg
to the command for launching a Mistral container to ensure the
rabbitmq and mistral containers can communicate.
This patch also adds a new section that explains how and why to
mount the Mistral source code as a volume in a running container.
Change-Id: Iec25f7e7dfda0bc8c9b38fa37b048448d73f66e4
Co-Authored-By: Brad Crochet <brad@redhat.com>
* This is a preparation for optimizing API layer. We need to
get rid of redundant data coversions like "db model -> dict ->
REST resource". We can do directly "db model -> REST resource".
To do that, db models need to have a method that returns
column values w/o creating a dictionary.
Change-Id: I89c78fdce256249286903c4e2c8bef2a5bf63af7
if called by mistral-db-manage it will log info level
to /var/log/mistral/mistral-db-manage
Included some debug level logging also for main actions.
Change-Id: I0574b38efcc0dd7485953bf3089ff0a5a3ef6394
Closes-Bug: #1689821
A new config item 'modules-support-region' is introduced to be used by
cloud operators, mistral will decide if add 'action_region' param to
openstack service action inputs according to that config.
Fixed an action definition for tempest tests.
TODO: Add release note.
Implements: blueprint mistral-multi-region-support
Change-Id: I0b582e9f81ab72cd05f4fae592c568f38dec6e00
* This parameter, if set to False, prevents from evaluating
expressions in a workflow environment. By default, it's set to
True for backwards compatibility. In some cases, it guarantees
safety from blowing size of the evaluated objects (e.g. if
there are expressions in it like <% $ %> and <% env() %>). Or
if we simply don't want to evaluate it because we want to have
a text in the environment containing expressions as informative.
Change-Id: I116004e9e2d0269fc69e39b552165f6e0720148a
Closes-Bug: #1690319
* Without hide_args=True parameter @profiler.trace() works much
slower because it gets string representation of decorated method
parameters internally. Adding it slightly improves performance.
Change-Id: I75a8fecd2e37b1d25c6f70501711e709c2d2ae25
The previous patch to add support for apache breaks gunicorn. The gunicorn
setup loads the mistral.api.wsgi module and requires the application
variable be assigned. The support for apache make the assumption that the
mistral.api.wsgi be called as a python script. This patch moves the init
function required by apache to a different location.
Change-Id: Ib5af50a55d3f3bb9d0fa0d1ee6b8e7564f909d70
Closes-Bug: #1689943
The puppet module puppet-mistral is moving to use a proper keystone
authtoken module. This supports that transition. A follow on patch
will remove the transition code.
Change-Id: Ief32ae01372c8c8d32fc5e2c89a2927510983a5b