forked from cloud-and-smart-labs/fog-service-orchestration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
service-0.yaml
71 lines (62 loc) · 2.01 KB
/
service-0.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
---
tosca_definitions_version: tosca_simple_yaml_1_3
description: Demo Service Template works on non fog devices
metadata:
template_name: "Demo for PC and VM"
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
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_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 }
# 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 Service (SWARM)
docker-service-1:
type: fog.docker.Services
properties:
name: demo
url: https://raw.githubusercontent.com/cloud-and-smart-labs/docker-images/main/demo/docker-compose.yaml
requirements:
- host: docker-swarm-leader
- dependency: docker-swarm-worker-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] }