b2fda8fe97ae0ebfb6dc060ef179e619.ppt
- Количество слайдов: 26
Introduction to Access Grid Development Access Grid Workshop – APAC ‘ 05
Agenda • • • Architecture AG Application Basics Access. Grid module overview Example application Exercises Access Grid Workshop – APAC ‘ 05
Architecture Access Grid Workshop – APAC ‘ 05
Technologies • • • Python wx. Python py. Globus SOAP (SOAPpy) py. Open. SSL 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 Access Grid Workshop – APAC ‘ 05
AG Application Basics • The core of an AG application is an instance of Access. Grid. Toolkit. Application App. Base Application Cmdline. Application Service WXGUIApplication 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) – Cmdline. Application • Examples: Bridge. Server, Venue. Server, AGNode. Service – WXGUIApplication • Examples: Venue. Client, Venue. Management, Node. Management 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 = Cmdline. Application. instance() app. Initialize(app. Name) • app. Name is used in logfile name 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. Add. Cmd. Line. Option( optparse. Option(‘-u’, ’—url’, dest=‘url’)) app. Initialize(‘Sample. App’) url = app. Get. Option(‘url’) 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
Logging • Standard Python module logging is integrated into Access. Grid 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 app. Name. log (app. Name is from app. Initialize) in Log directory: – Windows: %APPDATA%Access. GridLogs – Linux/OSX: $HOME/. Access. Grid/Logs • Logging calls in code will appear in logfile, according to call and current logging level – log. debug(‘this is debug logging text’) Access Grid Workshop – APAC ‘ 05
Access. Grid Module Overview • Access. Grid – Core toolkit code • Access. Grid. Security – Certificate. Manager, Certificate. Repository, etc. – Authorization. Manager, Role, Action, etc. • Access. Grid. Platform – Platform-specific code • Config. {System. Config, User. Config, etc. } • Process. Manager • Access. Grid. hosting – SOAP implementation adapters Access Grid Workshop – APAC ‘ 05
Access. Grid Module API Documentation Access Grid Workshop – APAC ‘ 05
Interfaces and Interface. Wrappers • Described in online API documentation • Interface wrappers are defined in individual modules – For example, Access. Grid. Venue. IW • IW (and I) class methods handle serialization/deserialization of data types from SOAP implementation domain to AG application domain Access Grid Workshop – APAC ‘ 05
Available Interface. Wrappers • • • Venue. IW Venue. Server. IW Venue. Client. IW AGNode. Service. IW AGService. Manager. IW AGService. IW Authorization. Manager. IW Shared. Application. IW Network. Service. IW Access Grid Workshop – APAC ‘ 05
Venue. IW Access Grid Workshop – APAC ‘ 05
Types • Many types are found in Descriptions. py – Stream. Description – Application. Description • Others are found in their own modules – Client. Profile – AGParameter – Capability 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 Access Grid Workshop – APAC ‘ 05
Example: Get. Clients. py #!/usr/bin/python 2 import sys from Access. Grid. Toolkit import Cmdline. Application from Access. Grid. Venue import Venue. IW url = sys. argv[1] # Create and initialize application app = Cmdline. Application() app. Initialize('qwe') # Create venue interface wrapper venue = Venue. IW(url) # Get clients from venue and process client. List = venue. Get. Clients() for client in client. List: print client Access Grid Workshop – APAC ‘ 05
Example: Get. Clients. py python Get. Clients. py https: //vv 2. mcs. anl. gov: 9000/Venues/default Profile Type: user Name: Tom Uram Email: turam@mcs. anl. gov Phone Number: Location: Chicago, IL Venue Client URL: https: //wormtongue. mcs. anl. gov: 11000/Venue. Client Public ID: 00000102220 e 6208008 c 00 dd 0022004754 d Home Venue: https: //vv 2. mcs. anl. gov: 9000/Venues/default Access Grid Workshop – APAC ‘ 05
Example: Get. Clients. py • Check logfile Get. Clients. log 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/Access. Grid. Toolkit. app/Contents/Resources/ setupenv. sh Access Grid Workshop – APAC ‘ 05
Exercise: Get. Streams. py • Modify Get. Clients. py to call Get. Streams instead of Get. Clients • Return value is a list of Descriptions. Stream. Description Access Grid Workshop – APAC ‘ 05
Exercise: Get. Users. py • Modify Get. Clients. py to call Venue. Client. IW. Get. Users • Return value is a list of Client. Profile Access Grid Workshop – APAC ‘ 05
Access Grid Workshop – APAC ‘ 05
Access Grid Workshop – APAC ‘ 05