Commit Graph

87 Commits

Author SHA1 Message Date
Andy Botting 60f305aca5 Fix murano-test-runner help output test
Due to slight differences in the --help output text for the test
runner, the output comparison no longer matches once you get past
python 3.8.

This fix cleans up the help text itself, and modifies the test to
only match on some specific elements, not the whole thing.

This should make the test less fragile going forward.

Change-Id: I7b94d8ae9eb58c43676ae3171c0f6193496c6d4b
2022-10-14 16:05:18 +11:00
Ghanshyam Mann 1c87ebf9a8 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

CONF object needs to be initialized before policy enforcer(). That
need to remove cfg.CONF.unregister_opts from TestAuthUtils cleanup
as this is taken care by cfg.clear() with proper workflow otherwise
it end up with error
"oslo_config.cfg.ArgsAlreadyParsedError: arguments
already parsed: reset before unregistering options"

- https://b132754ee7062a9ab187-9add4719a9922a9385555a8552fc2366.ssl.cf5.rackcdn.com/768520/5/check/openstack-tox-py38/7964354/testr_results.html

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: I1b6c6485bc651fd0b87244a68204036dd4aa37f4
2021-03-07 17:50:48 -06:00
Sam Morrison 9fe5a99acd Eventlet monkey patching should be as early as possible
We were seeing infinite recursion opening an ssl socket when running
various combinations of python3, eventlet, and urllib3. It is not
clear exactly what combination of versions are affected, but for
background there is an example of this issue documented here:

https://github.com/eventlet/eventlet/issues/371

(Commit message copied in part from nova commit
3c5e2b0e9fac985294a949852bb8c83d4ed77e04)

Change-Id: I76fed9e80a7f848a0f6b37c25dd035844c75a6ee
2019-12-18 16:08:53 +11:00
zhurong 4ee97f7b7a Bump to hacking 1.1.0
Change-Id: I4019f41d9ddd843872855e6e80c0667ee2df758a
2019-07-04 11:51:47 +00:00
zhurong 20af772ee7 Fix pep8 E402
Change-Id: Ie8eda174a6da50a222e4070a18a421eff28b6119
2019-01-09 13:23:29 +08:00
akhiljain23 4341093b14 Add framework for murano-status upgrade check
This commit adds the functionality of murano-status CLI for performing
upgrade checks as part of the Stein cycle upgrade-checkers goal.
It only includes a sample check which must be replaced by real checks in
future.

Change-Id: If7987cdf5d9a686abbcad5960b8f391f8b9518a3
Story: 2003657
Task: 26143
2018-10-24 09:31:33 +00:00
wu.chunyang 7a64448917 Update auth_uri option to www_authenticate_uri
Option auth_uri from group keystone_authtoken is deprecated[1].
Use option www_authenticate_uri from group keystone_authtoken.

[1]: https://review.openstack.org/#/c/508522/

Change-Id: Ib8623a359a27b8a4aa90bf69a3fe3f3a5c2411a6
2018-05-12 06:34:14 +00:00
zhurong a11afbe704 Enable mutable config in Murano
New releases of oslo.config support a 'mutable' parameter to Opts.
This is only respected when the new method mutate_config_files is
called instead of reload_config_files. Heat delegates making this call
to oslo.service, so how do we switch?
Icec3e664f3fe72614e373b2938e8dee53cf8bc5e allows services to tell
oslo.service they want mutate_config_files to be called by passing a
parameter, which this patch does.

This allows Murano to benefit from
I1e7a69de169cc85f4c09954b2f46ce2da7106d90, where the 'debug' option
(owned by oslo.log) is made mutable. We should be able to turn debug
logging on and off by changing the config and sending SIGHUP.

Change-Id: Ia7e405392fe67eb9c4abf2408db0fa25c5546958
Story: 2001545
2018-03-23 08:57:22 +08:00
Jenkins ea4a304398 Merge "Replace six.iteritems() with .items()" 2017-05-03 20:35:15 +00:00
M V P Nitesh 580677eedc Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve
iterators. We can use dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will more readable.
2.In py2, the performance about list should be negligible, see the
link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I45fa65427318e1c35bb521de46e81ea12ca7b770
2017-05-03 09:17:18 +00:00
zhurong 75b47bbabd Make murano auth with murano_auth section instend of keystone_authtoken
This patch add a murano_auth for murano auth with keystone,
This gives ability to fine-tune role-based privileges for
service-user going to execute trust-delegated tasks and the auth
configuration properties do not need to change when keystonemiddleware
deprecates its configuration properties.

