Skip to content

Commit 5d1c6c3

Browse files
authored
Merge pull request #420 from grycap/devel
Devel
2 parents 519dd16 + 4da9a2b commit 5d1c6c3

6 files changed

Lines changed: 220 additions & 13 deletions

File tree

9.37 KB
Loading

app/templates/modal_vault.html

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,52 @@
55
$('#mount_point').prop('disabled', true);
66
$('#path').prop('disabled', true);
77
$('#kv_ver').prop('disabled', true);
8-
$('#checkbox').prop('checked', false);
8+
$('#overwrite').prop('checked', false);
9+
$('#egi_vault').prop('disabled', true);
910
}
1011

1112
function toggleDisable() {
1213
$('#url').prop('disabled', (i, v) => !v);
1314
$('#mount_point').prop('disabled', (i, v) => !v);
1415
$('#path').prop('disabled', (i, v) => !v);
1516
$('#kv_ver').prop('disabled', (i, v) => !v);
17+
$('#egi_vault').prop('disabled', (i, v) => !v);
1618
}
1719

1820
$(document).ready(function () {
1921
$("#overwrite").click(function () {
2022
toggleDisable();
2123
});
22-
});
24+
});
25+
26+
$(document).ready(function () {
27+
$("#egi_vault").click(function () {
28+
$('#url').val("https://vault.services.fedcloud.eu:8200")
29+
$('#mount_point').val("/secrets")
30+
$('#path').val("users/{{ session['userid'] }}/secrets")
31+
$('#kv_ver').val("1")
32+
});
33+
});
2334

2435
</script>
2536
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
2637

2738
<div class="row form-group">
2839
<div class="col">
29-
<input type="checkbox" name="overwrite" id="overwrite" value="1"> Use your own Vault instance (disable the default one.).
40+
<input type="checkbox" name="overwrite" id="overwrite" value="1"> Use extenal Vault instance (disable internal one.).<br/>
41+
<span class="small">
42+
Set <a href="https://vault.services.fedcloud.eu:8200/" target="_blank">Fedcloud Secret management service</a> values. <button type="button" class="btn btn-info btn-sm" id="egi_vault" role="button" href="#"><span class="fas fa-gears"></span></button>
43+
</span>
3044
</div>
3145
</div>
3246

