Browse Source

Merge pull request #11 from denismakogon/project-picasso

New project name: Picasso
Derek Schultz 2 years ago
parent
commit
a5d0bb734b
44 changed files with 90 additions and 105 deletions
  1. 1
    1
      Dockerfile
  2. 4
    4
      Dockerfile.env.example
  3. 20
    20
      README.md
  4. 1
    1
      migrations/env.py
  5. 0
    0
      picasso/__init__.py
  6. 0
    0
      picasso/api/__init__.py
  7. 0
    0
      picasso/api/controllers/__init__.py
  8. 0
    0
      picasso/api/controllers/apps.py
  9. 4
    13
      picasso/api/controllers/routes.py
  10. 0
    0
      picasso/api/controllers/runnable.py
  11. 0
    0
      picasso/api/controllers/tasks.py
  12. 0
    0
      picasso/api/middleware/__init__.py
  13. 0
    0
      picasso/api/middleware/content_type.py
  14. 0
    0
      picasso/api/middleware/keystone.py
  15. 0
    0
      picasso/api/views/__init__.py
  16. 4
    11
      picasso/api/views/app.py
  17. 0
    0
      picasso/common/__init__.py
  18. 0
    0
      picasso/common/config.py
  19. 3
    3
      picasso/common/logger.py
  20. 0
    0
      picasso/common/persistence.py
  21. 7
    6
      picasso/common/utils.py
  22. 0
    0
      picasso/models/__init__.py
  23. 0
    0
      picasso/models/app.py
  24. 0
    0
      picasso/tests/__init__.py
  25. 0
    0
      picasso/tests/common/__init__.py
  26. 0
    0
      picasso/tests/common/apps.py
  27. 2
    2
      picasso/tests/common/base.py
  28. 2
    2
      picasso/tests/common/client.py
  29. 0
    0
      picasso/tests/common/routes.py
  30. 0
    0
      picasso/tests/fakes/__init__.py
  31. 0
    0
      picasso/tests/fakes/functions_api.py
  32. 0
    0
      picasso/tests/functional/__init__.py
  33. 4
    4
      picasso/tests/functional/base.py
  34. 1
    1
      picasso/tests/functional/test_apps.py
  35. 1
    1
      picasso/tests/functional/test_routes.py
  36. 0
    0
      picasso/tests/integration/__init__.py
  37. 6
    6
      picasso/tests/integration/base.py
  38. 1
    1
      picasso/tests/integration/test_apps.py
  39. 1
    1
      picasso/tests/integration/test_routes.py
  40. 2
    2
      scripts/docker_full.sh
  41. 1
    1
      scripts/test_regression.sh
  42. 18
    18
      service/picasso_api.py
  43. 5
    5
      setup.py
  44. 2
    2
      tox.ini

+ 1
- 1
Dockerfile View File

@@ -11,5 +11,5 @@ RUN pip3 install -r /code/requirements.txt
11 11
 RUN python3 /code/setup.py install
12 12
 
13 13
 
14
-ENTRYPOINT ["python3", "/code/service/laos_api.py"]
14
+ENTRYPOINT ["python3", "/code/service/picasso_api.py"]
15 15
 EXPOSE 10001

+ 4
- 4
Dockerfile.env.example View File

@@ -1,6 +1,6 @@
1
-LAOS_HOST=0.0.0.0
2
-LAOS_PORT=10001
3
-LAOS_DB=mysql+pymysql://root:ubuntu@192.168.0.120/functions
1
+PICASSO_HOST=0.0.0.0
2
+PICASSO_PORT=10001
3
+PICASSO_DB=mysql+pymysql://root:ubuntu@192.168.0.120/functions
4 4
 KEYSTONE_ENDPOINT=http://192.168.0.120:5000/v3
5 5
 FUNCTIONS_URL=http://192.168.0.120:8080/v1
6
-LAOS_LOG_LEVEL=INFO
6
+PICASSO_LOG_LEVEL=INFO

+ 20
- 20
README.md View File

@@ -1,10 +1,10 @@
1
-Project LaOS aka Lambdas-on-OpenStack
2
-=====================================
1
+Picasso: Functions-as-a-Service (FaaS) on OpenStack
2
+===================================================
3 3
 
