cxbrooks / test

Second test for bugzilla to git
0 stars 0 forks source link

Run a model in server mode #254

Open cxbrooks opened 12 years ago

cxbrooks commented 12 years ago

Note: the issue was created automatically with bugzilla2github tool

Original bug ID: BZ#456 From: Elizabeth Latronico <beth@berkeley.edu> Reported version: 8.1.devel

Blocker for: BZ#455

cxbrooks commented 12 years ago

Create the ability to run a Ptolemy model as a web service on a web server. Leverage ptserver code from CMU students (who used MQTT protocol) where appropriate.

cxbrooks commented 12 years ago

Information about Ptolemy II and sandboxes may be found at http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest/ptII/doc/sandbox.htm

Graphical models to be run on a server need to have a graphical display. Locally, we use the X11 Virtual Frame Buffer on hudson.eecs to provide a virtual display. The commands to start Xvfb and set DISPLAY are:

Xvfb :5 -screen 0 1024x768x2 & export DISPLAY=localhost:5.0

The nightly build runs code that exports the seating chart of the DOP Center each night.

  1. Hudson runs each night on sisyphus
  2. Hudson has a configuration step that runs cd $PTII/adm/gen-9.0; make hudson
  3. The hudson rule in the makefile has a dependency on updateDOPCenterImage
  4. The updateDOPCenterImage rule runs $PTII/adm/gen-9.0/updateDOPCenterImageX11
  5. updateDOPCenterImageX11 is a script that starts up X11, invokes $PTII/ptolemy/domains/space/demo/DOPCenter/updateDOPCenterImage and stops X11. updateDOPCenterImageX11 would be a good place to add other scripts to run other models. We could have cronjob that runs updateDOPCenterImageX11 more often
  6. $PTII/ptolemy/domains/space/demo/DOPCenter/updateDOPCenterImage invokes ExportModel and compares the result against the previous result. If the result is different, then the change is committed.

Note that the ptII tree gets copied over to http://chess.eecs.berkeley.edu/ptexternal/src/ptII/ on a nightly basis.

Do do updates to the chess site more often would require having the script that runs the model use scp. For example, to update $PTII/doc/coding/addinganactor.htm, which appears as http://chess.eecs.berkeley.edu/ptexternal/src/ptII/doc/coding/addinganactor.htm the following command would be run as hudson on sisyphus:

scp -Bprq /var/lib/hudson/jobs/ptII/workspace/doc/coding/addinganactor.htm andrews:/home/www/cvswww/chess.eecs.berkeley.edu/ptexternal/nightly/doc/coding/addinganactor.htm

Typically, when running a model, the model is run inside the Swing Event Thread. Example code may be found at ptolemy/vergil/basic/export/ExportModel.java