Skip to content

Commit

Permalink
Merge pull request #47 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored Sep 2, 2020
2 parents 11202d2 + ef1affe commit ca3260d
Show file tree
Hide file tree
Showing 16 changed files with 206 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def show_settings():
@app.route('/login')
def login():
session.clear()
return render_template('home.html')
return render_template('home.html', oidc_name=settings.oidcName)

@app.route('/')
def home():
Expand Down Expand Up @@ -168,7 +168,7 @@ def home():
return render_template('portfolio.html', templates=toscaInfo)
else:
flash("Error getting User info: \n" + account_info.text, 'error')
return render_template('home.html')
return render_template('home.html', oidc_name=settings.oidcName)

@app.route('/vminfo/<infid>/<vmid>')
@authorized_with_valid_token
Expand Down
1 change: 1 addition & 0 deletions app/config-sample.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"OIDC_NAME": "OIDC",
"OIDC_CLIENT_ID": "my_client_id",
"OIDC_CLIENT_SECRET": "my_client_secret",
"OIDC_BASE_URL": "https://aai-dev.egi.eu/oidc",
Expand Down
1 change: 1 addition & 0 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self, config):
self.toscaDir = config.get('TOSCA_TEMPLATES_DIR', '') + "/"
self.toscaParamsDir = config.get('TOSCA_PARAMETERS_DIR', '') + "/"
self.imUrl = config['IM_URL']
self.oidcName = config['OIDC_NAME']
self.oidcUrl = config['OIDC_BASE_URL']
self.tempSlamUrl = config.get('SLAM_URL') if config.get('SLAM_URL') else ""
self.imConf = {'im_url': config.get('IM_URL')}
Expand Down
Binary file added app/static/images/galaxy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/galaxy_slurm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/hadoop.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/im-logo-only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/kubernetes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/mesos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/obm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/ophidia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/oscar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/slurm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<body>
<nav class="navbar navbar-dark bg-dark navbar-expand-md sticky-top">
<div class="container-fluid">
<a class="navbar-brand" href="{{ url_for("home") }}">IM Dashboard</a>
<a class="navbar-brand" href="{{ url_for("home") }}"><img src="{{ url_for('static', filename='images/im-logo-only.png') }}" width="40"> IM Dashboard</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#myNavbar">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down
106 changes: 95 additions & 11 deletions app/templates/home.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,112 @@
{% extends "base.html" %}

