create-lambda-instance.hbs 16 KB
Newer Older
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
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    Dashboard
    <small>Create a Lambda Instance</small>
  </h1>
</section>

<section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box box-info">
        <div class="box-header with-border">
          <h3 class="box-title">Create a new Lambda Instance</h3>
          <div class="box-tools pull-right">
            <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
            <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
          </div>
        </div><!-- /.box-header -->
        <div class="box-body no-padding">
          <div class="row">
            <div class="col-md-9 col-sm-8">
              <div class="pad">
                Here you can create your own Lambda Instance
              </div>
            </div><!-- /.col -->
          </div><!-- /.row -->
        </div><!--box-->
      </div> <!-- box-primary -->
    </div> <!--col -->
  </div> <!--row-->

  {{#unless enoughQuotas}}
  <div class="row">
    <div class="col-xs-12">
      <div class="alert alert-warning alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
        <h4><i class="icon fa fa-warning"></i> Alert! - No resources available to create a new lambda instance!</h4>
        Based on the ~okeanos projects we found on your ~okeanos profile, you don't have the resources needed to create a lambda instance.
        A lambda instance requires at least <ul><li> 1 public ip</li> <li>2 VMs</li><li>4 CPU's per VM </li> <li>4096MB of RAM per VM </li><li> 20GB of hard disk per VM</li></ul>Please join a project or create your own project and ask for resources so as to create a lambda Instance. In order to join or create an ~okeanos project follow this <a href="https://accounts.okeanos.grnet.gr/ui/projects" target="_blank">link</a>!.
      </div> <!-- class="alert alert-warning alert-dismissable" -->
    </div> <!-- col-xs-12 -->
  </div><!-- row -->
  {{/unless}}

  {{#if enoughQuotas}}
  <form {{action "saveLambdaInstance" model.newLambdaInstance on="submit"}} method="post">
    <div class="row">
      <div class="col-xs-12">
        <div class="box box-primary">
          <div class="box-header with-border">
            <h3 class="box-title">Main</h3>: Lambda Instance details
          </div><!-- /.box-header -->
          <div class="box-body">

            <div class="row">
              <div class="col-sm-12">
                <p><i class="fa fa-info"></i>  All inputs marked with (*) are required. </p>
            </div>
          </div>
            <div class="row">
              <div class="form-group col-sm-6">
63
64
65
66
67
                {{#tool-tip}}
                  <label for="name1"> Name of Lamdba Instance (*) </label>
                  <i class="fa fa-info-circle has-tooltip"
                  data-tooltip-content="<center></center>"></i>
                {{/tool-tip}}
68
69
70
71
72
73
74
75
                {{input type="text" value=instanceName placeholder="Lambda Instance name" size="50" class="form-control" required="true"}}
                {{#each model.newLambdaInstance.errors.instanceName as |error|}}
                  <div class="alert alert-danger alert-dismissable">
                    {{error.message}}
                  </div>
                {{/each}}
              </div>
              <div class="form-group col-sm-6">
76
77
78
79
80
                {{#tool-tip}}
                  <label for="name1"> Name of Master Node (*) </label>
                  <i class="fa fa-info-circle has-tooltip"
                  data-tooltip-content="<center></center>"></i>
                {{/tool-tip}}
81
82
83
84
85
86
87
88
89
90
                {{input type="text" value=masterName placeholder="Master node name" size="50" class="form-control" required="true"}}
                {{#each model.newLambdaInstance.errors.masterName as |error|}}
                  <div class="alert alert-danger alert-dismissable">
                    {{error.message}}
                  </div>
                {{/each}}
              </div>
            </div>
            <div class="row">
              <div class="form-group col-sm-8">
91
92
93
94
95
                {{#tool-tip}}
                  <label for="okeanos_project">~okeanos Project (*)</label>
                  <i class="fa fa-info-circle has-tooltip"
                  data-tooltip-content="<center></center>"></i>
                {{/tool-tip}}
96
                  <select name="okeanos_project" class="form-control" onchange={{action "selectFromDropDownList" "selectedProjectName"}}>
97
98
99
100
101
102
103
                    {{#each model.userOkeanosProjects as |project|}}
                    <option value={{project.name}}>{{project.name}} (VMs: {{project.vm}}, CPUs: {{project.cpu}}, RAM: {{normalize-bytes project.ram}}, Disk: {{normalize-bytes project.disk}}, Floating IPs: {{project.floating_ip}}, Private Networks: {{project.private_network}})</option>
                    {{/each}}
                  </select>
                <span id="helpBlock" class="help-block">Select a project</span>
              </div>	<!--class="col-sm-6"-->
              <div class="form-group col-sm-3">
104
105
106
107
108
                {{#tool-tip}}
                  <label for="slaves">Number of slaves</label>
                  <i class="fa fa-info-circle has-tooltip"
                  data-tooltip-content="<center></center>"></i>
                {{/tool-tip}}
109
                  {{input type="number" value=selectedNumberOfSlaves min=1 max=(math-op selectedProjectVMs '-' 1) name="slaves" class="form-control" change=(action "selectFromDropDownList" "selectedNumberOfSlaves")}}
110
111
112
113
114
115
                  <span id="helpBlock" class="help-block">Select the number of slaves</span>
              </div>	<!--class="form-group col-sm-3"-->
            </div>

            <style>.tokenfield.form-control { height: auto; }</style>
            <div class="row">
116
              <div class="form-group col-sm-6 {{if conflictingKafkaTopics 'has-error'}}">
117
118
119
120
121
                {{#tool-tip}}
                  <label for="kafka_topics">Apache Kafka input topics</label>
                  <i class="fa fa-info-circle has-tooltip"
                  data-tooltip-content="<center></center>"></i>
                {{/tool-tip}}
122
                  {{kafka-topics topics=kafkaInputTopics id="kafka-input-topics"}}
123
124
125
                  <span id="helpBlock" class="help-block">Names of Apache Kafka input topics<br>
                  Default input topic, if no names are given: "input"</span>
              </div>
126
              <div class="form-group col-sm-6 pull-right {{if conflictingKafkaTopics 'has-error'}}">
127
128
129
130
131
                {{#tool-tip}}
                  <label for="kafka_topics">Apache Kafka output topics</label>
                  <i class="fa fa-info-circle has-tooltip"
                  data-tooltip-content="<center></center>"></i>
                {{/tool-tip}}
132
                  {{kafka-topics topics=kafkaOutputTopics id="kafka-output-topics"}}
133
134
135
136
137
138
                  <span id="helpBlock" class="help-block">Names of Apache Kafka output topics<br>
                  Default output topics, if no names are given: "batch-output", "stream-output"</span>
              </div>
            </div><!--row-->
            <div class="row">
              <div class="form-group col-sm-3">
139
140
141
142
143
                {{#tool-tip}}
                  <label for="public_key_name">Public SSH keys (*)</label>
                  <i class="fa fa-info-circle has-tooltip"
                  data-tooltip-content="<center></center>"></i>
                {{/tool-tip}}
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
                  <select required="required" multiple name="public_key_name" class="form-control">
                    {{#each model.userPublicKeys as |publicKey|}}
                    <option value={{publicKey.name}}>{{publicKey.name}}</option>
                    {{/each}}
                  </select>
              </div>
              <div class="form-group col-sm-2">
              <br/>
                  <span id="helpBlock" class="help-block">Select the public SSH keys to upload to the lamdba instance vms. By selecting ssh keys, you will get access to these vms.</span>
              </div><!--class="form-group col-sm-6"-->
            </div><!--row-->
          </div><!--box-body-->
        </div><!--box-->
      </div><!--col-->
    </div><!--row-->

    <div class="row">
      <div class="col-xs-12">
        <div class="box box-primary">
          <div class="box-header with-border">
            <h3 class="box-title">Master</h3>: Master Node details
          </div><!-- /.box-header -->
          <div class="box-body">
            <div class="row">
              <div class="form-group col-sm-4">
                <label for="vcpus_master">Number of CPUs on Master Node:</label>
170
                  <select name="vcpus_master" class="form-control" onchange={{action "selectFromDropDownList" "selectedMasterNodeCPUs"}} disabled={{masterCPUsSelectDisabled}}>
171
                    {{#each masterNodeCPUValues as |vcpusValue|}}
172
                      {{#if (compare vcpusValue.value "===" selectedMasterNodeCPUs)}}
173
174
175
176
                        <option value={{vcpusValue.value}} selected>{{vcpusValue.value}}</option>
                      {{else}}
                        {{#if vcpusValue.enabled}}
                          <option value={{vcpusValue.value}}>{{vcpusValue.value}}</option>
177
                        {{else}}
178
                          <option value={{vcpusValue.value}} disabled>{{vcpusValue.value}}</option>
179
180
181
182
183
184
185
186
                        {{/if}}
                      {{/if}}
                    {{/each}}
                  </select>
                  <span id="helpBlock" class="help-block">We recommend using 4 CPUs</span>
              </div>	<!--class="col-sm-4"-->
              <div class="form-group col-sm-4">
                <label for="ram_master" >Amount or RAM memory on Master Node: </label>
187
                <select name="ram_master"  class="form-control" onchange={{action "selectFromDropDownList" "selectedMasterNodeRAM"}} disabled={{masterRAMSelectDisabled}}>
188
                  {{#each masterNodeRAMValues as |ramValue|}}
189
                    {{#if (compare ramValue.value "===" selectedMasterNodeRAM)}}
190
191
192
193
                      <option value={{ramValue.value}} selected>{{ramValue.value}}</option>
                    {{else}}
                      {{#if ramValue.enabled}}
                        <option value={{ramValue.value}}>{{ramValue.value}}</option>
194
                      {{else}}
195
                        <option value={{ramValue.value}} disabled>{{ramValue.value}}</option>
196
197
198
199
200
201
202
203
                      {{/if}}
                    {{/if}}
                  {{/each}}
                </select>
                <span id="helpBlock" class="help-block">We recommend using 4096MB of RAM</span>
              </div><!--class="form-group col-sm-6"-->
              <div class="form-group col-sm-4">
                <label for="disk_master"> Size of hard disk on Master Node: </label>
204
                <select name="disk_master" class="form-control" onchange={{action "selectFromDropDownList" "selectedMasterNodeDisk"}} disabled={{masterDiskSelectDisabled}}>
205
                  {{#each masterNodeDiskValues as |diskValue|}}
206
                    {{#if (compare diskValue.value "===" selectedMasterNodeDisk)}}
207
208
209
210
                      <option value={{diskValue.value}} selected>{{diskValue.value}}</option>
                    {{else}}
                      {{#if diskValue.enabled}}
                        <option value={{diskValue.value}}>{{diskValue.value}}</option>
211
                      {{else}}
212
                        <option value={{diskValue.value}} disabled>{{diskValue.value}}</option>
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
                      {{/if}}
                    {{/if}}
                  {{/each}}
                </select>
                <span id="helpBlock" class="help-block">We recommend using 20GB of hard disk</span>
              </div>
            </div><!--row-->
          </div><!--box-body-->
        </div><!--box-->
      </div><!--col-->
    </div><!--row-->

    <div class="row">
      <div class="col-xs-12">
        <div class="box box-primary">
          <div class="box-header with-border">
            <h3 class="box-title">Slaves</h3>: Slave Nodes details
          </div><!-- /.box-header -->
          <div class="box-body">
             <div class="row">
              <div class="form-group col-sm-4">
                <label for="vcpus_slave">Number of CPUs on each Slave Node:</label>
235
                  <select name="vcpus_slave" class="form-control" onchange={{action "selectFromDropDownList" "selectedSlaveNodeCPUs"}} disabled={{slaveCPUsSelectDisabled}}>
236
                    {{#each slaveNodeCPUValues as |vcpusValue|}}
237
                      {{#if (compare vcpusValue.value "===" selectedSlaveNodeCPUs)}}
238
239
240
241
                        <option value={{vcpusValue.value}} selected>{{vcpusValue.value}}</option>
                      {{else}}
                        {{#if vcpusValue.enabled}}
                          <option value={{vcpusValue.value}}>{{vcpusValue.value}}</option>
242
                        {{else}}
243
                          <option value={{vcpusValue.value}} disabled>{{vcpusValue.value}}</option>
244
245
246
247
248
249
250
251
                        {{/if}}
                      {{/if}}
                    {{/each}}
                  </select>
                  <span id="helpBlock" class="help-block">We recommend using 4 CPUs</span>
              </div>	<!--class="col-sm-4"-->
              <div class="form-group col-sm-4">
                <label for="ram_slave" >Amount or RAM memory on each Slave Node:</label>
252
                <select name="ram_slave"  class="form-control" onchange={{action "selectFromDropDownList" "selectedSlaveNodeRAM"}} disabled={{slaveRAMSelectDisabled}}>
253
                  {{#each slaveNodeRAMValues as |ramValue|}}
254
                    {{#if (compare ramValue.value "===" selectedSlaveNodeRAM)}}
255
256
257
258
                      <option value={{ramValue.value}} selected>{{ramValue.value}}</option>
                    {{else}}
                      {{#if ramValue.enabled}}
                        <option value={{ramValue.value}}>{{ramValue.value}}</option>
259
                      {{else}}
260
                        <option value={{ramValue.value}} disabled>{{ramValue.value}}</option>
261
262
263
264
265
266
267
268
269
                      {{/if}}
                    {{/if}}
                  {{/each}}
                  </select>
                  <span id="helpBlock" class="help-block">We recommend using 4096MB of RAM</span>
              </div><!--class="form-group col-sm-4"-->

              <div class="form-group col-sm-4">
                <label for="disk_slave"> Size of hard disk on each Slave Node:</label>
270
                <select name="disk_slave" class="form-control" onchange={{action "selectFromDropDownList" "selectedSlaveNodeDisk"}} disabled={{slaveDiskSelectDisabled}}>
271
                  {{#each slaveNodeDiskValues as |diskValue|}}
272
                    {{#if (compare diskValue.value "===" selectedSlaveNodeDisk)}}
273
274
275
276
                      <option value={{diskValue.value}} selected>{{diskValue.value}}</option>
                    {{else}}
                      {{#if diskValue.enabled}}
                        <option value={{diskValue.value}}>{{diskValue.value}}</option>
277
                      {{else}}
278
                        <option value={{diskValue.value}} disabled>{{diskValue.value}}</option>
279
280
281
282
283
284
285
286
287
288
289
290
                      {{/if}}
                    {{/if}}
                  {{/each}}
                </select>
                <span id="helpBlock" class="help-block">We recommend using 20GB of hard disk</span>
              </div>
            </div><!--row-->
          </div><!--box-body-->
        </div><!--box-->
      </div><!--col-->
    </div><!--row-->

291
    <button type="submit" class="btn btn-primary" disabled={{submitButtonDisabled}}>Submit</button>
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
	<div class="row">
		<div class="col-xs-12">
			&nbsp;
		</div>
	</div>
  {{#if model.newLambdaInstance.isSaving}}
          <div class="row">
              <div class="col-xs-12">
                  <div class="alert alert-info alert-dismissable">
                      Your request to create a new Lambda Instance is being sent to the server...
                  </div>
              </div><!--col-xs-12-->
          </div><!--row-->
  {{/if}}
  </form>

  {{/if}}
</section><!-- /.content -->