Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
2d24ec35
Commit
2d24ec35
authored
Jun 04, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uninstall test packages
parent
b8385753
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
27 deletions
+11
-27
.dockerignore
sure_tosca-flask-server/.dockerignore
+1
-1
Dockerfile
sure_tosca-flask-server/Dockerfile
+5
-0
requirements.txt
sure_tosca-flask-server/requirements.txt
+1
-10
tosca_template_service.py
...flask-server/sure_tosca/service/tosca_template_service.py
+2
-7
tosca_type_service.py
...sca-flask-server/sure_tosca/service/tosca_type_service.py
+0
-4
test_default_controller.py
...a-flask-server/sure_tosca/test/test_default_controller.py
+1
-4
test_tosca_template_service.py
...ask-server/sure_tosca/test/test_tosca_template_service.py
+1
-1
No files found.
sure_tosca-flask-server/.dockerignore
View file @
2d24ec35
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
README.md
README.md
tox.ini
tox.ini
git_push.sh
git_push.sh
test-requirements.txt
#
test-requirements.txt
setup.py
setup.py
# Byte-compiled / optimized / DLL files
# Byte-compiled / optimized / DLL files
...
...
sure_tosca-flask-server/Dockerfile
View file @
2d24ec35
...
@@ -4,12 +4,17 @@ RUN mkdir -p /usr/src/app
...
@@ -4,12 +4,17 @@ RUN mkdir -p /usr/src/app
WORKDIR
/usr/src/app
WORKDIR
/usr/src/app
COPY
requirements.txt /usr/src/app/
COPY
requirements.txt /usr/src/app/
COPY
test-requirements.txt /usr/src/app/
RUN
pip
install
--no-cache-dir
-r
requirements.txt
RUN
pip
install
--no-cache-dir
-r
requirements.txt
RUN
pip
install
--no-cache-dir
-r
test-requirements.txt
COPY
. /usr/src/app
COPY
. /usr/src/app
RUN
python
-m
unittest discover
RUN
python
-m
unittest discover
RUN
pip uninstall
-y
--no-cache-dir
-r
test-requirements.txt
EXPOSE
8081
EXPOSE
8081
...
...
sure_tosca-flask-server/requirements.txt
View file @
2d24ec35
...
@@ -6,12 +6,3 @@ swagger-ui-bundle==0.0.6
...
@@ -6,12 +6,3 @@ swagger-ui-bundle==0.0.6
tinydb==3.15.2
tinydb==3.15.2
tosca-parser==2.0.0
tosca-parser==2.0.0
flask-restx==0.2.0
flask-restx==0.2.0
wheel==0.34.2
flask-testing==0.8.0
coverage==5.0.4
nose>=1.3.7
pluggy>=0.13.1
randomize>=0.14
Werkzeug==1.0.0
\ No newline at end of file
sure_tosca-flask-server/sure_tosca/service/tosca_template_service.py
View file @
2d24ec35
import
json
import
copy
import
logging
import
logging
import
os
import
os
import
tempfile
import
tempfile
import
time
import
time
import
uuid
from
builtins
import
print
from
functools
import
reduce
from
functools
import
reduce
import
copy
import
yaml
import
yaml
from
tinydb
import
TinyDB
,
Query
from
tinydb
import
TinyDB
,
Query
from
tinydb.middlewares
import
CachingMiddleware
from
tinydb.middlewares
import
CachingMiddleware
from
tinydb.storages
import
MemoryStorage
from
tinydb.storages
import
MemoryStorage
from
toscaparser.functions
import
GetAttribute
from
toscaparser.tosca_template
import
ToscaTemplate
from
toscaparser.tosca_template
import
ToscaTemplate
from
werkzeug.datastructures
import
FileStorage
from
werkzeug.datastructures
import
FileStorage
...
@@ -20,7 +16,6 @@ from sure_tosca.models.base_model_ import Model
...
@@ -20,7 +16,6 @@ from sure_tosca.models.base_model_ import Model
from
sure_tosca.models.node_template
import
NodeTemplateModel
as
NodeTemplateModel
from
sure_tosca.models.node_template
import
NodeTemplateModel
as
NodeTemplateModel
from
sure_tosca.models.node_template_map
import
NodeTemplateMapModel
from
sure_tosca.models.node_template_map
import
NodeTemplateMapModel
from
sure_tosca.models.tosca_template
import
ToscaTemplateModel
as
ToscaTemplateModel
from
sure_tosca.models.tosca_template
import
ToscaTemplateModel
as
ToscaTemplateModel
from
sure_tosca.service
import
tosca_helper
from
sure_tosca.service
import
tosca_helper
# db = TinyDB(storage=CachingMiddleware(MemoryStorage))
# db = TinyDB(storage=CachingMiddleware(MemoryStorage))
...
@@ -110,7 +105,7 @@ def save(file: FileStorage):
...
@@ -110,7 +105,7 @@ def save(file: FileStorage):
purge_all_tables
()
purge_all_tables
()
dictionary
=
yaml
.
safe_load
(
file
.
stream
)
dictionary
=
yaml
.
safe_load
(
file
.
stream
)
# dictionary = yaml.load(file.stream)
# dictionary = yaml.load(file.stream)
logger
.
info
(
"tosca template:
\n
"
+
str
(
yaml
.
dump
(
dictionary
)))
logger
.
debug
(
"tosca template:
\n
"
+
str
(
yaml
.
dump
(
dictionary
)))
# print(yaml.dump(dictionary))
# print(yaml.dump(dictionary))
tosca_template
=
get_tosca_template
(
dictionary
)
tosca_template
=
get_tosca_template
(
dictionary
)
# all_custom_def = tosca_template.nodetemplates[0].custom_def
# all_custom_def = tosca_template.nodetemplates[0].custom_def
...
...
sure_tosca-flask-server/sure_tosca/service/tosca_type_service.py
View file @
2d24ec35
from
sure_tosca.models.node_template
import
NodeTemplateModel
# noqa: E501
from
sure_tosca.models.node_template_map
import
NodeTemplateMapModel
# noqa: E501
from
sure_tosca.models.tosca_template
import
ToscaTemplateModel
# noqa: E501
def
add_type_definition
(
definition_map
):
def
add_type_definition
(
definition_map
):
return
None
return
None
...
...
sure_tosca-flask-server/sure_tosca/test/test_default_controller.py
View file @
2d24ec35
...
@@ -2,16 +2,13 @@
...
@@ -2,16 +2,13 @@
from
__future__
import
absolute_import
from
__future__
import
absolute_import
import
os
import
tempfile
import
tempfile
import
requests
import
requests
from
flask
import
json
from
flask
import
json
from
six
import
BytesIO
from
six
import
BytesIO
import
os
from
sure_tosca.models.node_template
import
NodeTemplateModel
# noqa: E501
from
sure_tosca.models.topology_template
import
TopologyTemplateModel
# noqa: E501
from
sure_tosca.models.tosca_template
import
ToscaTemplateModel
# noqa: E501
from
sure_tosca.test
import
BaseTestCase
from
sure_tosca.test
import
BaseTestCase
...
...
sure_tosca-flask-server/sure_tosca/test/test_tosca_template_service.py
View file @
2d24ec35
...
@@ -25,7 +25,7 @@ class Test(TestCase):
...
@@ -25,7 +25,7 @@ class Test(TestCase):
file_names
=
[
'application_example_outputs.yaml'
,
'application_example_2_topologies.yaml'
,
'lifeWatch_vre1.yaml'
,
file_names
=
[
'application_example_outputs.yaml'
,
'application_example_2_topologies.yaml'
,
'lifeWatch_vre1.yaml'
,
'application_example_updated.yaml'
,
'compute.yaml'
,
'application_example_provisioned.yaml'
,
'topology.yaml'
,
'application_example_updated.yaml'
,
'compute.yaml'
,
'application_example_provisioned.yaml'
,
'topology.yaml'
,
'kubernetes.yaml'
,
'
application_example_planed.yaml'
,
'
TIC.yaml'
]
'kubernetes.yaml'
,
'TIC.yaml'
]
for
file_name
in
file_names
:
for
file_name
in
file_names
:
logger
.
info
(
"Testing : "
+
str
(
file_name
))
logger
.
info
(
"Testing : "
+
str
(
file_name
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment