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
07160902
Commit
07160902
authored
Mar 27, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed interfaces
parent
aa0d2e03
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
27 deletions
+89
-27
interfaces.yml
TOSCA/types/interfaces.yml
+6
-7
nodes.yaml
TOSCA/types/nodes.yaml
+31
-2
workflows.yaml
TOSCA/types/workflows.yaml
+2
-0
deploy_service.py
deployer/service/deploy_service.py
+21
-0
test_deployer.py
deployer/test/test_deployer.py
+13
-2
docker-compose.yml
docker-compose.yml
+16
-16
No files found.
TOSCA/types/interfaces.yml
View file @
07160902
...
...
@@ -73,15 +73,14 @@ interface_types:
playbook
:
type
:
string
required
:
false
default
:
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/install_k8s.yml
install
:
description
:
install Kubernetes
k8s_scale
:
scale
:
description
:
Set the number of replicas for a Deployment, ReplicaSet, or Replication Controller, or the parallelism attribute of a Job.
k8s_
create
:
create
:
description
:
create deployment on a k8s cluster
k8s_
delete
:
delete
:
description
:
delete deployment on a k8s cluster
k8s_info
:
autoscale
:
description
:
horizontal_pod_autoscaler
info
:
description
:
get information on pods,services or deployments
TOSCA/types/nodes.yaml
View file @
07160902
...
...
@@ -49,6 +49,36 @@ node_types:
type
:
string
required
:
false
description
:
url of the service
interfaces
:
Kubernetes
:
create
:
implementation
:
image
inputs
:
strategy
:
type
:
Recreate
interfaces
:
Kubernetes
:
type
:
tosca.interfaces.ARTICONF.Kubernetes
delete
:
inputs
:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/delete_service.yml
create
:
inputs
:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/create_service.yml
scale
:
inputs
:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/scale_service.yml
replicas:1
autoscale
:
inputs
:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/autoscale_service.yml
horizontal_pod_autoscaler
:
https://raw.githubusercontent.com/skoulouzis/CONF/develop/k8s/horizontal_pod_autoscaler.yml
info
:
inputs
:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/get_info_service.yml
tosca.nodes.ARTICONF.docker.Orchestrator
:
derived_from
:
tosca.nodes.ARTICONF.Application
...
...
@@ -95,8 +125,7 @@ node_types:
required
:
false
description
:
the dashboard access url
interfaces
:
Kubernetes
:
type
:
tosca.interfaces.ARTICONF.Kubernetes
Standard
:
install
:
inputs
:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/install_k8s.yml
...
...
TOSCA/types/workflows.yaml
0 → 100644
View file @
07160902
tosca_definitions_version
:
tosca_simple_yaml_1_0
workflow_types
:
deployer/service/deploy_service.py
0 → 100644
View file @
07160902
def
get_interface_types
(
target
):
print
(
target
.
node_template
.
interfaces
)
interface_types
=
[]
for
interface
in
target
.
node_template
.
interfaces
:
interface_types
.
append
(
interface
)
return
interface_types
def
deploy
(
nodes_pair
):
target
=
nodes_pair
[
0
]
source
=
nodes_pair
[
1
]
interface_types
=
get_interface_types
(
source
)
if
'Kubernetes'
in
interface_types
:
kubernetes_service
.
deploy
(
nodes_pair
)
elif
'Kubernetes'
in
interface_types
:
print
(
source
)
print
(
target
)
return
None
deployer/test/test_deployer.py
View file @
07160902
...
...
@@ -13,6 +13,8 @@ import sure_tosca_client
from
sure_tosca_client
import
Configuration
,
ApiClient
from
sure_tosca_client.api
import
default_api
from
service.deploy_service
import
deploy
class
TestDeployer
(
unittest
.
TestCase
):
...
...
@@ -54,13 +56,22 @@ class TestDeployer(unittest.TestCase):
doc_id
=
self
.
upload_tosca_template
(
tosca_template_path
,
tosca_client
)
self
.
assertIsNotNone
(
doc_id
)
nodes_to_deploy
=
tosca_client
.
get_node_templates
(
doc_id
,
type_name
=
'tosca.nodes.ARTICONF.Application'
)
self
.
assertIsNotNone
(
nodes_to_deploy
)
nodes_to_deploy_ordered
=
[]
nodes_pairs
=
[]
infrastructure_nodes
=
[]
for
node
in
nodes_to_deploy
:
related_nodes
=
tosca_client
.
get_related_nodes
(
doc_id
,
node
.
name
)
for
related_node
in
related_nodes
:
print
(
related_node
)
# if related_node in nodes_to_deploy:
pair
=
(
related_node
,
node
)
nodes_pairs
.
append
(
pair
)
for
node_pair
in
nodes_pairs
:
deploy
(
node_pair
)
# tmp_path = tempfile.mkdtemp()
# vms = tosca.get_vms(tosca_template_dict)
# inventory_path = ansible_service.write_inventory_file(tmp_path, vms)
...
...
docker-compose.yml
View file @
07160902
...
...
@@ -59,23 +59,23 @@ services:
-
"
27017:27017"
#
manager:
#
depends_on:
#
- rabbit
#
- mongo
#
- sure-tosca
#
image: manager:3.0.0
#
environment:
#
RABBITMQ_HOST: rabbit
#
MONGO_HOST: mongo
#
SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
#
ports:
#
- "30000:8080"
manager
:
depends_on
:
-
rabbit
-
mongo
-
sure-tosca
image
:
manager:3.0.0
environment
:
RABBITMQ_HOST
:
rabbit
MONGO_HOST
:
mongo
SURE_TOSCA_BASE_PATH
:
http://sure-tosca:8081/tosca-sure/1.0.0
ports
:
-
"
30000:8080"
sure-tosca
:
image
:
sure-tosca:3.0.0
ports
:
-
"
8081:8081"
#
sure-tosca:
#
image: sure-tosca:3.0.0
#
ports:
#
- "8081:8081"
planner
:
depends_on
:
...
...
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