introduction to access grid development
DESCRIPTION
Introduction to Access Grid Development. Agenda. Architecture AG Application Basics AccessGrid module overview Example application Exercises. Architecture. Technologies. Python wxPython pyGlobus SOAP (SOAPpy) pyOpenSSL. AG Application Basics. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/1.jpg)
Access Grid Workshop – APAC ‘05
Introduction to Access Grid Development
![Page 2: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/2.jpg)
Access Grid Workshop – APAC ‘05
Agenda
• Architecture• AG Application Basics• AccessGrid module overview• Example application• Exercises
![Page 3: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/3.jpg)
Access Grid Workshop – APAC ‘05
Architecture
![Page 4: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/4.jpg)
Access Grid Workshop – APAC ‘05
Technologies
• Python• wxPython• pyGlobus• SOAP (SOAPpy)• pyOpenSSL
![Page 5: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/5.jpg)
Access Grid Workshop – APAC ‘05
AG Application Basics
An Access Grid client application will perform (at least) these steps:
• Create an application instance• Initialize application • Create an interface wrapper• Call methods on the interface
wrapper
![Page 6: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/6.jpg)
Access Grid Workshop – APAC ‘05
AG Application Basics
• The core of an AG application is an instance of AccessGrid.Toolkit.Application
AppBase
Application
CmdlineApplication WXGUIApplication
Service
![Page 7: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/7.jpg)
Access Grid Workshop – APAC ‘05
AG Application Basics
• Distinguished between GUI and non-GUI applications to generalize user interactions (for example, prompt for passphrase, error reporting)– CmdlineApplication
• Examples: BridgeServer, VenueServer, AGNodeService
– WXGUIApplication• Examples: VenueClient,
VenueManagement, NodeManagement
![Page 8: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/8.jpg)
Access Grid Workshop – APAC ‘05
Application Initialization
• Create AG application instance• Initialize application
– Verify certificate repository– Load default certificate– Create proxy certificate– Configure Globus environment
app = CmdlineApplication.instance()app.Initialize(appName)
• appName is used in logfile name
![Page 9: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/9.jpg)
Access Grid Workshop – APAC ‘05
Argument Processing
• Standard Python module optparse is integrated into toolkit
• Add option to application before initialization
• Access options post-initialization
app.AddCmdLineOption(optparse.Option(‘-u’,’—url’,
dest=‘url’))
app.Initialize(‘SampleApp’)
url = app.GetOption(‘url’)
![Page 10: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/10.jpg)
Access Grid Workshop – APAC ‘05
Standard Toolkit Arguments
• The toolkit adds some options to all applications
• Available options can be viewed with ‘-h’ or –help
• Examples-d (turn on debug)-l <logFileName>--logfilesize <size> --numlogfiles <num> (rollover log files)
![Page 11: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/11.jpg)
Access Grid Workshop – APAC ‘05
Logging
• Standard Python module logging is integrated into AccessGrid toolkit
• Multiple logging levels are defined (see logging module documentation)– CRITICAL, ERROR, WARNING, INFO, DEBUG
• Logging levels can be controlled for individual components in an application
• Application will create appName.log (appName is from app.Initialize) in Log directory:– Windows: %APPDATA%\AccessGrid\Logs– Linux/OSX: $HOME/.AccessGrid/Logs
• Logging calls in code will appear in logfile, according to call and current logging level– log.debug(‘this is debug logging text’)
![Page 12: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/12.jpg)
Access Grid Workshop – APAC ‘05
AccessGrid Module Overview
• AccessGrid– Core toolkit code
• AccessGrid.Security– CertificateManager, CertificateRepository, etc.– AuthorizationManager, Role, Action, etc.
• AccessGrid.Platform– Platform-specific code
• Config.{SystemConfig,UserConfig,etc.}• ProcessManager
• AccessGrid.hosting– SOAP implementation adapters
![Page 13: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/13.jpg)
Access Grid Workshop – APAC ‘05
AccessGrid Module API Documentation
![Page 14: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/14.jpg)
Access Grid Workshop – APAC ‘05
Interfaces and InterfaceWrappers
• Described in online API documentation• Interface wrappers are defined in
individual modules– For example, AccessGrid.Venue.VenueIW
• IW (and I) class methods handle serialization/deserialization of data types from SOAP implementation domain to AG application domain
![Page 15: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/15.jpg)
Access Grid Workshop – APAC ‘05
Available InterfaceWrappers
• VenueIW• VenueServerIW• VenueClientIW• AGNodeServiceIW• AGServiceManagerIW• AGServiceIW• AuthorizationManagerIW• SharedApplicationIW• NetworkServiceIW
![Page 16: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/16.jpg)
Access Grid Workshop – APAC ‘05
VenueIW
![Page 17: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/17.jpg)
Access Grid Workshop – APAC ‘05
Types
• Many types are found in Descriptions.py– StreamDescription– ApplicationDescription
• Others are found in their own modules– ClientProfile– AGParameter– Capability
![Page 18: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/18.jpg)
Access Grid Workshop – APAC ‘05
AG Applications
An Access Grid client application will perform (at least) these steps:
• Create an application instance• Initialize application • Create an interface wrapper• Call methods on the interface
wrapper
![Page 19: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/19.jpg)
Access Grid Workshop – APAC ‘05
Example: GetClients.py
#!/usr/bin/python2
import sysfrom AccessGrid.Toolkit import CmdlineApplicationfrom AccessGrid.Venue import VenueIW
url = sys.argv[1]
# Create and initialize applicationapp = CmdlineApplication()app.Initialize('qwe')# Create venue interface wrappervenue = VenueIW(url)
# Get clients from venue and processclientList = venue.GetClients()for client in clientList: print client
![Page 20: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/20.jpg)
Access Grid Workshop – APAC ‘05
Example: GetClients.py
python GetClients.py https://vv2.mcs.anl.gov:9000/Venues/default
Profile Type: userName: Tom UramEmail: [email protected] Number: Location: Chicago, ILVenue Client URL:
https://wormtongue.mcs.anl.gov:11000/VenueClientPublic ID: 00000102220e6208008c00dd0022004754dHome Venue:
https://vv2.mcs.anl.gov:9000/Venues/default
![Page 21: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/21.jpg)
Access Grid Workshop – APAC ‘05
Example: GetClients.py
• Check logfile GetClients.log
![Page 22: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/22.jpg)
Access Grid Workshop – APAC ‘05
Notes
• Online workshop materials:http://www.mcs.anl.gov/fl/research/accessgrid/documentation/tutorial/AGTk_2.4
• Online developer documentation (including API reference):
http://www.mcs.anl.gov/fl/research/accessgrid/software/developer.html
• OSX users will need to source an environment file to run code in a terminal– /Applications/AccessGridToolkit.app/Contents/
Resources/setupenv.sh
![Page 23: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/23.jpg)
Access Grid Workshop – APAC ‘05
Exercise: GetStreams.py
• Modify GetClients.py to call GetStreams instead of GetClients
• Return value is a list of Descriptions.StreamDescription
![Page 24: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/24.jpg)
Access Grid Workshop – APAC ‘05
Exercise: GetUsers.py
• Modify GetClients.py to call VenueClientIW.GetUsers
• Return value is a list of ClientProfile
![Page 25: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/25.jpg)
Access Grid Workshop – APAC ‘05
![Page 26: Introduction to Access Grid Development](https://reader036.vdocuments.us/reader036/viewer/2022062314/56813cbb550346895da66902/html5/thumbnails/26.jpg)
Access Grid Workshop – APAC ‘05