{% block content %}
<!--style>
.jumbotron{
border: 2px solid black;
padding: 25px;
<style>
hr.style-seven {
overflow: visible; /* For IE */
height: 30px;
border-style: solid;
border-color: darkgrey;
border-width: 1px 0 0 0;
border-radius: 20px;
}
</style-->
hr.style-seven:before { /* Not really supposed to work, but does */
display: block;
content: "";
height: 30px;
margin-top: -31px;
border-style: solid;
border-color: darkgrey;
border-width: 0 0 1px 0;
border-radius: 20px;
}
</style>

<div class = "jumbotron jumbotron-fluid">
<div class="container">
{% include 'flashed_messages.html' %}
<div class="row">
<div class="col-lg-7">
<h1 class="display-3">Welcome!</h1>
<p>This is the Infrastructure Manager Dashboard.</p>
<div class="row p-5 ">
<div class="col-lg-8">
<h1 class="display-4">Infrastructure Manager Dashboard.</p>
<p>
<a class="btn btn-primary btn-lg" role="button" href="{{ url_for("oidc.login") }}">Login with OIDC &raquo;</a>
<a class="btn btn-primary btn-lg" role="button" href="{{ url_for("oidc.login") }}">Login with {{oidc_name}} <i class="fas fa-sign-in-alt"></i></a>
</p>
</div>
<div class="col-lg-5">
<div class="col-lg-4">
<img src="static/images/im-logo.png" width="350px">
</div>
</div>
</div>

<section id="about" class="p-4 bg-dark">
<div class="container text-light">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-lg-6">
<h2 class="section-heading text-center">
Available Topologies
</h2>
<hr class="style-seven"/>
</div>
<div class="col-lg-3"></div>
</div>

<div class="row text-dark">
<div class="col-lg-1"></div>
<div class="col-lg-10">
<ul class="list-group list-group-horizontal mx-auto">
<li class="list-group-item"><a href="https://kubernetes.io/" target="_blank"><img src="{{ url_for('static', filename='images/kubernetes.png') }}" alt="Kubernetes"></a></li>
<li class="list-group-item"><a href="http://mesos.apache.org/" target="_blank"><img src="{{ url_for('static', filename='images/mesos.png') }}" alt="Mesos"></a></li>
<li class="list-group-item"><a href="https://slurm.schedmd.com/" target="_blank"><img src="{{ url_for('static', filename='images/slurm.png') }}" alt="SLURM"></a></li>
</ul>
<ul class="list-group list-group-horizontal mx-auto">
<li class="list-group-item"><a href="https://galaxyproject.org/" target="_blank"><img src="{{ url_for('static', filename='images/galaxy.png') }}" alt="Galaxy"></a></li>
<li class="list-group-item"><a href="http://ophidia.cmcc.it/" target="_blank"><img src="{{ url_for('static', filename='images/ophidia.png') }}" alt="Ophidia"></a></li>
<li class="list-group-item" style="width: 291px; text-align: center; font-size: x-large;"><br/>and more ...</li>
</ul>
</div>
<div class="col-lg-1"></div>
</div>

<div class="row">
<div class="col-lg-3"></div>
<div class="col-lg-6">
<h5 class="text-center">
<br/>
If you need a new topology please contact us
(<a href="mailto:[email protected]?subject=[IM Dashboard]" target="_self"><i class="fa fa-envelope"></i></a>)
</h5>
</div>
<div class="col-lg-3"></div>
</div>

</section>


<!-- About Section -->

<section id="about" class="p-4">
<div class="container">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-lg-6">
<h2 class="section-heading text-center">About</h2>
<hr class="style-seven"/>
<h5 class="text-justify">
The IM Dashboard is designed to enable non advanced users to launch complex virtual infrastructures on top of
<a href="https://www.egi.eu/services/cloud-compute/" target="_blank">EGI Cloud Computing</a> resources.
Only with a few clicks the user can deploy the set of available topologies expressed through templates written
in <a href="http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/csprd02/TOSCA-Simple-Profile-YAML-v1.0-csprd02.html" target="_blank">
TOSCA (Simple Profile in YAML version 1.0)</a>. Then the IM service orchestrates the whole process: deployment of
cloud resources, configuration, software installation, monitoring and update of the virtual infrastructures.
If you want to know how to use it see <a href="https://youtu.be/y2MWG52oI9w" target="_blank">this video</a>. More
information about IM at <a href="https://www.grycap.upv.es/im" target="_blank">IM Webpage</a>
</h5>
</div>
</div>

</div>
</section>

{% endblock %}

106 changes: 106 additions & 0 deletions tosca-templates/hadoop_cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
tosca_definitions_version: tosca_simple_yaml_1_0

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

metadata:
display_name: Launch a Hadoop Virtual Cluster
icon: https://github.com/grycap/im-dashboard/raw/master/app/static/images/hadoop.jpg

description: TOSCA template for launching a Hadoop Cluster.

topology_template:
inputs:
wn_num:
type: integer
description: Number of WNs in the cluster
default: 1
required: yes
fe_cpus:
type: integer
description: Number of CPUs for the front-end node
default: 2
required: yes
constraints:
- valid_values: [ 2, 4, 8, 16, 32, 64 ]
fe_mem:
type: scalar-unit.size
description: Amount of Memory for the front-end node
default: 4 GB
required: yes
constraints:
- valid_values: [ 4 GB, 8 GB, 16 GB, 32 GB, 64 GB, 128 GB, 256 GB, 512 GB ]
wn_cpus:
type: integer
description: Number of CPUs for the WNs
default: 2
required: yes
constraints:
- valid_values: [ 2, 4, 8, 16, 32, 64 ]
wn_mem:
type: scalar-unit.size
description: Amount of Memory for the WNs
default: 4 GB
required: yes
constraints:
- valid_values: [ 4 GB, 8 GB, 16 GB, 32 GB, 64 GB, 128 GB, 256 GB, 512 GB ]


node_templates:

hadoop_master:
type: tosca.nodes.indigo.HadoopMaster
requirements:
- host: hadoop_server

hadoop_server:
type: tosca.nodes.indigo.Compute
capabilities:
endpoint:
properties:
network_name: PUBLIC
ports:
yarn_port:
protocol: tcp
source: 8088
dfs_port:
protocol: tcp
source: 9870
host:
properties:
num_cpus: { get_input: fe_cpus }
mem_size: { get_input: fe_mem }
os:
properties:
type: linux

hadoop_slave:
type: tosca.nodes.indigo.HadoopSlave
properties:
master_ip: { get_attribute: [ hadoop_server, private_address, 0 ] }
requirements:
- host: hadoop_wn

hadoop_wn:
type: tosca.nodes.indigo.Compute
capabilities:
scalable:
properties:
count: { get_input: wn_num }
host:
properties:
num_cpus: { get_input: wn_cpus }
mem_size: { get_input: wn_mem }
os:
properties:
type: linux

outputs:
cluster_ip:
value: { get_attribute: [ hadoop_server, public_address, 0 ] }
cluster_creds:
value: { get_attribute: [ hadoop_server, endpoint, credential, 0 ] }
dfs_url:
value: { concat: [ 'http://', get_attribute: [ hadoop_server, public_address, 0 ], ':9870' ] }
yarn_url:
value: { concat: [ 'http://', get_attribute: [ hadoop_server, public_address, 0 ], ':8088' ] }

0 comments on commit ca3260d

Please sign in to comment.