Closes-Bug: #1643583
Closes-Bug: #1658648
Change-Id: If10fa8c938c264c7b5cadb3c3ed77f39488dcab7
2017-04-21 10:37:44 +08:00
shihanzhang 06746baa32 Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I24ca32d9e92cdd2b3a91916337839d116e335084
2017-04-03 12:11:20 +08:00
chenaidong1 155f747a66 Modify variable's usage in Log Messages
String interpolation should be delayed to be handled by the logging code,
rather than being done at the point of the logging call.
Ref:http://docs.openstack.org/developer/oslo.i18n/guidelines.html#log-translation
For example:
# WRONG
LOG.info(_LI('some message: variable=%s') % variable)
# RIGHT
LOG.info(_LI('some message: variable=%s'), variable)

Change-Id: If8d36220a9370b304ae51a329f8bba370285fdc2
2016-12-06 09:13:14 +00:00
Alexander Tivelkov 3a18488cf4 Revert "Update devstack keystone_authtoken config to fit with keystone v3"
This reverts commit df8bf9c8f8.
That patch renamed keys of the configuration properties of the
keystone_authtoken settings group, thus breaking config file
compatibility.

Change-Id: I8fd3b3211e75207cf6061eef6f038ea045d9dbfe
2016-11-23 15:52:01 +00:00
zhurong df8bf9c8f8 Update devstack keystone_authtoken config to fit with keystone v3
Now murano can not auth when only using keystone v3,
this commit update the devstack config to fix with keystone v3.

Closes-bug: #1633394
Change-Id: Ie6a2ccdf6121b3badd403a1c08f1e91052e8c4dc
2016-10-19 02:17:04 +00:00
Stan Lagun 2f2132350d TestFixture mocks were updated
Core library was updated as part of the multi-region support
effort. FormatVersion of the core library was incremented and,
as a result $dict.key expressions started to work as they are in
yaql 1.0 rather than in 0.2 and the presence of the key become
mandatory. However Network mock in the TextFixture used to
return empty dictionary and it caused Instance class to fail.
The commit adds missing keys to the dictionary returned by
the joinInstance() method.

Also the test runner was improved to print the stack trace
upon failures so that it is possible to identify where the
error happened.

Change-Id: Ia7b0f61370effe4f13fed4ec85e806f3b0fdb80b
2016-08-29 10:05:49 -07:00
zhurong 23fbee8dcd Add multiple api workers
There is currently no way to specify the number of api workers,
This patch add multiple api workers support.

Change-Id: Id79cb7a3e056cf5ddc9967f2f26e1973f1473e8b
Closes-Bug: #1603343
2016-08-10 13:54:36 +00:00
Stan Lagun 77e3c6e2e9 Ability to instantiate object graph
Adds ability to load object sub-graph in a single call.
The graph may either be defined in the serializable
object-model format

?:
  id: ...
  type: ...
  classVersion: ...
  package: ...
 prop1: value
 prop2: value2

 or in the MuranoPL format

 ns:Type:
   prop1: value1
   prop2: value2
 id: ...
 name: ...

During the load IDs of the loaded objects are re-generated so
that explicit specification of IDs is only necessary for specification
of references within the graph and are not retained.

The load is done in the temporary ObjectStore. Loaded objects are
copied to the main ObjectStore then.

3rd overload of the new() function was added to deserialize the model:
new($model, $owner)

Change-Id: I849a5d6c9a28843398a4c4c884a1c3138ac7ede3
2016-07-28 14:13:22 +00:00
Stan Lagun 0a835b87f0 Refactoring of the ObjectStore passing in DSL
ObjectStore is a container for all of the objects that are either
loaded from object model or created at runtime. Thus ObjectStore
instance is required in order to either use new() function or use
class() contract with object model snippet.

In current implementation each object had a object_store property
that was pointing to the ObjectStore instance used to create it (the
one that has the object). In order to create new object an ObjectStore
of the $this object was used for that purpose. This approach caused
several issues:
* There is no $this object in static methods and thus no way to obtain
   current ObjectStore
