Skip to content

Commit

Permalink
documentation added and examples updates - a little
Browse files Browse the repository at this point in the history
  • Loading branch information
woodsmc committed May 4, 2018
1 parent faf49a9 commit 567b621
Show file tree
Hide file tree
Showing 19 changed files with 661 additions and 32 deletions.
471 changes: 471 additions & 0 deletions Documentation/Creating a Fog of Serverless Functions in 2011.md

Large diffs are not rendered by default.

Binary file added Documentation/function-traversal5.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 Documentation/initialissue.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 Documentation/metadata.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 Documentation/metadata2.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 Documentation/metadata3.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 Documentation/metadata4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 Documentation/sisyphus-example-app-outline.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 Documentation/sisyphus.odg
Binary file not shown.
Binary file added Documentation/tempstoragegateway.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 Documentation/tempstoragewebagg.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: 0 additions & 2 deletions examples/command_line_client/command_line_get_mongodb.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ delay(2000).then(() => {
console.log("there was an error...");
} else {
console.log("the database has returned...");

console.log("-----------------------------------------------------------------------");
console.log("error : " + result.error);
console.log("data : " + JSON.stringify(result.data));
}
process.exit(0);
});
console.log("task sent");

}); // end of delay

68 changes: 68 additions & 0 deletions examples/front_end_web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Example Application Showing PI Temp Values</title>
<link href="http://visjs.org/dist/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body, html {
font-family: sans-serif;
}
</style>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="http://visjs.org/dist/vis.js"></script>
<script>
function PlotPoint(x,y) {
this.x = new Date( x ).toUTCString();
this.y = y;
}

function transform_to_graph_array(data) {
var retval = new Array();
for( const item of data ) {
retval.push ( new PlotPoint(item.time, item.temp));
}
return retval;
}

function refresh_graph() {
$.get( "/latest", function(data){
if ( data.error == null) {
var container = document.getElementById('visualization');
var rawdataset = transform_to_graph_array(data.data)
var dataset = new vis.DataSet(rawdataset);
var options = {
start : rawdataset[0].x,
end: rawdataset[rawdataset.length - 1].x
};
console.log(JSON.stringify(options));
var graph2d = new vis.Graph2d(container, dataset, options);
}else{
console.log("error...");
alert("some error from Sisyphus..");
}
});
}

// onload...
$(function() {
refresh_graph();
});

</script>

</head>
<body>

<div id="controls">
<button>Get Latest Temp</button>
<button onclick="refresh_graph();">Refresh Data</button>
</div>

<div id="grapharea">
<div id="visualization"></div>
</div>

</body>
</html>

18 changes: 18 additions & 0 deletions examples/front_end_web/install_npm_packages_for_web_front_end.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

function print {
echo -e "\e[36m$1\e[0m"
}

print "Install express"
npm install express --save
print "Install socket.io"
npm install socket.io --save
npm install socket.io-client --save
print "Installing Q, for node"
npm install q --save

print "Installing delay, for node"
npm install delay --save


54 changes: 54 additions & 0 deletions examples/front_end_web/run_web_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

###############################################################################
# (c) Copyright 2018 Mind-Flip Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
################################################################################


function print {
echo -e "\e[36m$1\e[0m"
}

function print_green {
echo -e "\e[92m$1\e[0m"
}



function step {
LAST_STEP="$1"
print "$1"
}

function step_done {
print_green "$LAST_STEP finished."
}

function print_title {
print "Running Web Interface to Sisyphus"
print "=================================================="
print "Notes:"
print " * Running 'nodejs' (based on Ubuntu)."
print "Please ensure that the installation steps outlined"
print "in the readme.md file within the 'sis' directory "
print "have been followed. "
}

print_title

nodejs ./web_server.js

47 changes: 47 additions & 0 deletions examples/front_end_web/web_server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@




var express = require('express');
var http = require('http');
var app = express();
var server = http.createServer(app);
var io = require('socket.io').listen(server);
var ioclient = require('socket.io-client');
var path = require('path');

var Q = require('q');
var $sis = require('../../sis/sisyphus').$sis;
var common_functions = require('../command_line_client/common_functions');

console.log("starting as client");
$sis.configureAsClient( {
ServiceType : "EdgeRender",
HostCloud : "AWS-CDN"
}, ["http://192.168.1.6/"], ioclient);


app.get('/', function (req, res) {
res.sendfile(__dirname + '/index.html');
});

app.get('/latest', function(req,res) {
res.setHeader('Content-Type', 'application/json');
common_functions.get_db($sis).then( function(result){
res.send(JSON.stringify(result));
});
});

app.get('/force', function(req, res){
res.setHeader('Content-Type', 'application/json');
common_functions.update_db($sis).then( function(result){
res.send(JSON.stringify(result));
});
});

server.listen(3000);





29 changes: 1 addition & 28 deletions examples/mongodb_gateway/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,7 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
----------------------------------------------------------------------------
(c) Copyright 2013 Intel Performance Learning Solutions Ltd,
Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
In addition to the Apache License, Version 2.0, please note that:
This software is subject to the U.S. Export Administration Regulations
and other U.S. law, and may not be exported or re-exported to certain
countries (Cuba, Iran, North Korea, Sudan, and Syria) or to persons or
entities prohibited from receiving U.S. exports (including Denied Parties,
Specially Designated Nationals, and entities on the Bureau of Export
Administration Entity List or involved with missile technology or nuclear,
chemical or biological weapons).
limitations under the License
**/

var express = require('express');
Expand Down
4 changes: 2 additions & 2 deletions sis/sisyphus.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ $sis = function(){
}

function handleConnectionDisconnectAndInformOthers(metadata) {
//console.log( " handleConnectionDisconnectAndInformOthers" );
//console.log( " handleConnectionDisconnectAndInformOthers" );
//todo: remove hosts associated with this socket / guid from our knownhosts and live connections
removeConnection(metadata);
knownHosts.deleteHost(metadata);
Expand Down Expand Up @@ -888,7 +888,7 @@ $sis = function(){
var str = "";
if ( host.isMe() ) str = " me!";
if ( host.guid == socketsMetaData.guid ) str = " the recently joined dude";
//console.log(host.guid + " is " + str );
console.log(host.guid + " is " + str );
}
});
});
Expand Down

0 comments on commit 567b621

Please sign in to comment.