From: Ciro Scognamiglio Date: Wed, 17 Dec 2014 16:21:33 +0000 (+0100) Subject: Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab X-Git-Tag: myslice-1.1~13^2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=fce3531291a0c584c0ed6c93dcc135469ce3fa9d;hp=a305d1e9e54a9faca2b41164d55faf3bf19e843f;p=unfold.git Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab --- diff --git a/README b/README index b1f201da..3530ed2b 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ This file documents the contents of this module change -Last update 4 sept. 2013 +Last update 4 DEC. 2014 See the devel/ subdir for more devel-oriented doc. diff --git a/manifoldapi/static/js/manifold.js b/manifoldapi/static/js/manifold.js index ca111de7..b25647b7 100644 --- a/manifoldapi/static/js/manifold.js +++ b/manifoldapi/static/js/manifold.js @@ -243,6 +243,7 @@ function QueryStore() { // XXX query.change_action() should become deprecated update_query = query.clone(); update_query.action = 'update'; + update_query.fields = []; update_query.analyzed_query.action = 'update'; update_query.params = {}; update_query_ext = new QueryExt(update_query); @@ -1091,7 +1092,11 @@ var manifold = { // Has it a domain query, and has it completed ? $.each(records, function(i, record) { var key = manifold.metadata.get_key(query.object); - var record_key = manifold.record_get_value(record, key); + if ( typeof record === "string" ){ + var record_key = record; + }else{ + var record_key = manifold.record_get_value(record, key); + } manifold.query_store.set_record_state(query.query_uuid, record_key, STATE_SET, STATE_SET_IN); }); @@ -1363,8 +1368,9 @@ case TYPE_LIST_OF_VALUES: case TYPE_LIST_OF_VALUES: // XXX Until fixed case TYPE_LIST_OF_RECORDS: var key, new_state, cur_query_uuid; - - cur_query_uuid = query.analyzed_query.subqueries[field].query_uuid; + if($.inArray(field,Object.keys(query.analyzed_query.subqueries)) > -1){ + cur_query_uuid = query.analyzed_query.subqueries[field].query_uuid; + } // example: slice.resource // - update_query_orig.params.resource = resources in slice before update @@ -1449,6 +1455,8 @@ case TYPE_LIST_OF_VALUES: var query_ext = manifold.query_store.find_query_ext(query.query_uuid); query_ext.query_state = QUERY_STATE_DONE; + var tmp_query = manifold.query_store.find_analyzed_query(query.query_uuid); + manifold.publish_result_rec(tmp_query, records); // Send DONE message to plugins query.iter_subqueries(function(sq, data, parent_query) { @@ -1884,6 +1892,7 @@ case TYPE_LIST_OF_VALUES: break; case RUN_UPDATE: + query_ext.main_query_ext.update_query_ext.query.fields = []; manifold.run_query(query_ext.main_query_ext.update_query_ext.query); break; diff --git a/myslice/settings.py b/myslice/settings.py index fe71e108..bd1474bd 100644 --- a/myslice/settings.py +++ b/myslice/settings.py @@ -2,6 +2,9 @@ import os.path +import djcelery +djcelery.setup_loader() + ### detect if we're in a build environment try: import manifold @@ -233,6 +236,9 @@ INSTALLED_APPS = [ 'south', # Uncomment the next line to enable the admin: 'django.contrib.admin', + # FORGE Plugin app + 'djcelery', + 'forge', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'portal', @@ -242,6 +248,8 @@ INSTALLED_APPS = [ # this app won't load in a build environment if not building: INSTALLED_APPS.append ('rest') +BROKER_URL = "amqp://myslice:myslice@localhost:5672/myslice" + for aux in auxiliaries: if os.path.isdir(os.path.join(ROOT,aux)): print "Using devel auxiliary",aux diff --git a/myslice/urls.py b/myslice/urls.py index af9a8007..5f4c7d4f 100644 --- a/myslice/urls.py +++ b/myslice/urls.py @@ -44,6 +44,8 @@ import portal.slicetabmeasurements import portal.managementtababout import portal.managementtabrequests +import forge.views + #### high level choices # main entry point (set to the / URL) # beware that if this view is broken you end up in an endless cycle... @@ -107,6 +109,7 @@ urls = [ (r'^testbeds/(?P[^/]+)/?$', portal.slicetabtestbeds.SliceTabTestbeds.as_view()), (r'^measurements/(?P[^/]+)/?$', portal.slicetabmeasurements.SliceTabMeasurements.as_view()), (r'^experiment/(?P[^/]+)/?$', portal.slicetabexperiment.ExperimentView.as_view()), + (r'^studentslabs/(?P[^/]+)/?$', forge.views.CreateCourseViev.as_view()), url(r'^about/?$', AboutView.as_view(), name='about'), diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index 3c1aab2a..8d931d59 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -158,8 +158,13 @@ QUERYTABLE_BGCOLOR_REMOVED = 2; }); /* Processing hidden_columns */ + arr = []; + arr = $.map(Object.keys(QUERYTABLE_MAP), function(x, i) { return QUERYTABLE_MAP[x]; }); $.each(this.options.hidden_columns, function(i, field) { - self.hide_column(field); + is_inarray = $.inArray(field,arr); + if(is_inarray==-1){ + self.hide_column(field); + } }); $(".dataTables_filter").append("
"); $(".dataTables_filter input").css("width","100%"); @@ -182,7 +187,6 @@ QUERYTABLE_BGCOLOR_REMOVED = 2; }; - console.log(network_hrn); //Greece: 37.6687092,22.2282404 if (network_hrn == 'omf.nitos') { var logo = 'nitos'; diff --git a/portal/sliceresourceview.py b/portal/sliceresourceview.py index 75ede2a7..85bd368a 100644 --- a/portal/sliceresourceview.py +++ b/portal/sliceresourceview.py @@ -59,41 +59,54 @@ class SliceResourceView (LoginRequiredView, ThemeView): user_md = metadata.details_by_object('user') user_fields = ['user_hrn'] # [column['name'] for column in user_md['column']] + query_resource_all = Query.get('resource').select(resource_fields) + page.enqueue_query(query_resource_all) + + # leases query + #lease_md = metadata.details_by_object('lease') + #lease_fields = [column['name'] for column in lease_md['column']] + + #query_lease_all = Query.get('lease').select(lease_fields) + #page.enqueue_query(query_lease_all) + + slice_md = metadata.details_by_object('slice') + slice_fields = [column['name'] for column in slice_md['column']] + print "SLICE RES VIEW fields = %s" % slice_fields # TODO The query to run is embedded in the URL # Example: select slice_hrn, resource.urn, lease.resource, lease.start_time, lease.end_time from slice where slice_hrn == "ple.upmc.myslicedemo" main_query = Query.get('slice').filter_by('slice_hrn', '=', slicename) - main_query.select( - # SLICE - 'slice_hrn', - # - The record key is needed otherwise the storage of records - # bugs ! - 'slice_urn', - # RESOURCES - 'resource', - 'lease', - 'resource.urn', - 'resource.hostname', 'resource.type', - # - The facility_name and testbed_name are required for the - # testbeds plugin to properly work. - 'resource.facility_name', - 'resource.testbed_name', - # LEASES - 'lease.resource', - 'lease.start_time', - 'lease.end_time', - # - The lease_id is important for NITOS identify already existing - # leases - 'lease.lease_id', - - # FLOWSPACE - #'flowspace', - # VMS - #'vms', - - - #'user.user_hrn', - #'application.measurement_point.counter' - ) + main_query.select(slice_fields) + # # SLICE + # 'slice_hrn', + # # - The record key is needed otherwise the storage of records + # # bugs ! + # 'slice_urn', + # # RESOURCES + # 'resource', + # 'lease', + # 'resource.urn', + # 'resource.hostname', 'resource.type', + # # - The facility_name and testbed_name are required for the + # # testbeds plugin to properly work. + # 'resource.facility_name', + # 'resource.testbed_name', + # # LEASES + # 'lease.resource', + # 'lease.start_time', + # 'lease.end_time', + # # - The lease_id is important for NITOS identify already existing + # # leases + # 'lease.lease_id', + + # # FLOWSPACE + # #'flowspace', + # # VMS + # #'vms', + + + # #'user.user_hrn', + # #'application.measurement_point.counter' + #) # for internal use in the querytable plugin; # needs to be a unique column present for each returned record main_query_init_key = 'urn' @@ -104,16 +117,6 @@ class SliceResourceView (LoginRequiredView, ThemeView): #sq_flowspace = aq.subquery('flowspace') #sq_vms = aq.subquery('vms') - query_resource_all = Query.get('resource').select(resource_fields) - page.enqueue_query(query_resource_all) - - # leases query - #lease_md = metadata.details_by_object('lease') - #lease_fields = [column['name'] for column in lease_md['column']] - - #query_lease_all = Query.get('lease').select(lease_fields) - #page.enqueue_query(query_lease_all) - # -------------------------------------------------------------------------- # ALL RESOURCES LIST # resources as a list using datatable plugin diff --git a/portal/static/img/fed4fire_favicon.ico b/portal/static/img/fed4fire_favicon.ico new file mode 100644 index 00000000..c2d91a00 Binary files /dev/null and b/portal/static/img/fed4fire_favicon.ico differ diff --git a/portal/static/img/myslice_favicon.ico b/portal/static/img/myslice_favicon.ico new file mode 100644 index 00000000..08b8cd4b Binary files /dev/null and b/portal/static/img/myslice_favicon.ico differ diff --git a/portal/static/img/onelab_favicon.ico b/portal/static/img/onelab_favicon.ico new file mode 100644 index 00000000..a2754aa1 Binary files /dev/null and b/portal/static/img/onelab_favicon.ico differ diff --git a/portal/templates/base.html b/portal/templates/base.html index df8fd9c1..9bc52dd1 100644 --- a/portal/templates/base.html +++ b/portal/templates/base.html @@ -74,22 +74,17 @@ $(document).ready(function() { Launch queries to get the resources and leases in Manifold Cache */ - $.post("/rest/resource/", function( data ) { - }); - $.post("/rest/lease/", function( data ) { - }); - - function drawSlices(slices){ var items = []; $.each( slices, function(i, val) { items.push( "
  • " + val + "
  • " ); /* - Launch a Query for each slice to get resources and leases in Manifold Cache - */ + // Launch a Query for each slice to get resources and leases in Manifold Cache + // Now only done in Homeview to speed up the other pages $.post("/rest/slice/", { 'filters': { 'slice_hrn' : val } }, function(data) { }); + */ }); $("div#home-slice-list").html($( "
      ", { html: items.join( "" ) })); $("ul#dropdown-slice-list").append(items.join( "" )); diff --git a/portal/templates/fed4fire/fed4fire_home-view.html b/portal/templates/fed4fire/fed4fire_home-view.html index 98a7982b..fed82dc1 100644 --- a/portal/templates/fed4fire/fed4fire_home-view.html +++ b/portal/templates/fed4fire/fed4fire_home-view.html @@ -82,9 +82,9 @@

      Experiment now

      + onclick="return launchApplication('http://jfed.iminds.be/releases/5.4-dev/r2289/webstart/experimenter/jfed-experimenter.jnlp');"> jFed
      @@ -287,9 +287,7 @@ // myslice.user is in LocalStorage if(myslice.user.slices.length>0){ $.each( myslice.user.slices, function(i, val) { - /* - Launch a Query for each slice to get resources and leases in Manifold Cache - */ + // Launch a Query for each slice to get resources and leases in Manifold Cache $.post("/rest/slice/", { 'filters': { 'slice_hrn' : val } }, function(data) { }); }); diff --git a/portal/templates/fed4fire/fed4fire_slice-tab-experiment.html b/portal/templates/fed4fire/fed4fire_slice-tab-experiment.html new file mode 100644 index 00000000..0ca237fd --- /dev/null +++ b/portal/templates/fed4fire/fed4fire_slice-tab-experiment.html @@ -0,0 +1,111 @@ +
      +
      +
      +

      How to access your slice

      +

      PlanetLab Europe

      + +

      + PlanetLab Europe resources are accessible directly via SSH. Your SSH public key is deployed automatically + on the reserved nodes. To access your slice on a resource just type the following command: +

      + {%if ple_resources%} +

      + {%for resource in ple_resources %} + $ ssh {{ple_slicename}}@{{resource}}
      + {%endfor%} +

      +

      Windows users

      +

      Use SSH client.

      + + {%else%} +

      NOTE: You did not reserve any PLE resources yet. Once reserved, you will get the actual SSH command. A specimen command is given below:

      +

      + $ ssh {{ple_slicename}}@planetlab-resource.hostname.com
      +

      +

      Windows users

      +

      Use SSH client.

      + + {%endif%} +

      NOTE: Your original slicename {{slicename}} has been converted to PlanetLab specific format {{ple_slicename}} in order to do SSH.

      +

      Please note that the first '.' is replaced by number 8 and the rest of the dot/s are replaced by underscore/s.

      +

      + Be aware that after you reserve a PlanetLab Europe resource your slice will be deployed with a delay of about 15 minutes, + after witch you will be able to access the resource. +

      + +

      NITOS

      + +

      + NITOS resources are not directly accessible. You will need to log in on a gateway server and from there access the node. + The NITOS server address is nitlab.inf.uth.gr, so to connect to the NITOS server: +

      +

      + $ ssh {{slicename}}@nitlab.inf.uth.gr +

      +

      Windows users

      +

      Use SSH client.

      + +

      + +

      + +

      + You will then need to prepare the resource by loading an OMF image on it: +

      + +

      + $ omf load -i baseline_grid.ndz -t omf.nitos.node016 +

      + +

      + Turn on the node: +

      + +

      + $ omf tell -a on -t omf.nitos.node016 +

      +

      + And finally ssh on the node: +

      +

      + $ ssh root@node016 +

      +

      + On the node itself you will have to modify the file /etc/omf-resctl-5.3/omf-resctl.yaml according to your slice settings and then + restart the OMF Resource Controller and finally execute the experiment: +

      +

      + $ omf exec --slice slice_name your_exp.rb +

      +

      + The complete tutorial is available at the following address: + NITOS basic tutorial +

      + +
      + +

      Available Tools

      +

      SSH

      +

      + Secure Shell (SSH) is a cryptographic network protocol for secure data communication, remote command-line login, remote command execution, and other secure network services between two networked computers that connects, via a secure channel over an insecure network, a server and a client (running SSH server and SSH client programs, respectively). The protocol specification distinguishes between two major versions that are referred to as SSH-1 and SSH-2. +

      +

      More Info: http://en.wikipedia.org/wiki/Secure_Shell

      +
      +
      +

      +

      NEPI, the Network Experimentation Programming Interface, is a life-cycle management tool for network experiments. The idea behind NEPI is to provide a single tool to design, deploy, and control network experiments, and gather the experiment results. Going further, NEPI was specially conceived to function with arbitrary experimentation platforms, so researchers could use a single tool to work with network simulators, emulators, or physical testbeds, or even a mixture of them. To accomplish this, NEPI provides a high-level interface to describe experiments that is independent from any experimentation platform, but is able to capture platform specific configurations. Experiment definitions can be stored in XML format to be later reproduced, and modified according to experimentation needs. Experiment execution is orchestrated by a global experiment controller, that is platform independent, and different platform-dependent testbed controllers, creating a control hierarchy that is able t adapt to platform specific requirements while providing an integrated control scheme.

      +

      More Info: http://nepi.inria.fr

      +
      +

      +

      OMF is a Testbed Control, Measurement and Management Framework.

      +

      + OMF was originally developed for the ORBIT wireless testbed at Winlab, Rutgers University. Since 2007, OMF has been actively extended to operate on testbeds with many different type of network and resource technologies. It is now deployed and used on different testbeds in Australia, Europe, and in the U.S. OMF is currently being extended further to support exciting new features and technologies. This website is hosting this ongoing activity. OMF development is now conducted essentially within the TEMPO project at NICTA (Australia) in strong collaboration with Winlab (Rutgers University). +

      +

      In addition to the main OMF software, this site also hosts OMF sub-projects addressing various related aspects of a testbed's control, measurement, and management.

      +

      More Info: http://mytestbed.net/projects/omf

      +
      +
      +
      diff --git a/portal/templates/onelab/onelab_base.html b/portal/templates/onelab/onelab_base.html deleted file mode 100644 index fdab3522..00000000 --- a/portal/templates/onelab/onelab_base.html +++ /dev/null @@ -1,49 +0,0 @@ -{# This is required by insert_above #}{% insert_handler %} - -OneLab - {{ section }} - - -{# This is where insert_str will end up #}{% media_container prelude %} -{% include 'messages-transient-header.html' %} - - - - - - -{{ header_prelude }} -{% block head %} {% endblock head %} -{# let's add these ones no matter what #} -{% insert_str prelude "js/jquery.min.js" %} -{% insert_str prelude "js/angular/angular.min.js" %} -{% insert_str prelude "js/jquery.html5storage.min.js" %} -{% insert_str prelude "js/messages-runtime.js" %} -{% insert_str prelude "js/class.js" %} -{% insert_str prelude "js/plugin-helper.js" %} -{% insert_str prelude "js/mustache.js" %} -{% insert_str prelude "js/hashtable.js" %} -{% insert_str prelude "js/plugin.js" %} -{% insert_str prelude "js/manifold.js" %} -{% insert_str prelude "css/manifold.css" %} -{% insert_str prelude "css/plugin.css" %} -{% insert_str prelude "js/bootstrap.js" %} -{% insert_str prelude "css/bootstrap.css" %} -{% insert_str prelude "js/bootstrap-datepicker.js" %} -{% insert_str prelude "css/datepicker.css" %} -{% insert_str prelude "js/bootstrap-slider.js" %} -{% insert_str prelude "css/slider.css" %} -{% insert_str prelude "css/topmenu.css" %} -{% insert_str prelude "js/logout.js" %} - - - -{% block container %} - {% block topmenu %} - {% include theme|add:"__widget-topmenu.html" %} - {% endblock topmenu %} - {% include 'messages-transient.html' %} - {% block base_content %} - {% endblock %} -{% endblock container %} - - diff --git a/portal/templates/onelab/onelab_slice-view.html b/portal/templates/onelab/onelab_slice-view.html index c2d52c35..c8b6b440 100644 --- a/portal/templates/onelab/onelab_slice-view.html +++ b/portal/templates/onelab/onelab_slice-view.html @@ -14,5 +14,6 @@
      ...
      +
      {% endblock %} diff --git a/portal/templates/onelab/onelab_widget-slice-sections.html b/portal/templates/onelab/onelab_widget-slice-sections.html index 40761b55..e03a53c1 100644 --- a/portal/templates/onelab/onelab_widget-slice-sections.html +++ b/portal/templates/onelab/onelab_widget-slice-sections.html @@ -20,6 +20,7 @@
    • Tools
    • +
    {% else %}