* Objects are bind to their stores so temporary ObjectStore instances
  cannot be used to load object graphs

 This refactoring moves ObjectStore instances to the thread-local attribute.
 Thus there is always a "current" ObjectStore.

 Also because ObjectStore has a reference to the MuranoDslExecutor instance
 it becomes possible to get current executor and everything else that it contains
 (current execution session, attribute store, package loader) from the local
 thread storage without passing it in the hidden context variables.

Change-Id: I19a08b391486c1ae1b98ca559c8d3fafaca6e1ef
2016-07-27 02:32:18 +00:00
Alexander Tivelkov 01af152ab6 Improved Test-Runner's output
Test-Runner was putting all its output into the default logger instead
of stdout / stderr. Thus the output was often lost between the log
mesasges of MuranoPL executor.

This patch modifies the output to make it more readable and separates
it from the log output.

Also this patch changes the default for the 'use_stderr' configuration
parameter to 'False' so the log output is not returned to stderr
unless explicitly configured otherwise.

Closes-bug: #1585234
Change-Id: Ia7435aa0e42d74e12911d3b8c199ce530708b5c3
2016-06-30 19:26:09 +03:00
Alexander Tivelkov 63b75569b1 Test-runner now properly invokes setUp/tearDown methods
Test-runner was looking only for the locally-defined methods (i.e.
ignoring the inherited ones) when invoking service methods of test
fixtures, such as 'setUp' and 'tearDown'. This caused incorrect
behavior when these methods were defined in base classes of the actual
fixtures.

Change-Id: Ife4e4bed7e945093bb751da4ed0f8336c69c9065
Closes-bug: #1596509
2016-06-30 19:26:09 +03:00
zhurong 176379f601 Move service broker api to the top level
Create separate murano-cfapi-paste.ini for service broker,
Change service broker start command to:
`murano-cfapi --config-file etc/murano/murano-cfapi.conf`

And move service broker api to the top level.

Change-Id: Id56786f31c16da11019a2064cc4285bdd266f538
partial-implement: bp separate-service-broker-from-murano
2016-05-31 21:33:06 -04:00
zhurong deb487d8c0 Generate separate db for murano service broker
1) Create separate config use the separate config.py
to use: tox -egencfconfig

2) Create separate db for murano service broker
to use: tox -e venv murano-cfapi-db-manage \
	--config-file etc/murano/murano-cfapi.conf upgrade

Change-Id: Ifd3551ace000e496d99725f46dbead62f7ef64b0
partial-implement: bp separate-service-broker-from-murano
2016-05-31 21:25:33 -04:00
Bertrand Lallau a78185b452 Remove unnecessary executable permissions
Removes executable permissions on python modules not requiring it.

Change-Id: I57b0ede2cff6225a4169b6ce4a8cf037cdbd5730
2016-05-23 21:55:26 +02:00
Stan Lagun 091b4d1d18 Allow insecure SSL communications with RabbitMQ
Add insecure option to [rabbitmq] section of murano.conf

This is a partial fix because it improves Engine <-> RMQ
 communications but the same problem exist on
 Agent <-> RMQ side

 Partial-Bug: #1578421

Change-Id: I55207c3016da12be45918a7dc33795abf69627b4
2016-05-11 11:19:43 -07:00
Jenkins 8d2b5b9cd6 Merge "Do not wait for MessageHandlingServer" 2016-03-18 14:10:29 +00:00
varshak05 940d69394c Do not wait for MessageHandlingServer
This commit adds ApiService/NotificationService service
implementation that has its own wait() and encapsulates
MessageHandlingServer instance.

Similar issue was fixed for murano-engine, this commit fixes the same
for murano-api service.

Change-Id: Ia1566dc79aa5a05a00851fcf48f3e7318ac85d54
Closes-Bug: #1521087
2016-03-17 20:25:03 +03:00
Kirill Zaitsev cdeaff8cc2 Deprecate packages_opts conf group
Group 'packages_opts' has always been inconsistent, since it included
'opts' into it's name and options in that group we related to both
engine and api. This commit moves engine related options to [engine]
group and api-related options to [murano] group.

This restores backward compatibility with liberty configs, that included
'load_packages_from' into [engine] group

'packages_opts' is added to all the options moved as deprecated_group,
thus retaining backward compatibility with old configs

