You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by mxmrlv <gi...@git.apache.org> on 2017/02/06 15:13:50 UTC

[GitHub] incubator-ariatosca pull request #68: Aria 42 generic ctx serialization mech...

GitHub user mxmrlv opened a pull request:

    https://github.com/apache/incubator-ariatosca/pull/68

    Aria 42 generic ctx serialization mechanism

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-ariatosca ARIA-42-Generic-ctx-serialization-mechanism

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-ariatosca/pull/68.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #68
    
----
commit 99ae9ca63597ee7bb99eaa33c76ccce7f1192d4d
Author: mxmrlv <mx...@gmail.com>
Date:   2017-02-01T14:16:01Z

    wip

commit bbee7baf441356f7f78b648a9e66d002199adefc
Author: mxmrlv <mx...@gmail.com>
Date:   2017-02-01T17:23:16Z

    wip

commit 0e94bfc88c7b23e781ee6efd2b138519cfacaec1
Author: mxmrlv <mx...@gmail.com>
Date:   2017-02-05T17:51:10Z

    tests fixin

commit 03246963cde076ec8627ea4b81860aa2f3aab598
Author: mxmrlv <mx...@gmail.com>
Date:   2017-02-06T14:05:56Z

    tests are passing, serialized init_func

commit 69fb70da2f4183e71a19e67ad403aeebf3ac0fbf
Author: mxmrlv <mx...@gmail.com>
Date:   2017-02-06T14:52:06Z

    cleaning up

commit 5fd583d65e11bf2482e063dc2bf31952834e452b
Author: mxmrlv <mx...@gmail.com>
Date:   2017-02-06T15:13:14Z

    minor fixes

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #68: ARIA-42-Generic-ctx-serialization-mech...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/68#discussion_r100089582
  
    --- Diff: tests/orchestrator/workflows/executor/test_process_executor.py ---
    @@ -106,9 +112,9 @@ def mock_plugin(plugin_manager, tmpdir):
         return plugin_manager.install(source=plugin_path)
     
     
    -class MockContext(object):
    +class MockContext(operation.BaseOperationContext):
     
    -    def __init__(self, *args, **kwargs):
    +    def __init__(self, *args, **kwargs):                                                            # pylint: disable=super-init-not-called
    --- End diff --
    
    ditto


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #68: ARIA-42-Generic-ctx-serialization-mech...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/68#discussion_r100119147
  
    --- Diff: aria/storage/core.py ---
    @@ -66,10 +67,10 @@ def __init__(self,
             self.registered = {}
             self._initiator = initiator
             self._initiator_kwargs = initiator_kwargs or {}
    +        self._api_kwargs = api_kwargs or {}
    +        self._additional_api_kwargs = {}
    --- End diff --
    
    unpicklable


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #68: ARIA-42-Generic-ctx-serialization-mech...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/68#discussion_r100088894
  
    --- Diff: tests/mock/context.py ---
    @@ -15,26 +15,30 @@
     
     import aria
     from aria.orchestrator import context
    -from aria.storage.filesystem_rapi import FileSystemResourceAPI
    -from aria.storage.sql_mapi import SQLAlchemyModelAPI
    +from aria.storage import (
    +    sql_mapi,
    +    filesystem_rapi,
    +)
     
     from . import models
     from .topology import create_simple_topology_two_nodes
     
     
    -def simple(mapi_kwargs, resources_dir=None, **kwargs):
    -    model_storage = aria.application_model_storage(SQLAlchemyModelAPI, api_kwargs=mapi_kwargs)
    +def simple(tmpdir,
    +           model_initiator_kwargs=None,
    +           resources_initiator_kwargs=None,
    +           context_kwargs=None):
     
    -    deployment_id = create_simple_topology_two_nodes(model_storage)
    +    model_storage = aria.application_model_storage(
    --- End diff --
    
    be consistent with initiator passing


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #68: ARIA-42-Generic-ctx-serialization-mech...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/68#discussion_r100087789
  
    --- Diff: aria/storage/sql_mapi.py ---
    @@ -364,6 +369,28 @@ def _load_relationships(instance):
                 getattr(instance, rel.key)
     
     
    +def init_storage(base_dir=None, filename='db.sqlite'):
    +    if base_dir is not None:
    +        uri = 'sqlite:///{platform_char}{path}'.format(
    +            # Handles the windows behavior where there is not root, but drivers.
    +            # Thus behaving as relative path.
    +            platform_char='' if 'Windows' in platform.system() else '/',
    +
    +            path=os.path.join(base_dir, filename))
    +        engine_kwargs = {}
    +    else:
    +        uri = 'sqlite:///:memory:'
    --- End diff --
    
    remove in memory option to tests only


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #68: ARIA-42-Generic-ctx-serialization-mech...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/68#discussion_r100087200
  
    --- Diff: aria/storage/sql_mapi.py ---
    @@ -15,13 +15,18 @@
     """
     SQLAlchemy based MAPI
     """
    +import os
    +import platform
     
    +from sqlalchemy import create_engine
    --- End diff --
    
    fix imports


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #68: ARIA-42-Generic-ctx-serialization-mech...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-ariatosca/pull/68


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #68: ARIA-42-Generic-ctx-serialization-mech...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/68#discussion_r100118816
  
    --- Diff: aria/storage/core.py ---
    @@ -66,10 +67,10 @@ def __init__(self,
             self.registered = {}
             self._initiator = initiator
             self._initiator_kwargs = initiator_kwargs or {}
    +        self._api_kwargs = api_kwargs or {}
    +        self._additional_api_kwargs = {}
    --- End diff --
    
    add information about initiator interface


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #68: ARIA-42-Generic-ctx-serialization-mech...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/68#discussion_r100072787
  
    --- Diff: aria/storage/core.py ---
    @@ -52,11 +55,21 @@ class Storage(LoggerMixin):
         """
         Represents the storage
         """
    -    def __init__(self, api_cls, api_kwargs=None, items=(), **kwargs):
    +    def __init__(self,
    +                 api_cls,
    +                 items=(),
    --- End diff --
    
    add api_kwargs and move init, init_kwargs to ModelStorage (and rename init to session_initiator)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #68: ARIA-42-Generic-ctx-serialization-mech...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/68#discussion_r100089478
  
    --- Diff: tests/orchestrator/workflows/executor/test_executor.py ---
    @@ -80,9 +81,9 @@ class MockException(Exception):
         pass
     
     
    -class MockContext(object):
    +class MockContext(operation.BaseOperationContext):
     
    -    def __init__(self, *args, **kwargs):
    +    def __init__(self, *args, **kwargs):                                                            # pylint: disable=super-init-not-called
    --- End diff --
    
    add serialize function


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #68: ARIA-42-Generic-ctx-serialization-mech...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/68#discussion_r100119409
  
    --- Diff: tests/storage/__init__.py ---
    @@ -65,3 +65,14 @@ def release_sqlite_storage(storage):
                 session.close()
             for engine in set(mapi._engine for mapi in mapis):
    --- End diff --
    
    dont forget to revisit mock context


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---