-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
documentation added and examples updates - a little
- Loading branch information
Showing
19 changed files
with
661 additions
and
32 deletions.
There are no files selected for viewing
471 changes: 471 additions & 0 deletions
471
Documentation/Creating a Fog of Serverless Functions in 2011.md
Large diffs are not rendered by default.
Oops, something went wrong.
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.
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.
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.
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 not shown.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
18
examples/front_end_web/install_npm_packages_for_web_front_end.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters