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
b11f9e1e
Commit
b11f9e1e
authored
5 years ago
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added cloud provider requirement
parent
91eb69c0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
7 deletions
+87
-7
lifeWatch_vre1.yaml
TOSCA/lifeWatch_vre1.yaml
+37
-0
policies.yaml
TOSCA/types/policies.yaml
+11
-0
test_planner.py
planner/test/test_planner.py
+39
-7
No files found.
TOSCA/lifeWatch_vre1.yaml
0 → 100644
View file @
b11f9e1e
tosca_definitions_version
:
tosca_simple_yaml_1_0
imports
:
-
nodes
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml
-
data
:
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml
-
capabilities
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml
-
policies
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml
-
interfaces
:
https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/interfaces.yml
repositories
:
docker_hub
:
https://hub.docker.com/
description
:
>
TOSCA example
topology_template
:
node_templates
:
ws-pema-lifewatch
:
type
:
tosca.nodes.ARTICONF.Container.Application.Docker
properties
:
ports
:
-
"
30001:8080"
artifacts
:
image
:
type
:
tosca.artifacts.Deployment.Image.Container.Docker
file
:
alogo53/ws-pema-lifewatch
repository
:
docker_hub
policies
:
-
location
:
type
:
tosca.policies.ARTICONF.Placement.Requirement.Provider
targets
:
[
ws-pema-lifewatch
]
properties
:
accepted_providers
:
-
ExoGENI
This diff is collapsed.
Click to expand it.
TOSCA/types/policies.yaml
View file @
b11f9e1e
...
...
@@ -39,3 +39,14 @@ policy_types:
type
:
integer
required
:
false
description
:
the minimum acceptable value
tosca.policies.ARTICONF.Placement.Requirement.Provider
:
derived_from
:
tosca.policies.Placement
description
:
defines cloud providr where vm topology can be deployed
properties
:
accepted_providers
:
type
:
list
description
:
list of the acceptable providers
schema_entry
:
type
:
string
This diff is collapsed.
Click to expand it.
planner/test/test_planner.py
View file @
b11f9e1e
...
...
@@ -15,16 +15,49 @@ from service.spec_service import SpecService
from
util
import
tosca_helper
def
get_tosca_files_path
(
file_name
):
tosca_path
=
"../../TOSCA/"
input_tosca_file_path
=
tosca_path
+
file_name
if
not
os
.
path
.
exists
(
input_tosca_file_path
):
tosca_path
=
"../TOSCA/"
input_tosca_file_path
=
tosca_path
+
file_name
return
input_tosca_file_path
class
MyTestCase
(
unittest
.
TestCase
):
def
test_planner
(
self
):
# def test_planner1(self):
# logger = logging.getLogger(__name__)
#
# input_tosca_file_path = get_tosca_files_path('application_example_updated.yaml')
#
# self.assertEqual(True, os.path.exists(input_tosca_file_path),
# "Input TOSCA file: " + input_tosca_file_path + " not found")
#
# conf = {'url': "http://host"}
# spec_service = SpecService(conf)
# test_planner = Planner(input_tosca_file_path, spec_service)
# test_tosca_template = test_planner.resolve_requirements()
# test_tosca_template = test_planner.set_infrastructure_specifications()
# template_dict = tosca_helper.get_tosca_template_2_topology_template_dictionary(test_tosca_template)
# logger.info("template ----: \n" + yaml.dump(template_dict))
# ToscaTemplate(yaml_dict_tpl=copy.deepcopy(template_dict))
#
# test_response = {'toscaTemplate': template_dict}
#
# response = {'toscaTemplate': template_dict}
# output_current_milli_time = int(round(time.time() * 1000))
# response["creationDate"] = output_current_milli_time
# response["parameters"] = []
# print("Output message:" + json.dumps(response))
# self.assertEqual(True, True)
def
test_planner2
(
self
):
logger
=
logging
.
getLogger
(
__name__
)
tosca_path
=
"../../TOSCA/"
input_tosca_file_path
=
tosca_path
+
'/application_example_updated.yaml'
if
not
os
.
path
.
exists
(
input_tosca_file_path
):
tosca_path
=
"../TOSCA/"
input_tosca_file_path
=
tosca_path
+
'/application_example_updated.yaml'
input_tosca_file_path
=
get_tosca_files_path
(
'lifeWatch_vre1.yaml'
)
self
.
assertEqual
(
True
,
os
.
path
.
exists
(
input_tosca_file_path
),
"Input TOSCA file: "
+
input_tosca_file_path
+
" not found"
)
...
...
@@ -36,7 +69,6 @@ class MyTestCase(unittest.TestCase):
test_tosca_template
=
test_planner
.
set_infrastructure_specifications
()
template_dict
=
tosca_helper
.
get_tosca_template_2_topology_template_dictionary
(
test_tosca_template
)
logger
.
info
(
"template ----:
\n
"
+
yaml
.
dump
(
template_dict
))
ToscaTemplate
(
yaml_dict_tpl
=
copy
.
deepcopy
(
template_dict
))
test_response
=
{
'toscaTemplate'
:
template_dict
}
...
...
This diff is collapsed.
Click to expand it.
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