4 4
 Mission
5 5
 -------
6 6
 
7
-Provide capabilities to run software in "serverless" way.
7
+Picasso provides an API abstraction layer for Functions-as-a-Service (FaaS) on OpenStack.
8 8
 
9 9
 Serverless
10 10
 ----------
@@ -50,7 +50,7 @@ Quick-start guide
50 50
 -----------------
51 51
 
52 52
 Install DevStack with [IronFunctions enabled](https://github.com/iron-io/functions-devstack-plugin/blob/master/README.rst).
53
-Pull down [Project LaOS sources](https://github.com/iron-io/project-laos).
53
+Pull down [Picasso sources](https://github.com/iron-io/project-picasso).
54 54
 
55 55
 Create Python3.5 virtualenv:
56 56
 
@@ -61,7 +61,7 @@ Install dependencies:
61 61
 
62 62
     $ pip install -r requirements.txt -r test-requirements.txt
63 63
 
64
-Install LaOS itself:
64
+Install Picasso itself:
65 65
 
66 66
     $ pip install -e .
67 67
 
@@ -76,7 +76,7 @@ Migrations
76 76
 Once all dependencies are installed it is necessary to run database migrations.
77 77
 Before that it is necessary to set env variable:
78 78
 
79
-    export LAOS_MIGRATIONS_DB=mysql+pymysql://root:root@localhost/functions
79
+    export PICASSO_MIGRATIONS_DB=mysql+pymysql://root:root@localhost/functions
80 80
 
81 81
 In this section please specify connection URI to your own MySQL database.
82 82
 Once the file is saved, just use alembic to apply the migrations:
@@ -86,35 +86,35 @@ Once the file is saved, just use alembic to apply the migrations:
86 86
 Starting a server
87 87
 -----------------
88 88
 
89
-Once it is finished you will have a console script `laos-api`:
89
+Once it is finished you will have a console script `picasso-api`:
90 90
 
91
-    $ laos-api --help
91
+    $ picasso-api --help
92 92
 
93
-    Usage: laos-api [OPTIONS]
93
+    Usage: picasso-api [OPTIONS]
94 94
     
95
-      Starts an Project Laos API service
95
+      Starts Picasso API service
96 96
     
97 97
     Options:
98 98
       --host TEXT                    API service bind host.
99 99
       --port INTEGER                 API service bind port.
100
-      --db-uri TEXT                  LaOS persistence storage URI.
100
+      --db-uri TEXT                  Picasso persistence storage URI.
101 101
       --keystone-endpoint TEXT       OpenStack Identity service endpoint.
102 102
       --functions-url TEXT           IronFunctions API URL
103 103
       --log-level TEXT               Logging file
104 104
       --log-file TEXT                Log file path
105 105
       --help                         Show this message and exit.
106 106
 
107
-Minimum required options to start LaOS API service:
107
+Minimum required options to start Picasso API service:
108 108
 
109 109
      --db-uri mysql://root:root@192.168.0.112/functions
110 110
      --keystone-endpoint http://192.168.0.112:5000/v3
111 111
      --functions-url http://192.168.0.112:8080/v1
112 112
      --log-level INFO
113 113
 
114
-Creating and running LaOS inside Docker container
114
+Creating and running Picasso inside Docker container
115 115
 -------------------------------------------------
116 116
 
117
-As part of regular Python distribution, LaOS also has its own Docker container to run.
117
+As part of regular Python distribution, Picasso also has its own Docker container to run.
118 118
 There are two options:
119 119
 
120 120
 * run from sources
@@ -123,13 +123,13 @@ There are two options:
123 123
 In order to build container from sources run following commands:
124 124
 
125 125
     export DOCKER_HOST=tcp://<docker-host>:<docker-port>
126
-    docker build -t laos-api -f Dockerfile .
126
+    docker build -t picasso-api -f Dockerfile .
127 127
 
128 128
 After that it is required to create correct version of [Dockerfile.env](Dockerfile.env.example). 
129
-It container all required options to start LaOS API service properly.
129
+It container all required options to start Picasso API service properly.
130 130
 Once it is done run following commands:
131 131
 
132
-    docker run -d -p 10001:10001 --env-file Dockerfile.env laos-api
132
+    docker run -d -p 10001:10001 --env-file Dockerfile.env picasso-api
133 133
 
134 134
 Navigate to your web browser to check if service is running:
135 135
 
@@ -144,7 +144,7 @@ Examining API
144 144
 
145 145
 In [examples](examples/) folder you can find a script that examines available API endpoints, but this script relays on:
146 146
 
147
-* `LAOS_API_URL` - Project LaOS API endpoint
147
+* `PICASSO_API_URL` - Picasso API endpoint
148 148
 * `OS_AUTH_URL` - OpenStack Auth URL
149 149
 * `OS_PROJECT_ID` - it can be found in OpenStack Dashboard or in CLI
150 150
 * `OS_USERNAME` - OpenStack project-aligned username
@@ -161,10 +161,10 @@ Please note, that given values are project-specific, so they can't be reused.
161 161
 API docs
162 162
 --------
163 163
 
164
-As part of LaOS ReST API it is possible to discover API doc using Swagger Doc.
164
+As part of Picasso ReST API it is possible to discover API doc using Swagger Doc.
165 165
 Once server is launched you can navigate to:
166 166
 
167
-    http://<laos-host>:<laos-port>/api
167
+    http://<picasso-host>:<picasso-port>/api
168 168
 
169 169
 to see recent API docs
170 170
 

+ 1
- 1
migrations/env.py View File

@@ -23,7 +23,7 @@ target_metadata = None
23 23
 # can be acquired:
24 24
 # my_important_option = config.get_main_option("my_important_option")
25 25
 # ... etc.
26
-config.set_main_option("sqlalchemy.url", os.getenv("LAOS_MIGRATIONS_DB"))
26
+config.set_main_option("sqlalchemy.url", os.getenv("PICASSO_MIGRATIONS_DB"))
27 27
 
28 28
 
29 29
 def run_migrations_offline():

laos/__init__.py → picasso/__init__.py View File


laos/api/__init__.py → picasso/api/__init__.py View File


laos/api/controllers/__init__.py → picasso/api/controllers/__init__.py View File


laos/api/controllers/apps.py → picasso/api/controllers/apps.py View File


laos/api/controllers/routes.py → picasso/api/controllers/routes.py View File

@@ -72,12 +72,10 @@ class AppRouteV1Controller(controller.ServiceController):
72 72
                 path=fn_route.path)).pop()
73 73
             setattr(fn_route, "is_public", stored_route.public)
74 74
 
75
-        api_url = "{}://{}".format(request.scheme, request.host)
76 75
         log.info("Listing app {} routes for project: {}."
77 76
                  .format(app, project_id))
78 77
         return web.json_response(data={
79
-            "routes": app_view.AppRouteView(api_url,
80
-                                            project_id,
78
+            "routes": app_view.AppRouteView(project_id,
81 79
                                             app,
82 80
                                             fn_app_routes).view(),
83 81
             "message": "Successfully loaded app routes",
@@ -175,11 +173,10 @@ class AppRouteV1Controller(controller.ServiceController):
175 173
         log.info("Creating new route in app {} "
176 174
                  "for project: {} with data {}"
177 175
                  .format(app, project_id, str(data)))
178
-        api_url = "{}://{}".format(request.scheme, request.host)
179 176
 
180 177
         setattr(new_fn_route, "is_public", stored_route.public)
181 178
         view = app_view.AppRouteView(
182
-            api_url, project_id, app, [new_fn_route]).view_one()
179
+            project_id, app, [new_fn_route]).view_one()
183 180
 
184 181
         return web.json_response(data={
185 182
             "route": view,
@@ -233,8 +230,6 @@ class AppRouteV1Controller(controller.ServiceController):
233 230
         log.info("Requesting route {} in app {} for project: {}"
234 231
                  .format(path, app, project_id))
235 232
 
236
-        api_url = "{}://{}".format(request.scheme, request.host)
237
-
238 233
         stored_route = (await app_model.Routes.find_by(
239 234
             app_name=app,
240 235
             project_id=project_id,
@@ -243,8 +238,7 @@ class AppRouteV1Controller(controller.ServiceController):
243 238
         setattr(route, "is_public", stored_route.public)
244 239
 
245 240
         return web.json_response(data={
246
-            "route": app_view.AppRouteView(api_url,
247
-                                           project_id,
241
+            "route": app_view.AppRouteView(project_id,
248 242
                                            app,
249 243
                                            [route]).view_one(),
250 244
             "message": "App route successfully loaded"
@@ -297,8 +291,6 @@ class AppRouteV1Controller(controller.ServiceController):
297 291
                 }
298 292
             }, status=getattr(ex, "status", 500))
299 293
 
300
-        api_url = "{}://{}".format(request.scheme, request.host)
301
-
302 294
         stored_route = (await app_model.Routes.find_by(
303 295
             app_name=app,
304 296
             project_id=project_id,
@@ -307,8 +299,7 @@ class AppRouteV1Controller(controller.ServiceController):
307 299
         setattr(route, "is_public", stored_route.public)
308 300
 
309 301
         return web.json_response(data={
310
-            "route": app_view.AppRouteView(api_url,
311
-                                           project_id,
302
+            "route": app_view.AppRouteView(project_id,
312 303
                                            app,
313 304
                                            [route]).view_one(),
314 305
 

laos/api/controllers/runnable.py → picasso/api/controllers/runnable.py View File


laos/api/controllers/tasks.py → picasso/api/controllers/tasks.py View File


laos/api/middleware/__init__.py → picasso/api/middleware/__init__.py View File


laos/api/middleware/content_type.py → picasso/api/middleware/content_type.py View File


laos/api/middleware/keystone.py → picasso/api/middleware/keystone.py View File


laos/api/views/__init__.py → picasso/api/views/__init__.py View File


laos/api/views/app.py → picasso/api/views/app.py View File

@@ -33,9 +33,8 @@ class AppView(object):
33 33
 
34 34
 class AppRouteView(object):
35 35
 
36
-    def __init__(self, api_url, project_id, app_name, fn_app_routes):
36
+    def __init__(self, project_id, app_name, fn_app_routes):
37 37
         self.routes = fn_app_routes
38
-        self.api_url = api_url
39 38
         self.project_id = project_id
40 39
         self.app_name = app_name
41 40
 
@@ -45,15 +44,8 @@ class AppRouteView(object):
45 44
     def view(self):
46 45
         view = []
47 46
         for route in self.routes:
48
-            if not route.is_public:
49
-                path = ("{}/v1/r/{}/{}{}".format(
50
-                    self.api_url, self.project_id,
51
-                    self.app_name, route.path))
52
-            else:
53
-                path = ("{}/r/{}{}".format(
54
-                    self.api_url, self.app_name, route.path))
55 47
             one = {
56
-                "path": path,
48
+                "path": route.path,
57 49
                 "type": route.type,
58 50
                 "image": route.image,
59 51
                 "is_public": route.is_public,
@@ -65,6 +57,7 @@ class AppRouteView(object):
65 57
             if hasattr(route, "timeout"):
66 58
                 one.update(timeout=route.timeout)
67 59
             if hasattr(route, "max_concurrency"):
68
-                one.update(timeout=route.max_concurrency)
60
+                one.update(max_concurrency=
61
+                           route.max_concurrency)
69 62
             view.append(one)
70 63
         return view

laos/common/__init__.py → picasso/common/__init__.py View File


laos/common/config.py → picasso/common/config.py View File


laos/common/logger.py → picasso/common/logger.py View File

@@ -21,7 +21,7 @@ from . import utils
21 21
 
22 22
 def common_logger_setup(
23 23
         level=logging.DEBUG,
24
-        filename='/tmp/laos-api.log',
24
+        filename='/tmp/picasso-api.log',
25 25
         log_formatter='[%(asctime)s] - '
26 26
                       '%(name)s - '
27 27
                       '%(levelname)s - '
@@ -40,7 +40,7 @@ def common_logger_setup(
40 40
 
41 41
 
42 42
 def setup_logging(name,
43
-                  filename='/tmp/laos-api-{}.log'.format(
43
+                  filename='/tmp/picasso-api-{}.log'.format(
44 44
                       datetime.datetime.now()),
45 45
                   level=logging.DEBUG,
46 46
                   log_to_console=False,
@@ -68,7 +68,7 @@ class Singleton(type):
68 68
 class UnifiedLogger(object, metaclass=utils.Singleton):
69 69
 
70 70
     def __init__(self,
71
-                 filename='/tmp/laos-api-{}.log'.format(
71
+                 filename='/tmp/picasso-api-{}.log'.format(
72 72
                      datetime.datetime.now()),
73 73
                  level=logging.DEBUG, log_to_console=False):
74 74
         self.filename = filename

laos/common/persistence.py → picasso/common/persistence.py View File


laos/common/utils.py → picasso/common/utils.py View File

@@ -18,12 +18,13 @@ from urllib import parse
18 18
 def split_db_uri(db_uri):
19 19
     """
20 20
     Splits DB URI into consumable parts like:
21
-    - username
22
-    - password
23
-    - hostname
24
-    - port
25
-    - protocol schema
26
-    - path
21
+        - username
22
+        - password
23
+        - hostname
24
+        - port
25
+        - protocol schema
26
+        - path
27
+
27 28
     :param db_uri:
28 29
     :return:
29 30
     """

laos/models/__init__.py → picasso/models/__init__.py View File


laos/models/app.py → picasso/models/app.py View File


laos/tests/__init__.py → picasso/tests/__init__.py View File


laos/tests/common/__init__.py → picasso/tests/common/__init__.py View File


laos/tests/common/apps.py → picasso/tests/common/apps.py View File


laos/tests/common/base.py → picasso/tests/common/base.py View File

@@ -19,7 +19,7 @@ import uvloop
19 19
 from ...common import logger as log
20 20
 
21 21
 
22
-class LaosTestsBase(object):
22
+class PicassoTestsBase(object):
23 23
 
24 24
     def get_loop_and_logger(self, test_type):
25 25
         self.route_data = {
@@ -36,7 +36,7 @@ class LaosTestsBase(object):
36 36
 
37 37
         logger = log.UnifiedLogger(
38 38
             log_to_console=False,
39
-            filename=("/tmp/laos-{}-tests-run-{}.log"
39
+            filename=("/tmp/picasso-{}-tests-run-{}.log"
40 40
                       .format(test_type, datetime.datetime.now())),
41 41
             level="DEBUG").setup_logger(__package__)
42 42
         return testloop, logger

laos/tests/common/client.py → picasso/tests/common/client.py View File

@@ -93,10 +93,10 @@ class RoutesV1(object):
93 93
             ignore_project_id=True, **data)
94 94
 
95 95
 
96
-class ProjectBoundLaosTestClient(test_utils.TestClient):
96
+class ProjectBoundTestClient(test_utils.TestClient):
97 97
 
98 98
     def __init__(self, app_or_server, project_id, **kwargs):
99
-        super(ProjectBoundLaosTestClient, self).__init__(app_or_server)
99
+        super(ProjectBoundTestClient, self).__init__(app_or_server)
100 100
         self.project_id = project_id
101 101
         self.headers = {
102 102
             "Content-Type": "application/json"

laos/tests/common/routes.py → picasso/tests/common/routes.py View File


laos/tests/fakes/__init__.py → picasso/tests/fakes/__init__.py View File


laos/tests/fakes/functions_api.py → picasso/tests/fakes/functions_api.py View File


laos/tests/functional/__init__.py → picasso/tests/functional/__init__.py View File


laos/tests/functional/base.py → picasso/tests/functional/base.py View File

@@ -31,7 +31,7 @@ from ..common import client
31 31
 from ..fakes import functions_api
32 32
 
33 33
 
34
-class LaosFunctionalTestsBase(base.LaosTestsBase, testtools.TestCase):
34
+class FunctionalTestsBase(base.PicassoTestsBase, testtools.TestCase):
35 35
 
36 36
     def setUp(self):
37 37
         self.testloop, logger = self.get_loop_and_logger("functional")
@@ -74,12 +74,12 @@ class LaosFunctionalTestsBase(base.LaosTestsBase, testtools.TestCase):
74 74
         )
75 75
 
76 76
         self.project_id = str(uuid.uuid4()).replace("-", "")
77
-        self.test_client = client.ProjectBoundLaosTestClient(
77
+        self.test_client = client.ProjectBoundTestClient(
78 78
             self.testapp, self.project_id)
79 79
 
80 80
         self.testloop.run_until_complete(self.test_client.start_server())
81
-        super(LaosFunctionalTestsBase, self).setUp()
81
+        super(FunctionalTestsBase, self).setUp()
82 82
 
83 83
     def tearDown(self):
84 84
         self.testloop.run_until_complete(self.test_client.close())
85
-        super(LaosFunctionalTestsBase, self).tearDown()
85
+        super(FunctionalTestsBase, self).tearDown()

laos/tests/functional/test_apps.py → picasso/tests/functional/test_apps.py View File

@@ -16,7 +16,7 @@ from ..common import apps as apps_suite
16 16
 from ..functional import base
17 17
 
18 18
 
19
-class TestApps(base.LaosFunctionalTestsBase, apps_suite.AppsTestSuite):
19
+class TestApps(base.FunctionalTestsBase, apps_suite.AppsTestSuite):
20 20
 
21 21
     def test_list_apps(self):
22 22
         super(TestApps, self).list_apps()

laos/tests/functional/test_routes.py → picasso/tests/functional/test_routes.py View File

@@ -16,7 +16,7 @@ from ..common import routes as routes_suite
16 16
 from ..functional import base
17 17
 
18 18
 
19
-class TestAppRoutes(base.LaosFunctionalTestsBase,
19
+class TestAppRoutes(base.FunctionalTestsBase,
20 20
                     routes_suite.AppRoutesTestSuite):
21 21
 
22 22
     def test_list_routes_from_unknown_app(self):

laos/tests/integration/__init__.py → picasso/tests/integration/__init__.py View File


laos/tests/integration/base.py → picasso/tests/integration/base.py View File

@@ -24,10 +24,10 @@ from ..common import base
24 24
 from ..common import client
25 25
 
26 26
 
27
-from service import laos_api
27
+from service import picasso_api
28 28
 
29 29
 
30
-class LaosIntegrationTestsBase(base.LaosTestsBase, testtools.TestCase):
30
+class PicassoIntegrationTestsBase(base.PicassoTestsBase, testtools.TestCase):
31 31
 
32 32
     async def authenticate(self, os_user, os_pass, os_project, url):
33 33
         auth_request_data = {
@@ -99,7 +99,7 @@ class LaosIntegrationTestsBase(base.LaosTestsBase, testtools.TestCase):
99 99
             event_loop=self.testloop,
100 100
         )
101 101
 
102
-        self.test_app = laos_api.API(
102
+        self.test_app = picasso_api.API(
103 103
             loop=self.testloop, logger=logger, debug=True)
104 104
 
105 105
         os_token, project_id = self.testloop.run_until_complete(
@@ -107,14 +107,14 @@ class LaosIntegrationTestsBase(base.LaosTestsBase, testtools.TestCase):
107 107
                 os_user, os_pass,
108 108
                 os_project, os_auth_url))
109 109
 
110
-        self.test_client = client.ProjectBoundLaosTestClient(
110
+        self.test_client = client.ProjectBoundTestClient(
111 111
             self.test_app.root, project_id, headers={
112 112
                 "X-Auth-Token": os_token
113 113
             })
114 114
         self.testloop.run_until_complete(
115 115
             self.test_client.start_server())
116
-        super(LaosIntegrationTestsBase, self).setUp()
116
+        super(PicassoIntegrationTestsBase, self).setUp()
117 117
 
118 118
     def tearDown(self):
119 119
         self.testloop.run_until_complete(self.test_client.close())
120
-        super(LaosIntegrationTestsBase, self).tearDown()
120
+        super(PicassoIntegrationTestsBase, self).tearDown()

laos/tests/integration/test_apps.py → picasso/tests/integration/test_apps.py View File

@@ -16,7 +16,7 @@ from ..common import apps as apps_suite
16 16
 from ..integration import base
17 17
 
18 18
 
19
-class TestIntegrationApps(base.LaosIntegrationTestsBase,
19
+class TestIntegrationApps(base.PicassoIntegrationTestsBase,
20 20
                           apps_suite.AppsTestSuite):
21 21
 
22 22
     def test_list_apps(self):

laos/tests/integration/test_routes.py → picasso/tests/integration/test_routes.py View File

@@ -16,7 +16,7 @@ from ..common import routes as routes_suite
16 16
 from ..functional import base
17 17
 
18 18
 
19
-class TestIntegrationAppRoutes(base.LaosFunctionalTestsBase,
19
+class TestIntegrationAppRoutes(base.FunctionalTestsBase,
20 20
                                routes_suite.AppRoutesTestSuite):
21 21
 
22 22
     def test_list_routes_from_unknown_app(self):

+ 2
- 2
scripts/docker_full.sh View File

@@ -4,13 +4,13 @@ set +x
4 4
 set +e
5 5
 set +i
6 6
 
7
-docker build -t laos-api -f Dockerfile . 2>&1
7
+docker build -t picasso-api -f Dockerfile . 2>&1
8 8
 docker_h=$(echo ${DOCKER_HOST} | tr "://" " " |awk '{print $2}')
9 9
 echo -e "Docker IP address ${docker_h}"
10 10
 echo -e "OpenStack Identity service URL ${OS_AUTH_URL}"
11 11
 echo -e "IronFunctions URL ${FUNCTIONS_API_URL}"
12 12
 echo -e "Persistent storage URI ${TEST_DB_URI}"
13
-docker run -d -p ${docker_h}:10002:10001 --env LAOS_HOST=0.0.0.0 --env LAOS_PORT=10001 --env LAOS_DB=${TEST_DB_URI} --env KEYSTONE_ENDPOINT=${OS_AUTH_URL} --env FUNCTIONS_URL=${FUNCTIONS_API_URL} --env LAOS_LOG_LEVEL=INFO laos-api
13
+docker run -d -p ${docker_h}:10002:10001 --env PICASSO_HOST=0.0.0.0 --env PICASSO_PORT=10001 --env PICASSO_DB=${TEST_DB_URI} --env KEYSTONE_ENDPOINT=${OS_AUTH_URL} --env FUNCTIONS_URL=${FUNCTIONS_API_URL} --env PICASSO_LOG_LEVEL=INFO picasso-api
14 14
 sleep 2
15 15
 docker ps
16 16
 echo -e "Service running on ${docker_h}:10002"

+ 1
- 1
scripts/test_regression.sh View File

@@ -4,7 +4,7 @@ set +x
4 4
 set +e
5 5
 
6 6
 function get_current_coverage {
7
-    local prev_stat_raw=`pytest --tb=long --capture=sys --cov=laos --capture=fd laos/tests/${1:-functional} | grep TOTAL | awk '{print $4}'`
7
+    local prev_stat_raw=`pytest --tb=long --capture=sys --cov=picasso --capture=fd picasso/tests/${1:-functional} | grep TOTAL | awk '{print $4}'`
8 8
     echo ${prev_stat_raw:0:2}
9 9
 }
10 10
 

service/laos_api.py → service/picasso_api.py View File

@@ -21,16 +21,16 @@ import uvloop
21 21
 
22 22
 from aioservice.http import service
23 23
 
24
-from laos.api.controllers import apps
25
-from laos.api.controllers import routes
26
-from laos.api.controllers import runnable
27
-from laos.api.controllers import tasks
24
+from picasso.api.controllers import apps
25
+from picasso.api.controllers import routes
26
+from picasso.api.controllers import runnable
27
+from picasso.api.controllers import tasks
28 28
 
29
-from laos.api.middleware import content_type
30
-from laos.api.middleware import keystone
29
+from picasso.api.middleware import content_type
30
+from picasso.api.middleware import keystone
31 31
 
32
-from laos.common import config
33
-from laos.common import logger as log
32
+from picasso.common import config
33
+from picasso.common import logger as log
34 34
 
35 35
 from urllib import parse
36 36
 
@@ -74,17 +74,17 @@ class API(service.HTTPService):
74 74
         )
75 75
 
76 76
 
77
-@click.command(name='laos-api')
77
+@click.command(name='picasso-api')
78 78
 @click.option('--host',
79
-              default=os.getenv("LAOS_HOST", '0.0.0.0'),
79
+              default=os.getenv("PICASSO_HOST", '0.0.0.0'),
80 80
               help='API service host.')
81
-@click.option('--port', default=int(os.getenv("LAOS_PORT", 10001)),
81
+@click.option('--port', default=int(os.getenv("PICASSO_PORT", 10001)),
82 82
               help='API service port.')
83 83
 @click.option('--db-uri',
84 84
               default=os.getenv(
85
-                  "LAOS_DB",
85
+                  "PICASSO_DB",
86 86
                   'mysql://root:root@localhost/functions'),
87
-              help='LaOS persistence storage URI.')
87
+              help='Picasso persistence storage URI.')
88 88
 @click.option('--keystone-endpoint',
89 89
               default=os.getenv("KEYSTONE_ENDPOINT",
90 90
                                 'http://localhost:5000/v3'),
@@ -94,9 +94,9 @@ class API(service.HTTPService):
94 94
                   "FUNCTIONS_URL", 'http://localhost:8080/v1'),
95 95
               help='Functions API host')
96 96
 @click.option('--log-level',
97
-              default=os.getenv("LAOS_LOG_LEVEL", 'INFO'),
97
+              default=os.getenv("PICASSO_LOG_LEVEL", 'INFO'),
98 98
               help='Logging file')
99
-@click.option('--log-file', default=os.getenv("LAOS_LOG_FILE"),
99
+@click.option('--log-file', default=os.getenv("PICASSO_LOG_FILE"),
100 100
               help='Log file path')
101 101
 @click.option('--debug', default=False, is_flag=True)
102 102
 def server(host, port, db_uri,
@@ -107,7 +107,7 @@ def server(host, port, db_uri,
107 107
            debug,
108 108
            ):
109 109
     """
110
-    Starts an Project Laos API service
110
+    Starts Picasso API service
111 111
     """
112 112
     logger = log.UnifiedLogger(
113 113
         log_to_console=True if not log_file else False,
@@ -141,9 +141,9 @@ def server(host, port, db_uri,
141 141
         logger=logger, debug=debug
142 142
     ).apply_swagger(
143 143
         swagger_url="/api",
144
-        description="Laos API service docs",
144
+        description="Picasso API service docs",
145 145
         api_version="v1.0.0",
146
-        title="Laos API",
146
+        title="Picasso API",
147 147
     ).initialize()
148 148
 
149 149
 

+ 5
- 5
setup.py View File

@@ -20,11 +20,12 @@ def read(fname):
20 20
     return open(os.path.join(os.path.dirname(__file__), fname)).read()
21 21
 
22 22
 setuptools.setup(
23
-    name='laos',
23
+    name='picasso',
24 24
     version='0.0.1',
25
-    description='Project LaOS (Lambdas-on-OpenStack',
25
+    description=('Picasso provides abstractions for '
26
+                 'Functions-as-a-Service on OpenStack'),
26 27
     long_description=read('README.md'),
27
-    url='laos.readthedocs.org',
28
+    url='picasso.readthedocs.org',
28 29
     author='Denis Makogon',
29 30
     author_email='denis@iron.io',
30 31
     packages=setuptools.find_packages(),
@@ -68,8 +69,7 @@ setuptools.setup(
68 69
     zip_safe=True,
69 70
     entry_points={
70 71
         'console_scripts': [
71
-            'laos-api = laos.service.laos_api:server',
72
+            'picasso-api = service.picasso_api:server',
72 73
         ]
73 74
     },
74
-
75 75
 )

+ 2
- 2
tox.ini View File

@@ -32,10 +32,10 @@ commands = flake8
32 32
 commands = {posargs}
33 33
 
34 34
 [testenv:py35-integration]
35
-commands = pytest --tb=long --capture=sys --cov=laos --capture=fd {toxinidir}/laos/tests/integration
35
+commands = pytest --tb=long --capture=sys --cov=picasso --capture=fd {toxinidir}/picasso/tests/integration
36 36
 
37 37
 [testenv:py35-functional]
38
-commands = pytest --tb=long --capture=sys --cov=laos --capture=fd {toxinidir}/laos/tests/functional
38
+commands = pytest --tb=long --capture=sys --cov=picasso --capture=fd {toxinidir}/picasso/tests/functional
39 39
 
40 40
 [testenv:py35-functional-regression]
41 41
 commands = {toxinidir}/scripts/test_regression.sh functional {posargs}

Loading…
Cancel
Save