900 Commits

Author SHA1 Message Date
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
Jenkins
cc511c9f97 Merge "Added package references to generated UIs" 2016-05-25 20:50:30 +00:00
Jenkins
9d72a5b57f Merge "Forced flush of tmp file to disk on ui retrieval" 2016-05-25 15:34:56 +00:00
Alexander Tivelkov
afa85b3c21 Added package references to generated UIs
Generated UIs of the non-muranoPL packages (HOT, cloudify_tosca and
CSAR) reference the type of object model's object by class FQNs.
However, when these packages are uploaded to glare, their class
contents are not indexed since the client which uploads them has no
knowledge of the generated classes.

To workaround this issue it is proposed to reference objects not just
by class FQNs but to include the package FQN and the version, so the
engine does not have to rely on Glare's indexes.

Change-Id: I6175e89b68bcdfc29d33ae3616d6ecba662f2509
Partial-bug: #1565805
2016-05-24 21:35:46 +03:00
Alexander Tivelkov
623ebce812 Forced flush of tmp file to disk on ui retrieval
UI retrieval routine loads the package's temporary file  from disk
to properly render its ui. This procedure does not close the file
before reading it, so the write buffers should be flushed first.

This was causing the bug when the UI could not be properly fetched
from the API.

Change-Id: I53cd08945c826dd18a7308f9f007d50241bb9041
Closes-bug: #1565805
2016-05-24 18:46:25 +03: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
Jenkins
3a31b844ab Merge "Add models and migration for new service broker db" 2016-05-20 15:18:35 +00:00
Jenkins
010e7f9d4d Merge "[Trivial] Fix mismatch string format argument" 2016-05-20 07:17:29 +00:00
Jenkins
5a5a92f9cf Merge "Increase status report messages time resolution" 2016-05-19 11:07:17 +00:00
Lin Yang
67f2cc2e80 [Trivial] Fix mismatch string format argument
Change-Id: I4de489605ba70170f4e888d5532e9eabb853bf66
Closes-Bug: #1583453
2016-05-19 14:56:04 +08:00
zhurong
80d92d8111 Add models and migration for new service broker db
Create all stuff which is needed for cf db migration: models, migration
This will be used to generate a new service broker db.
This is the first step in separation service broker db from
murano db.

partial-implement: bp separate-service-broker-from-murano
Change-Id: I2a71c0e864fb806c73287293eac04746ef6b2cae
2016-05-18 22:04:57 -04:00
Stan Lagun
89a4c4cb5a Increase status report messages time resolution
We use DATETIME SQL type for created/updated columns
everywhere through the database. In SQL standard
DATETIME defaults to DATETIME(6) which is 6 digit
fraction second part. However MySQL defaults it
to DATETIME(0) for backward compatibility. In result
status messages timestamps get rounded to the
second boundary and if there are several status
messages were generated within a second
after table sort they might be shown in a different
order.

This commit adds MySQL migration that increases
resolution for the status table and adds subseconds
to the generated status repor timestamps.

Change-Id: Ice8c2d82c6a320c7f73c27f4c60c87bef55b8d95
Related-Bug: #1462270
2016-05-18 18:30:49 -07:00
Jenkins
d0ad7fbd22 Merge "Support for *args/**kwargs was added to the MuranoPL" 2016-05-17 13:46:26 +00:00
Jenkins
e69c1ffd0e Merge "Incorrect Method param inheritance was fixed" 2016-05-17 13:41:52 +00:00
Jenkins
a00eb13431 Merge "Allow insecure SSL communications with RabbitMQ" 2016-05-17 13:41:36 +00: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
OpenStack Proposal Bot
bc8943c8cc Modified docstrings to comply with pep8 H405 style check
Closes-Bug: #1563270

Change-Id: I987d846f1a86ecee1fcfb0f99877563a10481478
2016-05-10 20:18:23 +00:00
Jenkins
47b7a1d0fd Merge "Pass [rabbitmq]/ca_certs file to murano-spawned instance" 2016-05-04 22:46:29 +00:00
Konstantin Snihyr
21e877c22d Pass [rabbitmq]/ca_certs file to murano-spawned instance
Change-Id: I0d7a66b66d47c5996df8047225dcd9323d328412
Closes-Bug: #1568172
2016-05-04 18:41:53 +03:00
Jenkins
a0a151541d Merge "[Trivial] Remove unnecessary executable privilege" 2016-05-04 08:52:55 +00:00
Stan Lagun
440b4b1049 Revert the destroy execution order
Restores back the order of .destroy execution so that
child objects get destroyed first and Environment get
destroyed last.

Both orders have their cons and pros. With
the current order Environment and thus Heat stack
are delete first so if the app sends a command to
murano-agent in its destroy method it will never
receive an answer since the VM of the agent was
already terminated. This broke Kubernetes and might
broke other apps as well.  However the downside is that
apps are going to perform uninstall of the software
on VM that is going to be terminated anyway which
takes time. But until we implement a controllable
resource deallocation this looks like a safer approach.

