Skip to content

Commit

Permalink
Merge pull request #420 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored Jun 13, 2023
2 parents 519dd16 + 4da9a2b commit 5d1c6c3
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 13 deletions.
Binary file added app/static/images/eflows4HPCcics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 20 additions & 6 deletions app/templates/modal_vault.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,52 @@
$('#mount_point').prop('disabled', true);
$('#path').prop('disabled', true);
$('#kv_ver').prop('disabled', true);
$('#checkbox').prop('checked', false);
$('#overwrite').prop('checked', false);
$('#egi_vault').prop('disabled', true);
}

function toggleDisable() {
$('#url').prop('disabled', (i, v) => !v);
$('#mount_point').prop('disabled', (i, v) => !v);
$('#path').prop('disabled', (i, v) => !v);
$('#kv_ver').prop('disabled', (i, v) => !v);
$('#egi_vault').prop('disabled', (i, v) => !v);
}

$(document).ready(function () {
$("#overwrite").click(function () {
toggleDisable();
});
});
});

$(document).ready(function () {
$("#egi_vault").click(function () {
$('#url').val("https://vault.services.fedcloud.eu:8200")
$('#mount_point').val("/secrets")
$('#path').val("users/{{ session['userid'] }}/secrets")
$('#kv_ver').val("1")
});
});

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

<div class="row form-group">
<div class="col">
<input type="checkbox" name="overwrite" id="overwrite" value="1"> Use your own Vault instance (disable the default one.).
<input type="checkbox" name="overwrite" id="overwrite" value="1"> Use extenal Vault instance (disable internal one.).<br/>
<span class="small">
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>
</span>
</div>
</div>

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

<div class="row form-group">
<div class="col">
<label for="path"><strong>Path </strong><span class="small">(e.g. {{ session['userid'] }}/secrets)</span></label>
<label for="path"><strong>Path </strong></label>
<input placeholder="Path" name="path" class="form-control" type="text" id="path" value="{{ vinfo[2] if vinfo else '' }}" required/>
</div>
</div>
Expand Down
22 changes: 19 additions & 3 deletions app/templates/portfolio.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ <h5 class="font-weight-bold text-primary">
<div class="card-group">
{% endif %}

<div class="card mb-4" style="width: 20rem; max-height: 25rem;" id="{{tosca_filename}}">
<div class="card mb-3 bg-light-grey rounded card-rounded border-0" id="{{tosca_filename}}">

<div class="card-body">
<h5 class="card-title text-center">
<strong>{% if tosca['metadata']['display_name'] is defined %}{{tosca['metadata']['display_name']}}{% else %}{{tosca_filename}}{% endif %}</strong>
Expand Down Expand Up @@ -90,7 +91,7 @@ <h5>
<p id="toscaDescription" class="card-text tosca-descr"><small>{{tosca['description']}}</small></p>
<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>
{% if parent %}
<a href="#" onclick="AddChild(this, '{{tosca_filename}}')" class="badge badge-pill badge-primary"><span class='fas fa-plus mr-2'></span>Add</a>
<a href="#!" onclick="AddChild(this, '{{tosca_filename}}')" class="badge badge-pill badge-primary"><span class='fas fa-plus mr-2'></span>Add</a>
{% elif 'link' in tosca['metadata'] %}
<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>
{% else %}
Expand Down Expand Up @@ -153,8 +154,23 @@ <h5>

<style>

.card-img-overlay {
border: 0;
border-radius: 1rem !important;
}

.card-rounded {
border-radius: 1rem!important;
width: 20rem;
max-height: 25rem;
}

.bg-light-grey {
background-color:#f2f2f2!important;
}

.selected-addon {
background-color: rgb(9, 139, 179, 0.5);
background-color: rgb(9, 139, 179, 0.5)!important;
}

