Adding the _i18n.py file to use oslo.i18n libraries in mistral.
Also updating the requirements to support i18n.
Change-Id: I942a4f1b4a65a4a607b284dd44be547ae41642ce
Partial-Implements: blueprint mistral-i18n
We are replacing all usages of the 'retrying' package with
'tenacity' as the author of retrying is not actively maintaining
the project. Tenacity is a fork of retrying, but has improved the
interface and extensibility (see [1] for more details). Our end
goal here is removing the retrying package from our requirements.
Tenacity provides the same functionality as retrying, but has the
following major differences to account for:
- tenacity uses seconds rather than ms as retrying did.
- tenacity has different kwargs for the decorator and
Retrying class itself.
- tenacity has a different approach for retrying args by
using classes for its stop/wait/retry kwargs.
- By default tenacity raises a RetryError if a retried callable
times out; retrying raises the last exception from the callable.
Tenacity provides backwards compatibility here by offering
the 'reraise' kwarg.
- tenacity defines 'time.sleep' as a default value for a kwarg.
That said consumers who need to mock patch time.sleep
need to account for this via mocking of time.sleep before
tenacity is imported.
This patch updates all usages of retrying with tenacity.
Unit tests will be added where applicable.
Change-Id: I2af3cf024f5391088d602102d9a8039a46415f73
Closes-Bug: #1635380
Allows to use Jinja instead of or along with YAQL for expression
evaluation.
* Improved error reporting on API endpoints. Previously, Mistral API
tend to mute important logs related to errors during YAML parsing
or expression evaluation. The messages were shown in the http
response, but would not appear in logs.
* Renamed yaql_utils to evaluation_utils and added few more tests to
ensure evaluation functions can be safely reused between Jinja and
YAQL evaluators.
* Updated action_v2 example to reflect similarities between YAQL and
Jinja syntax.
Change-Id: Ie3cf8b4a6c068948d6dc051b12a02474689cf8a8
Implements: blueprint mistral-jinga-templates
* If a workflow is large then parsing a spec takes significant
time and it's too expensive to do it often. For example,
on a regular laptop parsing a workflow consisting from
100 tasks takes about 2 seconds. That was the reason why
such a workflow used to take so much time to start, ~200
seconds. This patch eliminates unnecessary parsing by
applying caching for workflow specifications.
Change-Id: Iabfdea2182a81cda07a8692f5b84c6bfb561bb83