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
66eecd36
Commit
66eecd36
authored
Feb 21, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed Orchestrator type
parent
c545cb6e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
22 deletions
+27
-22
lifeWatch_vre1.yaml
TOSCA/lifeWatch_vre1.yaml
+14
-13
nodes.yaml
TOSCA/types/nodes.yaml
+4
-4
planner.py
planner/planner/planner.py
+3
-0
simple_spec_alayzer.py
planner/service/simple_spec_alayzer.py
+2
-2
test_planner.py
planner/test/test_planner.py
+2
-1
tosca_helper.py
planner/util/tosca_helper.py
+2
-2
No files found.
TOSCA/lifeWatch_vre1.yaml
View file @
66eecd36
...
...
@@ -28,16 +28,17 @@ topology_template:
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
-
docker_orchestrator
:
type
:
tosca.policies.ARTICONF.Requirement.docker.Orchestrator
targets
:
[
ws-pema-lifewatch
]
properties
:
accepted_orchestrator_types
:
-
tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes
#policies:
#- location:
#type: tosca.policies.ARTICONF.Requirement.Provider
#targets: [ ws-pema-lifewatch ]
#properties:
#accepted_providers:
#- ExoGENI
#- orchestrator:
#type: tosca.policies.ARTICONF.Requirement.docker.Orchestrator
#targets: [ ws-pema-lifewatch ]
#properties:
#accepted_orchestrator_types:
#- tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes
TOSCA/types/nodes.yaml
View file @
66eecd36
...
...
@@ -33,7 +33,7 @@ node_types:
-
host
:
capability
:
tosca.capabilities.ARTICONF.docker.Orchestrator
node
:
tosca.nodes.ARTICONF.docker.Orchestrator
relationship
:
tosca.relationships.HostedOn
relationship
:
tosca.relationships.HostedOn
tosca.nodes.ARTICONF.docker.Orchestrator
:
derived_from
:
tosca.nodes.ARTICONF.Root
...
...
@@ -84,13 +84,13 @@ node_types:
type
:
tosca.interfaces.ARTICONF.Kubernetes
install
:
inputs
:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/
DRIP_3.0
/ansible_playbooks/install_k8s.yml
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/
develop
/ansible_playbooks/install_k8s.yml
create
:
inputs
:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/
DRIP_3.0
/ansible_playbooks/create_k8s.yml
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/
develop
/ansible_playbooks/create_k8s.yml
configure
:
inputs
:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/
DRIP_3.0
/ansible_playbooks/dashboard.yaml
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/
develop
/ansible_playbooks/dashboard.yaml
tosca.nodes.ARTICONF.docker.Orchestrator.Swarm
:
...
...
planner/planner/planner.py
View file @
66eecd36
...
...
@@ -179,6 +179,9 @@ class Planner:
def
find_best_node_for_requirements
(
self
,
all_requirements
):
"""Returns the 'best' node for a set of requirements. Here we count the number of requiremets that the node
can cover and return the one which covers the most """
# Check if we have a preference from policies
matching_nodes
=
{}
number_of_matching_requirement
=
{}
# Loop requirements to find nodes per requirement
...
...
planner/service/simple_spec_alayzer.py
View file @
66eecd36
...
...
@@ -19,7 +19,7 @@ class SimpleAnalyzer(SpecificationAnalyzer):
return_nodes
=
[]
# nodes_with_occurrences_in_requirements = tosca_util.get_nodes_with_occurrences_in_requirements(
# self.tosca_template.nodetemplates)
orchestrator_nodes
=
tosca_helper
.
get_nodes_by_type
(
'tosca.nodes.ARTICONF.Orchestrator'
,
orchestrator_nodes
=
tosca_helper
.
get_nodes_by_type
(
'tosca.nodes.ARTICONF.
docker.
Orchestrator'
,
self
.
tosca_template
.
nodetemplates
,
self
.
all_node_types
,
self
.
all_custom_def
)
...
...
@@ -115,7 +115,7 @@ class SimpleAnalyzer(SpecificationAnalyzer):
logging
.
info
(
'Setting properties for: '
+
str
(
affected_node
.
type
))
# ancestors_types = tosca_helper.get_all_ancestors_types(affected_node, self.all_node_types, self.all_custom_def)
# if 'tosca.nodes.ARTICONF.Orchestrator' in ancestors_types:
# if 'tosca.nodes.ARTICONF.
docker.
Orchestrator' in ancestors_types:
# logging.info('Do Something')
ancestors_properties
=
tosca_helper
.
get_all_ancestors_properties
(
affected_node
,
self
.
all_node_types
,
self
.
all_custom_def
)
...
...
planner/test/test_planner.py
View file @
66eecd36
...
...
@@ -67,8 +67,9 @@ 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
))
print
(
yaml
.
dump
(
template_dict
))
ToscaTemplate
(
yaml_dict_tpl
=
copy
.
deepcopy
(
template_dict
))
test_response
=
{
'toscaTemplate'
:
template_dict
}
response
=
{
'toscaTemplate'
:
template_dict
}
...
...
planner/util/tosca_helper.py
View file @
66eecd36
...
...
@@ -121,8 +121,8 @@ def node_type_2_node_template(node_type, all_custom_def):
node_type
[
next
(
iter
(
node_type
))]
.
pop
(
'type'
)
node_template
=
NodeTemplate
(
name
,
node_template_dict
,
node_type
)
# For some reason the tosca.nodes.ARTICONF.Orchestrator doesn't have all definitions so we need to add them
# manually. We get 'toscaparser.common.exception.InvalidTypeError: Type "tosca.nodes.ARTICONF.Orchestrator"
# For some reason the tosca.nodes.ARTICONF.
docker.
Orchestrator doesn't have all definitions so we need to add them
# manually. We get 'toscaparser.common.exception.InvalidTypeError: Type "tosca.nodes.ARTICONF.
docker.
Orchestrator"
# is not a valid type.'
if
len
(
node_template
.
custom_def
)
<
len
(
all_custom_def
):
for
def_key
in
all_custom_def
:
...
...
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