.wrapper {
Expand Down
31 changes: 31 additions & 0 deletions tosca-templates/image-service.parameters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
inputs:

workflow_registry_git:
tab: Image Creation Data
software_catalog_git:
tab: Image Creation Data
user_name:
tab: Image Creation Data
user_pass:
tab: Image Creation Data
user_mail:
tab: Image Creation Data
registry_url:
tab: Image Creation Data
registry_prefix:
tab: Image Creation Data
registry_user:
tab: Image Creation Data
registry_token:
tab: Image Creation Data
captcha_site_key:
tab: Image Creation Data
captcha_web_site_key:
tab: Image Creation Data
dns_name:
tab: Image Creation Data
enable_https:
tab: Image Creation Data

tabs:
- Image Creation Data
123 changes: 123 additions & 0 deletions tosca-templates/image-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
tosca_definitions_version: tosca_simple_yaml_1_0

imports:
- ec3_custom_types: https://raw.githubusercontent.com/grycap/ec3/tosca/tosca/custom_types.yaml

metadata:
name: eflows4hpc image creation service
display_name: Launch the flows4hpc image creation service on a VM
icon: images/eflows4HPCcics.png
parents:
- simple-node-disk.yaml

description: TOSCA template for launching the eflows4hpc image creation service on a VM

topology_template:

inputs:
workflow_registry_git:
type: string
description: Git repository of the workflow registry
default: "https://github.com/eflows4hpc/workflow-registry.git"
required: yes
software_catalog_git:
type: string
description: Git repository of the software catalog
default: "https://github.com/eflows4hpc/software-catalog.git"
required: yes
user_name:
type: string
description: Create username to access the image creation service
default: "admin"
user_pass:
type: string
description: Create password to access the image creation service
default: "admin"
user_mail:
type: string
description: Create mail to access the image creation service
default: "admin@admin.com"
registry_url:
type: string
description: URL of the container registry
default: "ghcr.io"
required: yes
registry_prefix:
type: string
description: Prefix of the container registry
default: "ghcr.io/eflows4hpc"
required: yes
registry_user:
type: string
description: User to access the container registry
default: ""
required: yes
registry_token:
type: string
description: Token to access the container registry
default: ""
required: yes
captcha_site_key:
type: string
description: Captcha site key
default: ''
required: yes
captcha_web_site_key:
type: string
description: Captcha web site key
default: ''
required: yes
dns_name:
type: string
description: DNS name of the VM public IP
default: ''
enable_https:
type: boolean
description: Flag to enable https (you need to provide a DNS name)
default: false
constraints:
- valid_values: [ false, true ]


node_templates:

image_service:
type: tosca.nodes.ec3.Application
artifacts:
community_crypto:
file: community.crypto
type: tosca.artifacts.AnsibleGalaxy.collection
docker_role:
file: grycap.docker
type: tosca.artifacts.AnsibleGalaxy.role
capabilities:
endpoint:
properties:
ports:
https:
protocol: tcp
source: 443
interfaces:
Standard:
configure:
implementation: https://raw.githubusercontent.com/grycap/ec3/tosca/tosca/artifacts/eflows4hpc/image_creation.yaml
inputs:
HTTPS: { get_input: enable_https }
WORKFLOW_REGISTRY_GIT: { get_input: workflow_registry_git }
SOFTWARE_CATALOG_GIT: { get_input: software_catalog_git }
CAPTCHA_SITE_KEY: { get_input: captcha_site_key }
CAPTCHA_WEB_SITE_KEY: { get_input: captcha_web_site_key }
REGISTRY_USER: { get_input: registry_user }
REGISTRY_TOKEN: { get_input: registry_token }
REGISTRY_URL: { get_input: registry_url}
REGISTRY_PREFIX: { get_input: registry_prefix }
DNS_NAME: { get_input: dns_name }
USER_NAME: { get_input: user_name }
USER_PASS: { get_input: user_pass }
USER_MAIL: { get_input: user_mail }
requirements:
- host: simple_node

outputs:
image_creation_endpoint:
value: { concat: [ 'https://', get_input: [ dns_name ], '/image_creation/' ] }
31 changes: 27 additions & 4 deletions tosca-templates/jupyterhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,32 @@ description: Launch JupyterHub on top of a Kubernetes Virtual Cluster.

metadata:
name: JupyterHub
display_name: Add a set of users
display_name: Launch JupyterHub on top of a Kubernetes Virtual Cluster
icon: images/jupyterhub.png
tag: SW
tag_color: blue
parents:
- kubernetes.yaml

topology_template:

inputs:

auth_class:
type: string
description: Athenticator class
default: dummy
constraints:
- valid_values: [ "dummy", "nativeauthenticator.NativeAuthenticator" ]

dummy_password:
type: string
description: Password used to authenticate in case of using the dummy authenticator
default: not_very_secret_pass

admin_user:
type: string
description: Username of the Administrator user
default: admin

node_templates:

jupyterhub:
Expand All @@ -26,8 +43,14 @@ topology_template:
configure:
implementation: https://raw.githubusercontent.com/grycap/ec3/tosca/tosca/artifacts/jupyter/jupyterhub_k8s.yml
inputs:
jup_auth_class: dummy
authenticator_class: { get_input: [ auth_class ] }
dummy_pass: { get_input: [ dummy_password ] }
admin_user: { get_input: [ admin_user ] }
requirements:
- host: front
- dependency: lrms_front_end

outputs:
jupyterhub_endpoint:
value: { concat: [ 'https://', get_attribute: [ front, public_address, 0 ], '/jupyterhub/' ] }

0 comments on commit 5d1c6c3

Please sign in to comment.