Change-Id: I00b6f06ec352de4b57baaa86da9155bb36bcc23a
Closes-Bug: #1543027
2016-03-15 13:21:50 +03:00
Tin Lam 151d8cfe30 Moved CORS middleware configuration into oslo-config-generator
The default values needed for murano's implementation of cors
middleware have been moved from paste.ini into the configuration
hooks provided by oslo.config. Furthermore, these values have been
added to the default initialization procedure. This ensures
that if a value remains unset in the configuration file, it will
fallback to using sane defaults. It also ensures that an operator
modifying the configuration will be presented with that same
set of defaults.

Change-Id: I50a204e27a43991d94cfb5f39c1dd3e904eb5696
Closes-Bug: #1551836
2016-03-04 17:00:44 -06:00
Jenkins 3d9f2b2245 Merge "Add multiple engine workers" 2016-03-01 00:19:53 +00:00
Hidekazu Nakamura 205c94f761 Add multiple engine workers
Implement murano-engine workers for scalability.

Depends-On: I1de509b061bd5d3fe0cd5e27673c54a13209a56a

Change-Id: I3cbc9dff9cc0e476a897af3f1931ff2a61eb72cc
Implements: blueprint multiple-engine-workers
2016-02-22 10:46:17 +09:00
Stan Lagun fc76b3b1b4 Major refactoring of how OS clients are created and managed
* Single universal ClientManager class was dropped in favor of
   of individual in-context methods to create OS clients without
   ClientManager restrictions.
* Environment class was renamed to ExecutionSession to avoid
   common confusion with io.murano.Environment
* execution_session_local module was introduced to simplify
   keep of per-execution session (per-deployment) data. This
   is similar to thread-locals with the difference that there can
   be many threads in single session.
* All OS-clients related code was migrated to keystone client
   sessions and API v3 (except for GLARE and Mistral that doesn't
   support sessions). This increases performance and solves
   authentication problems that could be caused by token expiration
   even with trusts enabled.
* [DEFAULT]/home_region setting was introduced instead of
   [murano]/region_for_services to configure what region
   should be used by the clients by default (where Murano API
   resides). All client factories respect this setting.

Change-Id: If02c7e5d7d39574d0621e0e8dc27d1f501a31984
2016-02-20 17:59:11 +03:00
Stan Lagun 94c904e1cb Support for static methods/properties
Both properties and methods can be marked as Usage: Static

Statics can be accessed using ns:Class.property / ns:Class.method(),
:Class.property / :Class.method() to access class from current namespace
or type('full.name').property / type('full.name').method() to use full type name.

In static method $ / $this are referencing current class rather than object.
Static properties are not loaded from object model.

Also methods of io.murano.configuration.Linux class are now static.
Since static methods can be called on the instance it doesn't break
backward compatibility.

Implements blueprint: muranopl-statics
Change-Id: Ic7c6beed9222f4bca118877a60fdabfdd9d65e5a
2016-02-18 22:23:19 +00:00
Victor Ryzhenkin 1ca4e682cf Use eventlet.monkey_patch() before any libs are loaded
Monkeypatching should be before everything, including imports.
This patch ensure eventlet have patched modules before they are loaded
and used.

Change-Id: I6056bdbd20c14e762702ad19c9779a4be79952b8
Closes-Bug: #1545538
2016-02-18 10:32:04 +00:00
Kirill Zaitsev 348cc2774c Move load_packages_from from engine section to packages_opts section
Related bp: murano-engine-package-cache

Change-Id: I8fff2f8e67686b533bffe19c50e7d87752482ddb
2016-02-01 14:23:04 +03:00
Ravi Shekhar Jethani 7ea4442e9c Fix import order of modules
Make corrections in import order for six, yaml, eventlet and
greenlet as per OpenStack import standards [1].

[1] http://docs.openstack.org/developer/hacking/#import-order-template

Change-Id: I26feb4adb81e8b07a7a36ac7f0a6235536a8c119
2016-01-24 23:34:03 -08:00
Ravi Shekhar Jethani e633fd004a Python3: Replace dict.itervalues with six.itervalues
This also adds a check to murano/hacking/checks.py that should
catch this error in the future.

Blueprint murano-python-3-support

Change-Id: I50a8b2f98ddbc2819ae180b68468e0a51c13281b
2016-01-18 03:04:23 -08:00
Jenkins 502d44b062 Merge "Fix logging_setup call" 2016-01-15 15:36:39 +00:00
Ravi Shekhar Jethani 859888d62a Python3: Replace dict.iteritems with six.iteritems
This also adds a check to murano/hacking/checks.py that
should catch this error in the future.

