-
Notifications
You must be signed in to change notification settings - Fork 0
/
ml-application_template.aadm
141 lines (123 loc) · 3.58 KB
/
ml-application_template.aadm
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
module: username
import: docker
import: openstack
description: "ML Application deployment over OpenStack cloud"
inputs:
ssh-key-name:
type: string
vm-name:
type: string
image-name:
type: string
openstack-network-name:
type: string
openstack-floating-ip-pool:
type: string
security-group-name:
type: string
security-groups:
type: string
flavor-name:
type: string
env:
type: map
username:
type: string
node_templates:
// Setting up OpenStack resources //
// OpenStack security group for the ML Application
ml-app-security-group:
type: openstack/sodalite.nodes.OpenStack.SecurityRules
properties:
group_description: "Security group for ML App: includes ports for SSH, Training DB, Training and Prediction services"
group_name: get_input: security-group-name
env: get_input: env
ports:
ssh-port:
protocol: "tcp"
port_range_min: 22
port_range_max: 22
remote_ip_prefix: "0.0.0.0/0"
training-db-service-port:
protocol: "tcp"
port_range_min: 5000
port_range_max: 5000
remote_ip_prefix: "0.0.0.0/0"
training-service-port:
protocol: "tcp"
port_range_min: 5001
port_range_max: 5001
remote_ip_prefix: "0.0.0.0/0"
prediction-service-port:
protocol: "tcp"
port_range_min: 5002
port_range_max: 5002
remote_ip_prefix: "0.0.0.0/0"
// OpenStack VM
sodalite-vm:
type: openstack/sodalite.nodes.OpenStack.VM
properties:
name: get_input: vm-name
key_name: get_input: ssh-key-name
image: get_input: image-name
network: get_input: openstack-network-name
security_groups: get_input: security-groups
flavor: get_input: flavor-name
username: get_input: username
floating_ip_pools: get_input: openstack-floating-ip-pool
env: get_input: env
timeout: 600
requirements:
protected_by:
node: username/ml-app-security-group
// Setting up Docker environment on the OpenStack VM //
// Docker host
docker-host:
type: docker/sodalite.nodes.DockerHost
requirements:
host:
node: username/sodalite-vm
// Docker network
docker-network:
type: docker/sodalite.nodes.DockerNetwork
properties:
name: "ml-app-docker-network"
requirements:
host:
node: username/sodalite-vm
dependency:
node: username/docker-host
// Docker images shall be pulled from public registry
docker-public-registry:
type: docker/sodalite.nodes.DockerRegistry
properties:
docker_registry_url: "registry.hub.docker.com"
docker_user: ""
docker_pass: ""
requirements:
host:
node: username/sodalite-vm
dependency:
node: username/docker-host
// Deploying components of the ML application //
// Create your ML application service nodes HERE
// Volume for Training and Prediction services
model-repo-volume:
type: docker/sodalite.nodes.DockerVolume
properties:
name: "model-repo"
requirements:
host:
node: username/sodalite-vm
dependency:
node: username/docker-host
// Obtaining useful outputs, such as public IP of the VM //
outputs:
// Public IP can be retrieved
// from the public_address attribute of the OpenStack VM
public_ip:
type: string
description: "The public IP of the provisioned VM"
value: get_attribute:
entity: username/sodalite-vm
attribute: username/sodalite-vm.public_address