Transcript PPT
Python for Scientific Gateways
Development
Randy Heiland1, Sean D. Mooney1, Keith Jackson2,
Joshua Boverhof2, Maciek Swat1, Ariel Balter1,
Marcus Christie1, Joseph Insley3
GCE Workshop
Supercomputing 2007
1-Indiana University, 2-Lawrence Berkeley Lab, 3-Argonne National Lab
Gateway Development:
A landscape of technologies
Blogs
Web
Services
Java
Web 2.0
C#
Globus
OGCE
GridSphere
XML
iGoogle
Background and Motivation
•
http://communitygrids.blogspot.com/2007/02/rethinking-science-gateways.html
“Rethinking Science Gateways”
…many science gateways would undoubtedly benefit from “agile
development” rather than “enterprise development” practices.
This is because many science teams cannot afford specialized
Web and Grid developers. They would instead like to build
gateways themselves. Such would-be gateway developers
typically possess a great deal of programming knowledge but are
more likely to be driven by practical applications rather than the
desire to build elegantly architected software. …
Gateway Development:
A landscape of technologies
Blogs
Python
Java
Web
Services
Web 2.0
C#
Globus
OGCE
GridSphere
XML
iGoogle
Python
• Released in 1991 by Guido van Rossum (at Google since Dec
‘05; 50% time on Python)
•
•
•
•
•
•
•
Dynamically typed, Strongly typed, Auto memory mgt
High-level lng; Syntax (minimal, clean)
Interpreted; Interactive (
rapid prototyping/development)
Glue-iness, Wrap-ability (e.g., www.swig.org)
CiSE
Introspection
May/June 2007
History with science apps
Vibrant communities and evolving language
Gateways: Two basic approaches
• Web browser-based
• Application, client-server
TeraGrid Science Gateway is defined as “a community
interface that enables access to high end resources,
usually through a web portal or desktop client server
arrangement”
Some Python-related tools for a scientific gateway
NumPy
UCSF Chimera, VMD, PyMOL
CompuCell3D
ZSI, pyGlobus, pyGridWare
SciPy
Biopython
VTK, ParaView, matplotlib
TurboGears, django
SWIG, SIP
Pyrex
VisTrails
Numerical module providing array objects
Molecular graphics and modeling
Environment for cell-based modeling
Web services toolkit, Interface to GT, WSRF toolkit
Science and engineering modules
Tools for computational molecular biology
Scientific visualization, 2D plotting
Web development frameworks
Tools for wrapping code in Python
Tool for writing extension modules in C
Scientific workflow system
Application Client-Server
using Web services (SOAPpy, ZSI)
chembiogrid.org
lifescienceweb.org
Web browser gateway:
TurboGears - Web dev framework (in Python)
• Open source
Model-View-Controller
• AJAX w/ MochiKit
• Model: SQLObject
• JSON
• View: Kid templating
• Controller: CherryPy
• Apache HTTP, MySQL
In addition to TurboGears, may
also try django, another Python
Web dev framework.
Getting started - trivial
$ tg-admin quickstart
- prompted for proj name
$ start-<proj>.py
TurboGears “extras”
- usual widgets: input fields, checkboxes, tables, etc.
- more complex widgets
ZSI - Python Web services
• Python pkg implementing SOAP 1.1 spec
• Generates stubs for client & server, from a
WSDL:
$ wsdl2py
$ wsdl2dispatch
(refer to Nws example in paper)
CompuCell3D - NIH funded project
• Cell-based tissue simulation
environment
Testbed
for parameter
sweeps on
HPC via
gateway(s)
Security
• Out-of-the-box solution using
Grid Security Infrastructure (GSI) authentication
• Assumes:
GSI file systems (e.g. /etc/grid-security) on host computer,
a newer version of M2Crypto (>=0.16) installed,
client certificate exists and has been imported into browser
Non-Python components using AJAX
• Javascript widgets (MochiKit, Yahoo UI,
Dojo, etc.) talk to Java backend
• Apache HTTP server ~ Apache Tomcat
• (rf. paper)
Conclusion
• Python (+pkgs) provides viable options for
building scientific gateways.
• Because Python is already being used by
many scientific communities, these
researchers can build/maintain their own,
lightweight, focused gateways.
• But wait, there’s more…
Python and Education
• OLPC project bundled
with Python 2.5
• Potential new generation of
Python programmers
worldwide
• ~1M/month in 2008
laptopgiving.org
Thanks!
Acknowledgements:
Partial funding through the IPCRES Initiative grant
from the Lilly Endowment.
Addendum
• For a Python IDE, we recommend using
Eclipse with the PyDev plugin.
• Other options include Wing (commercial) and
IDLE (bundled w/ Python)