Blueprint murano-python-3-support
Change-Id: Ib8b2b91a40577d18739f0c1bf2c37b7cf4060560
2016-01-15 03:15:23 -08:00
Ekaterina Chernova fd6d9221bf [test-runner] Create new executer on each test case
Closes-Bug: #1529212
Change-Id: I5d96ab228afdb042f0557adbe5551310997ccce8
2015-12-25 17:27:01 +03:00
Ekaterina Chernova 1952c70b81 [test-runner] Put TestFixture class check to the right place
Previously it was done during object instantiation and
was useless.

Change-Id: I10827d2006e11cb734ad436adbf8f56e02710780
Closes-Bug: #1528210
2015-12-21 16:35:00 +03:00
Jenkins 7b6f754cc1 Merge "[murano-test-runner] Mark 'package' as required parameter" 2015-12-21 12:46:21 +00:00
Ekaterina Chernova c4461be16a [murano-test-runner] Mark 'package' as required parameter
Also now package param is positional.

Change-Id: I8f42821ea07b3adb4157d6a55c489a5bc2471219
Closes-Bug: #1524311
2015-12-15 17:47:07 +03:00
Jenkins 67970f3a5d Merge "Add MockContextManager" 2015-12-09 15:54:59 +00:00
Stan Lagun 05edab3661 Do not wait for MessageHandlingServer
Previously oslo.messaging's MessageHandlingServer
was used as as a murano-engine service in service launcher.
As a result it's wait() method was called. But after recent
changes it's wait method is supposed to be call only
after stop() to wait for graceful message processing to end.
As a result a warning was printed that stop() didn't finish
after 30 sec from wait() invocation (because it was never called).

This commit adds EngineService service implementation
that has its own wait() and encapsulates MessageHandlingServer
instance.

Change-Id: Ie553e0b27cc1c261b963907b4f12f89795b99a12
Closes-Bug: #1521087
2015-12-09 12:30:49 +03:00
Ekaterina Chernova fd59720b1b Add MockContextManager
It is used in murano-test-runner.

Mocks are inserted into new context, that is created
from the current context:
If mock for the current object exist, new linked context
   (``murano.dsl.linked_context.LinkedContext``) will be returned. It links
   existing context with the new context, where mock definition is presented.
   So if mocked function will be called, context will contain two
   definitions with that function: mock and original one, but mock will have
   higher priority.

If there is no mock for the current object or class, existing context
   will be returned. If there is no existing context, *None* will be returned.

Targets blueprint mock-context-manager

Depends-On: I9eccdf3af1802c731bfdfb93df92c4ad902a4d34
Change-Id: I9a55d07188ff06bdf98248f011a700c297e33417
2015-12-08 14:10:22 +03:00
Lin Yang 886c881ab8 Add verbosity control for Murano-test-runner
Use '-v' to make test-runner to be more verbose instead of printing
version.

Change-Id: I2225ccfd7f8fe4f7901b7c357ba8d89572c5f5be
Closes-Bug: #1508429
2015-11-25 05:51:46 +08:00
Hidekazu Nakamura 7c33bc5d27 Fix logging_setup call
In murano.cmd.api module, main() calls logging_setup() after
parse_args(), but logging_setup() is already called in
parse_args(). murano.cmd.engine module is the same.

This patch fixes to call logging_setup() once.

Change-Id: I2012cd7e60922fadbb20c6daa5302fe0cabbef22
Closes-Bug: #1518186
2015-11-21 00:13:50 +09:00
Lin Yang bfcf923879 Update help message of test-runner to same format
Previously, the help message of --os-auth-url, "Authentication URL
(Env: OS_AUTH_URL)", is not same as other arguments of OS
environment variable. So update it to same format.

Change-Id: Iaed9b56016af8ce4c3470c55157458563b41ddcb
Closes-Bug: #1515781
2015-11-13 05:54:32 +08:00
Ekaterina Chernova 7ee2339eb1 [test-runner] Show help on error
Help is shown if no arguments are provided.
Also additional formatting was added.

Closes-bug: #1508420
Closes-Bug: #1508422

Change-Id: Idf3b2bf0d5cbbc134795bcd2d1b24cf694f1975e
2015-10-30 15:10:06 +03:00