3347
<div class="row form-group">
3448
<div class="col col-6">
35-
<label for="url"><strong>URL </strong><span class="small">(e.g. https://vault.services.fedcloud.eu:8200)</span></label>
49+
<label for="url"><strong>URL </strong></label>
3650
<input placeholder="URL" name="url" class="form-control" type="text" id="url" value="{{ vinfo[0] if vinfo else '' }}" required/>
3751
</div>
3852
<div class="col col-4">
39-
<label for="mount_point"><strong>Mount point </strong><span class="small">(e.g. /secrets)</span></label>
53+
<label for="mount_point"><strong>Mount point </strong></label>
4054
<input placeholder="Mount point" name="mount_point" class="form-control" type="text" id="mount_point" value="{{ vinfo[1] if vinfo else '' }}" required/>
4155
</div>
4256
<div class="col col-2">
@@ -50,7 +64,7 @@
5064

5165
<div class="row form-group">
5266
<div class="col">
53-
<label for="path"><strong>Path </strong><span class="small">(e.g. {{ session['userid'] }}/secrets)</span></label>
67+
<label for="path"><strong>Path </strong></label>
5468
<input placeholder="Path" name="path" class="form-control" type="text" id="path" value="{{ vinfo[2] if vinfo else '' }}" required/>
5569
</div>
5670
</div>

app/templates/portfolio.html

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ <h5 class="font-weight-bold text-primary">
6161
<div class="card-group">
6262
{% endif %}
6363

64-
<div class="card mb-4" style="width: 20rem; max-height: 25rem;" id="{{tosca_filename}}">
64+
<div class="card mb-3 bg-light-grey rounded card-rounded border-0" id="{{tosca_filename}}">
65+
6566
<div class="card-body">
6667
<h5 class="card-title text-center">
6768
<strong>{% if tosca['metadata']['display_name'] is defined %}{{tosca['metadata']['display_name']}}{% else %}{{tosca_filename}}{% endif %}</strong>
@@ -90,7 +91,7 @@ <h5>
9091
<p id="toscaDescription" class="card-text tosca-descr"><small>{{tosca['description']}}</small></p>
9192
<a selector="toscaDescription" class="text-left badge badge-pill badge-info read_more" tabindex="0" data-bs-toggle="popover" title="Full description" data-trigger="focus" data-content="{{tosca['description']}}">Read More</a>
9293
{% if parent %}
93-
<a href="#" onclick="AddChild(this, '{{tosca_filename}}')" class="badge badge-pill badge-primary"><span class='fas fa-plus mr-2'></span>Add</a>
94+
<a href="#!" onclick="AddChild(this, '{{tosca_filename}}')" class="badge badge-pill badge-primary"><span class='fas fa-plus mr-2'></span>Add</a>
9495
{% elif 'link' in tosca['metadata'] %}
9596
<a href="{{ url_for('configure', selected_tosca=tosca['metadata']['link']['parent'], childs=tosca['metadata']['link']['childs']|join(',')) }}" class="badge badge-pill badge-primary">Configure</a>
9697
{% else %}
@@ -153,8 +154,23 @@ <h5>
153154

154155
<style>
155156

157+
.card-img-overlay {
158+
border: 0;
159+
border-radius: 1rem !important;
160+
}
161+
162+
.card-rounded {
163+
border-radius: 1rem!important;
164+
width: 20rem;
165+
max-height: 25rem;
166+
}
167+
168+
.bg-light-grey {
169+
background-color:#f2f2f2!important;
170+
}
171+
156172
.selected-addon {
157-
background-color: rgb(9, 139, 179, 0.5);
173+
background-color: rgb(9, 139, 179, 0.5)!important;
158174
}
159175

160176
.wrapper {
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
inputs:
2+
3+
workflow_registry_git:
4+
tab: Image Creation Data
5+
software_catalog_git:
6+
tab: Image Creation Data
7+
user_name:
8+
tab: Image Creation Data
9+
user_pass:
10+
tab: Image Creation Data
11+
user_mail:
12+
tab: Image Creation Data
13+
registry_url:
14+
tab: Image Creation Data
15+
registry_prefix:
16+
tab: Image Creation Data
17+
registry_user:
18+
tab: Image Creation Data
19+
registry_token:
20+
tab: Image Creation Data
21+
captcha_site_key:
22+
tab: Image Creation Data
23+
captcha_web_site_key:
24+
tab: Image Creation Data
25+
dns_name:
26+
tab: Image Creation Data
27+
enable_https:
28+
tab: Image Creation Data
29+
30+
tabs:
31+
- Image Creation Data

tosca-templates/image-service.yaml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
tosca_definitions_version: tosca_simple_yaml_1_0
2+
3+
imports:
4+
- ec3_custom_types: https://raw.githubusercontent.com/grycap/ec3/tosca/tosca/custom_types.yaml
5+
6+
metadata:
7+
name: eflows4hpc image creation service
8+
display_name: Launch the flows4hpc image creation service on a VM
9+
icon: images/eflows4HPCcics.png
10+
parents:
11+
- simple-node-disk.yaml
12+
13+
description: TOSCA template for launching the eflows4hpc image creation service on a VM
14+
15+
topology_template:
16+
17+
inputs:
18+
workflow_registry_git:
19+
type: string
20+
description: Git repository of the workflow registry
21+
default: "https://github.com/eflows4hpc/workflow-registry.git"
22+
required: yes
23+
software_catalog_git:
24+
type: string
25+
description: Git repository of the software catalog
26+
default: "https://github.com/eflows4hpc/software-catalog.git"
27+
required: yes
28+
user_name:
29+
type: string
30+
description: Create username to access the image creation service
31+
default: "admin"
32+
user_pass:
33+
type: string
34+
description: Create password to access the image creation service
35+
default: "admin"
36+
user_mail:
37+
type: string
38+
description: Create mail to access the image creation service
39+
default: "admin@admin.com"
40+
registry_url:
41+
type: string
42+
description: URL of the container registry
43+
default: "ghcr.io"
44+
required: yes
45+
registry_prefix:
46+
type: string
47+
description: Prefix of the container registry
48+
default: "ghcr.io/eflows4hpc"
49+
required: yes
50+
registry_user:
51+
type: string
52+
description: User to access the container registry
53+
default: ""
54+
required: yes
55+
registry_token:
56+
type: string
57+
description: Token to access the container registry
58+
default: ""
59+
required: yes
60+
captcha_site_key:
61+
type: string
62+
description: Captcha site key
63+
default: ''
64+
required: yes
65+
captcha_web_site_key:
66+
type: string
67+
description: Captcha web site key
68+
default: ''
69+
required: yes
70+
dns_name:
71+
type: string
72+
description: DNS name of the VM public IP
73+
default: ''
74+
enable_https:
75+
type: boolean
76+
description: Flag to enable https (you need to provide a DNS name)
77+
default: false
78+
constraints:
79+
- valid_values: [ false, true ]
80+
81+
82+
node_templates:
83+
84+
image_service:
85+
type: tosca.nodes.ec3.Application
86+
artifacts:
87+
community_crypto:
88+
file: community.crypto
89+
type: tosca.artifacts.AnsibleGalaxy.collection
90+
docker_role:
91+
file: grycap.docker
92+
type: tosca.artifacts.AnsibleGalaxy.role
93+
capabilities:
94+
endpoint:
95+
properties:
96+
ports:
97+
https:
98+
protocol: tcp
99+
source: 443
100+
interfaces:
101+
Standard:
102+
configure:
103+
implementation: https://raw.githubusercontent.com/grycap/ec3/tosca/tosca/artifacts/eflows4hpc/image_creation.yaml
104+
inputs:
105+
HTTPS: { get_input: enable_https }
106+
WORKFLOW_REGISTRY_GIT: { get_input: workflow_registry_git }
107+
SOFTWARE_CATALOG_GIT: { get_input: software_catalog_git }
108+
CAPTCHA_SITE_KEY: { get_input: captcha_site_key }
109+
CAPTCHA_WEB_SITE_KEY: { get_input: captcha_web_site_key }
110+
REGISTRY_USER: { get_input: registry_user }
111+
REGISTRY_TOKEN: { get_input: registry_token }
112+
REGISTRY_URL: { get_input: registry_url}
113+
REGISTRY_PREFIX: { get_input: registry_prefix }
114+
DNS_NAME: { get_input: dns_name }
115+
USER_NAME: { get_input: user_name }
116+
USER_PASS: { get_input: user_pass }
117+
USER_MAIL: { get_input: user_mail }
118+
requirements:
119+
- host: simple_node
120+
121+
outputs:
122+
image_creation_endpoint:
123+
value: { concat: [ 'https://', get_input: [ dns_name ], '/image_creation/' ] }

tosca-templates/jupyterhub.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,32 @@ description: Launch JupyterHub on top of a Kubernetes Virtual Cluster.
88

99
metadata:
1010
name: JupyterHub
11-
display_name: Add a set of users
11+
display_name: Launch JupyterHub on top of a Kubernetes Virtual Cluster
1212
icon: images/jupyterhub.png
13-
tag: SW
14-
tag_color: blue
1513
parents:
1614
- kubernetes.yaml
1715

1816
topology_template:
1917

18+
inputs:
19+
20+
auth_class:
21+
type: string
22+
description: Athenticator class
23+
default: dummy
24+
constraints:
25+
- valid_values: [ "dummy", "nativeauthenticator.NativeAuthenticator" ]
26+
27+
dummy_password:
28+
type: string
29+
description: Password used to authenticate in case of using the dummy authenticator
30+
default: not_very_secret_pass
31+
32+
admin_user:
33+
type: string
34+
description: Username of the Administrator user
35+
default: admin
36+
2037
node_templates:
2138

2239
jupyterhub:
@@ -26,8 +43,14 @@ topology_template:
2643
configure:
2744
implementation: https://raw.githubusercontent.com/grycap/ec3/tosca/tosca/artifacts/jupyter/jupyterhub_k8s.yml
2845
inputs:
29-
jup_auth_class: dummy
46+
authenticator_class: { get_input: [ auth_class ] }
47+
dummy_pass: { get_input: [ dummy_password ] }
48+
admin_user: { get_input: [ admin_user ] }
3049
requirements:
3150
- host: front
3251
- dependency: lrms_front_end
3352

53+
outputs:
54+
jupyterhub_endpoint:
55+
value: { concat: [ 'https://', get_attribute: [ front, public_address, 0 ], '/jupyterhub/' ] }
56+

0 commit comments

Comments
 (0)