[kepler-users] Kepler: Create and host web services
Elizabeth Ann Latronico
beth at berkeley.edu
Sat Jan 18 07:59:22 PST 2014
Hello all,
I'm working for Edward Lee on composable web services in Ptolemy for the
TerraSwarm project. We've integrated a web server so a Ptolemy model can
be a web service, receiving HTTP requests and returning responses.
The web server works in Kepler too, and could support interesting use
cases! I've attached a sample model based on the predator-prey demo. It
requires the ptolemy ptango package; notes below. Hosting web services is
a complement to Kepler actors that invoke outside web services (such as the
RESTService actor).
Running this model will launch a web service accessible at:
http://localhost:8078/predatorprey
Users can enter parameters and submit a POST request to the model, which
will execute and respond with new graph data.
We're looking into options for making services accessible to the outside
world. We have a web server, ptango.eecs.berkeley.edu, but generally don't
leave models continuously running since the model input isn't currently
screened for malicious items.
Within TerraSwarm, we're also integrating other tools, such as Sensor
Andrew data feeds, EnergyPlus, and the TuLiP controller synthesis project.
For more info, there's a Ptolemy miniconference presentation and
documentation in the latest Ptolemy book.
http://chess.eecs.berkeley.edu/pubs/1027.html
http://ptolemy.eecs.berkeley.edu/books/Systems/
Please let me know if you have any questions! Looking forward to hearing
about lots of neat ideas for web services :)
Best,
Beth
Execution instructions:
The web server is part of the ptolemy ptango package. The source code is
part of the ptolemy repository, which is included with the Kepler
development source code.
The ptango package is excluded from the Kepler build by default. To
include it, please make the following changes:
- In /kepler/build-area/settings/ptolemy-excludes, REMOVE
/org/ptolemy/ptango/**
- In /kepler/build-area/settings/ptolemy-includes, ADD
/org/ptolemy/ptango/**
- In /kepler/build-area/resources/idea/PtolemyModuleStart, REMOVE
<excludeFolder
url="file://$MODULE_DIR$/src/org/ptolemy/ptango" />
Then, build Kepler using instructions here:
https://kepler-project.org/developers/teams/build/documentation/build-system-instructions
The predatorprey.xml model references some additional files (included in
attachment) and needs to know the locations of the files on your machine.
Please open the model and edit the parameters specified in the comments.
Then, run the model, open a browser, and navigate to:
http://localhost:8078/predatorprey
Note there's a possibility the model will not converge for a particular
input combination (the model looks for a return to the initial conditions),
so please try some different inputs in this case.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20140118/5c2d0652/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: predatorprey.zip
Type: application/zip
Size: 82372 bytes
Desc: not available
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20140118/5c2d0652/attachment-0001.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: predatorpreyscreenshot.png
Type: image/png
Size: 33309 bytes
Desc: not available
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20140118/5c2d0652/attachment-0001.png>
More information about the Kepler-users
mailing list