Change-Id: I8265a69938658e89e4fc36824502c75a75a75c66
Closes-Bug: #1576703
2016-04-29 07:52:56 -07:00
ZhiQiang Fan
2460acb793 [Trivial] Remove unnecessary executable privilege
There are modules, not script, no need to set executable flag.

Change-Id: I93cb22ead401d2fa1f2d90dcee5bf01a89a3430f
2016-04-29 20:03:02 +08:00
Jenkins
10ced8221d Merge "Deployment reports datetime DB insertion was fixed" 2016-04-26 15:37:34 +00:00
Jenkins
83c76cfc59 Merge "Fixes race condition in HeatStack" 2016-04-26 15:30:59 +00:00
Stan Lagun
789dabb1c0 Support for *args/**kwargs was added to the MuranoPL
With this change MuranoPL is going to have abilities similar to
what Python has with *args/**kwargs.

The syntax is "Usage: VarArgs" and "Usage: KwArgs" applied to
the method arguments.

Implements blueprint: support-for-args-kwargs-in-muranopl

Change-Id: I1c19bde100778639ac1d31b0c9076d35999266ee
2016-04-26 14:46:06 +00:00
Stan Lagun
a787d631ec Deployment reports datetime DB insertion was fixed
When MySQL is used as a database backend deployment
notification reports could not be persisted due to the
fact that MySQL could not store timezone offset of
datetime.datetime.

Change-Id: Iea3b7d8d37ac68f0ebdcdcf96471a0d18a29469f
Closes-Bug: #1570933
2016-04-26 01:06:27 +00:00
Alexander Tivelkov
c4bf6f8760 Incorrect Method param inheritance was fixed
When a class calls method that was overridden in a child
class in yaql context both implementation are present. So if
derived implementation happen to have another signature
normal yaql resolution rule will apply and both of them
can be called depending on the parameters. However
this is goes against MuranoPL design that prohibits
several versions of the same method to be accessible in
class hierarchy. With this fix derived implementation
will always signature with *args/**kwargs so it will
always match and take precedence over that from the base class

Closes-bug: #1572215
Change-Id: I0ce27d03d785675f166fd265bb30b3b70ca6c7cb
2016-04-25 20:50:14 +00:00
Stan Lagun
9536e51fa0 Fixes race condition in HeatStack
Before each operation HeatStack waits for the stack to become available.
But if several operations happen concurrently it might be the case when
several threads both check stack availability and conclude its ready and
then both try to update it. In this case Heat client throws HTTPConflict
exception. This fix handles it and retries the operation after delay.

Change-Id: Ibff461ed606e7fb1fc76ad422b4431476e22ab0b
Closes-Bug: #1571863
2016-04-20 19:38:35 +00:00
Alexander Tivelkov
34154bc4ab Fixed a bug in _get_glare_url
Due to a typo in the _getGlare_url method Murano was not able to
properly retrieve the Glare endpoint url from the Keystone's service
catalog.
This lead to an HTTP 400 when the package UI was requested from
murano-api if the murano.config did not contain a pre-configured Glare
URL.
This has been addresed.

Change-Id: I6447ee0cc3a322c841f5e6d27c74ef39cad1d063
Closes-Bug: #1572518
2016-04-20 14:33:36 +03:00
Jenkins
9327d80ed0 Merge "Fix base64 on Python 3 in yaql_functions.py" 2016-04-20 09:20:50 +00:00
Jenkins
00a7881012 Merge "Port cloudfoundry/test_cfapi.py to Python 3" 2016-04-20 09:20:00 +00:00
Jenkins
217771111c Merge "Port test_plugin_loader to Python 3" 2016-04-20 09:19:54 +00:00
Victor Stinner
f6e795efcf Fix base64 on Python 3 in yaql_functions.py
Don't add murano.tests.unit.dsl.test_engine_yaql_functions to
tox.ini. The test requires a new release of yaql to get the last
Python 3 fix (change Ia262ca3ff9ffaad618bde9c1157559e7320434ee).

Blueprint: murano-python-3-support
Change-Id: I8a42e9b31b13bd5075708c32130b1c2997971cb6
2016-04-19 09:55:02 +02:00
Victor Stinner
2461badd18 Port cloudfoundry/test_cfapi.py to Python 3
* Replace base64.b64encode() with base64.encode_as_text() to get
  Unicode on Python 3.
* tox.ini: add test_cfapi to py34

Blueprint: murano-python-3-support
Change-Id: Ib54758ebc7821a0cb32a756331f066191c025f3d
2016-04-19 09:54:57 +02:00
Victor Stinner
398b8cd987 Port test_plugin_loader to Python 3
* test_plugin_loader: replace dict.keys() with list(dict.keys()) to
  get a list on Python 3.
* tox.ini: add test_plugin_loader to py34

Blueprint: murano-python-3-support
Change-Id: Ia211b2bb218d1a5666509b0637ae7e5940738113
2016-04-19 09:54:53 +02:00
OpenStack Proposal Bot
9aa82004d6 Imported Translations from Zanata
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: Ic61d3a23345521ec283ec30467877727b4b08c45
2016-04-19 06:30:47 +00:00
Jenkins
1d76573c41 Merge "Use unified decorator for retries" 2016-04-17 20:05:45 +00:00
Nikolay Starodubtsev
d0c23103ee Use unified decorator for retries
To make our code consistent will be better to use one decorator for all
operations which require retry on exceptions. RetryDecorator from
oslo_service is operated with green threads and probably is not a best
choice for the decorator of retry operations in murano. An obsolete
custom retry decorator was removed too.

Closes-Bug: 1559890
Change-Id: I7b1d0675e5628769d7e618d7b6118478039ac2db
2016-04-15 11:47:33 +03:00
Angus Salkeld
776a4ce2c0 Switch to using get_notification_listner
Change-Id: Ied7acaeed6edde17d2d6f073c304021e22811409
Closes-bug: #1570127
2016-04-14 13:41:10 +10:00
Jenkins
db439018b6 Merge "Increased the size of TEXT columns to store large object models" 2016-04-12 18:45:03 +00:00
Jenkins
6da8af5e4b Merge "Heat stack deletion for HOT/TOSCA packages was fixed" 2016-04-12 15:43:36 +00:00
Alexander Tivelkov
12636e2e12 Increased the size of TEXT columns to store large object models
Object model is stored in database in the columns of type TEXT. In
MySQL database this type of column is limited by default and cannot
hold data structures which are large enough.

This patch adds an extra migration which alters appropriate columns in
database when the mysql is used. The column type is explicitly set to
LONGTEXT.

Change-Id: Ic04fb99469edc087cc12d4c78a983484ae49a6c1
Closes-bug: #1567863
2016-04-12 16:52:09 +03:00
Jenkins
5459ec11da Merge "'GetPackageUI' API can now be called even if Glare is used" 2016-04-11 13:59:18 +00:00
Alexander Tivelkov
2858689767 'GetPackageUI' API can now be called even if Glare is used
Since Glare support was introduced the 'catalog/packages' part of
Murano API (/v1/catalog/packages) became obsolete and was intended to
be used for "legacy" (i.e. non-glare-based) package storage. The
murano client was supposed to directly call glare to retrieve the
packages.

However, the "GetPackageUI" call (GET
/v1/catalog/packages/%pkg_id%/ui) is different: not all the packages
bundle the UI definitions, some require Murano to generate them based
on the contents of the package. This is true for HOT-based packages
and others, plugin-based ones. In future this will be true for 100% of
the packages when the dynamic ui and object model generation is added.

Because of this that API should be callable even if Glare is
configured as a package storage backend. It should fetch the artifact
from glare, unpack it and use whatever plugin-specific logic required
to generate the UI definitions for this particular package.

This patch introduces appropriate change while maintaining the
backwards compatibility: in the legacy mode (i.e. when murano's DB
acts as package storage) the UI is read directly from an appropriate
DB table without fetching the whole package.

This fixes the issue when the HOT-based packages could not be
deplpoyed properly with murano-dashboard, but the murano-client has to
be updated as well to properly call the modified API even if Glare is
enabled.

Change-Id: Id9327e4015e1c0a1553c0b1a0151a94ee4da2928
Partial-bug: #1565805
2016-04-08 15:27:10 +00:00
Jenkins
f221985cad Merge "Add help string for cfapi opts" 2016-04-08 14:00:45 +00:00
zhurong
f273a92e6b Add help string for cfapi opts
To avoid the WARNING when generator config file,
add help string for cfapi opts.

Change-Id: I065436c296ebcc16cd6abf170cc6754e3167848b
2016-04-07 01:13:07 +00:00
Jenkins
0b3778af7c Merge "Define context.roles with base class" 2016-04-06 16:49:27 +00:00
Stan Lagun
612a25371d Heat stack deletion for HOT/TOSCA packages was fixed
HeatStack class expects to be owned by some other and uses it to find
OpenStack region name it belongs to. If there is no owner provided then
the default region is used which is random for multi-region setups.

MuranoPL code that was generated from HOT and TOSCA provided that owner
on "deploy" phase but not on "destroy". So the stack that was
successfully created earlier could never be deleted in multi-region
OpenStack installations for non-default region.

Change-Id: I19ca0c7129b073fdd852b22a6a7f84f7ee377ee7
Closes-Bug: #1565777
2016-04-05 15:33:06 +00:00
Ronald Bradford
6136b8d3a5 Define context.roles with base class
In Ia575ba803a0fb70f39146bd75d381ed19414bd23, oslo.context (2.2.0)
added roles support in the context itself. This passes roles to
super()__init__ and uses the default to_dict().

Depends-On: I79ea029ceb67173e69631b4e6e614fa62e159227
Change-Id: I1807f19aa867f17c055bb018b6cce6f569f90ca4
2016-04-04 14:46:40 +00:00