forked from cloud-and-smart-labs/fog-service-orchestration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
service-1.yaml
121 lines (108 loc) · 3.61 KB
/
service-1.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
tosca_definitions_version: tosca_simple_yaml_1_3
description: Service Template for remote LED with privileged containers
metadata:
template_name: "fog service orchestration for LEDs"
template_author: "UoH"
template_version: "2.0"
imports:
- relationshiptypes/token_transfer/token_transfer.yaml
- nodetypes/swarm_leader/swarm_leader.yaml
- nodetypes/swarm_worker/swarm_worker.yaml
- nodetypes/docker_services/docker_services.yaml
- nodetypes/docker_containers/docker_containers.yaml
topology_template:
inputs:
node_1:
type: string
description: Input IP address of node_1
node_2:
type: string
description: Input IP address of node_2
node_3:
type: string
description: Input IP address of node_3
node_templates:
# All fog nodes
fog-node-1:
type: tosca.nodes.Compute
attributes:
private_address: { get_input: node_1 }
public_address: { get_input: node_1 }
fog-node-2:
type: tosca.nodes.Compute
attributes:
private_address: { get_input: node_2 }
public_address: { get_input: node_2 }
fog-node-3:
type: tosca.nodes.Compute
attributes:
private_address: { get_input: node_3 }
public_address: { get_input: node_3 }
# Swarm leader node
docker-swarm-leader:
type: fog.docker.SwarmLeader
requirements:
- host: fog-node-1
# Swarm worker nodes
docker-swarm-worker-1:
type: fog.docker.SwarmWorker
requirements:
- host: fog-node-2
- leader: docker-swarm-leader
docker-swarm-worker-2:
type: fog.docker.SwarmWorker
requirements:
- host: fog-node-3
- leader: docker-swarm-leader
# Docker Service (SWARM)
docker-service-1:
type: fog.docker.Services
properties:
name: mystack
url: https://raw.githubusercontent.com/cloud-and-smart-labs/docker-images/main/websocket-led/docker-compose.yaml
requirements:
- host: docker-swarm-leader
- dependency: docker-swarm-worker-1
- dependency: docker-swarm-worker-2
# Privileged containers
privileged_container-1:
type: fog.docker.Containers
properties:
name: TESTNAME
url: https://raw.githubusercontent.com/cloud-and-smart-labs/docker-images/main/websocket-led/actuator/docker-compose.yaml
packages:
- websockets
requirements:
- host: fog-node-1
- dependency: docker-service-1
privileged_container-2:
type: fog.docker.Containers
properties:
name: TESTNAME
url: https://raw.githubusercontent.com/cloud-and-smart-labs/docker-images/main/websocket-led/actuator/docker-compose.yaml
packages:
- websockets
requirements:
- host: fog-node-2
- dependency: docker-service-1
privileged_container-3:
type: fog.docker.Containers
properties:
name: TESTNAME
url: https://raw.githubusercontent.com/cloud-and-smart-labs/docker-images/main/websocket-led/actuator/docker-compose.yaml
packages:
- websockets
requirements:
- host: fog-node-3
- dependency: docker-service-1
outputs:
output_worker_token_attribute:
description: Swarm join token for worker nodes
value: { get_attribute: [docker-swarm-leader, worker_token] }
output_manager_token_attribute:
description: Swarm join token for manager nodes
value: { get_attribute: [docker-swarm-leader, manager_token] }
advertised_address:
description: Swarm join address
value: { get_attribute: [docker-swarm-leader, advertise_addr] }