Computer Sciences Department University of Wisconsin-Madison Developer APIs to Condor + A Tutorial.

Slides:



Advertisements
Similar presentations
1
Advertisements

Distributed Systems Architectures
Copyright © 2003 Pearson Education, Inc. Slide 8-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Myra Shields Training Manager Introduction to OvidSP.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
CSF4 Meta-Scheduler Tutorial 1st PRAGMA Institute Zhaohui Ding or
Jaime Frey Computer Sciences Department University of Wisconsin-Madison OGF 19 Condor Software Forum Routing.
Three types of remote process invocation
1 Hyades Command Routing Message flow and data translation.
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
4 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: Servlets.
11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
9 Copyright © 2005, Oracle. All rights reserved. Modularizing JavaServer Pages Development with Tags.
8 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: JavaServer Pages.
17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Microsoft Access 2007 Advanced Level. © Cheltenham Courseware Pty. Ltd. Slide No 2 Forms Customisation.
Condor Project Computer Sciences Department University of Wisconsin-Madison Eager, Lazy, and Just-in-Time.
WS-JDML: A Web Service Interface for Job Submission and Monitoring Stephen M C Gough William Lee London e-Science Centre Department of Computing, Imperial.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Auto-scaling Axis2 Web Services on Amazon EC2 By Afkham Azeez.
Server Access The REST of the Story David Cleary
Written by Liron Blecher
Week 2 The Object-Oriented Approach to Requirements
© SafeNet Confidential and Proprietary Administering SafeNet StorageSecure Smart Card Module 3: Lesson 5 SafeNet StorageSecure Storage Security Course.
Break Time Remaining 10:00.
13 Copyright © 2005, Oracle. All rights reserved. Monitoring and Improving Performance.
ACT User Meeting June Your entitlements window Entitlements, roles and v1 security overview Problems with v1 security Tasks, jobs and v2 security.
PP Test Review Sections 6-1 to 6-6
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Copyright 2007, Information Builders. Slide 1 Introduction to Web Services Efrem Litwin Director, WebFOCUS Integration Products Information Builders.
Operating Systems Operating Systems - Winter 2011 Dr. Melanie Rieback Design and Implementation.
Operating Systems Operating Systems - Winter 2012 Dr. Melanie Rieback Design and Implementation.
12th EELA Tutorial, Lima, FP6−2004−Infrastructures−6-SSA E-infrastructure shared between Europe and Latin America.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
XML Web Services Monash University Semester 1, March 2006.
31242/32549 Advanced Internet Programming Advanced Java Programming
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Adding Up In Chunks.
Services Course Windows Live SkyDrive Participant Guide.
1 BRState Software Demonstration. 2 After you click on the LDEQ link to download the BRState Software you will get this message.
2004 EBSCO Publishing Presentation on EBSCOadmin.
Chapter 12 Working with Forms Principles of Web Design, 4 th Edition.
Essential Cell Biology
Clock will move after 1 minute
PSSA Preparation.
Essential Cell Biology
The DDS Benchmarking Environment James Edmondson Vanderbilt University Nashville, TN.
A1.1 Assignment 1 “Deploying a Simple Web Service” ITCS 4010/5010 Grid Computing, UNC-Charlotte B. Wilkinson, 2005.
Energy Generation in Mitochondria and Chlorplasts
RefWorks: The Basics October 12, What is RefWorks? A personal bibliographic software manager –Manages citations –Creates bibliogaphies Accessible.
South Dakota Library Network MetaLib User Interface South Dakota Library Network 1200 University, Unit 9672 Spearfish, SD © South Dakota.
TCP/IP Protocol Suite 1 Chapter 18 Upon completion you will be able to: Remote Login: Telnet Understand how TELNET works Understand the role of NVT in.
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Dan Bradley Computer Sciences Department University of Wisconsin-Madison Schedd On The Side.
Todd Tannenbaum Computer Sciences Department University of Wisconsin-Madison Condor.
Peter Keller Computer Sciences Department University of Wisconsin-Madison Quill Tutorial Condor Week.
Condor Birdbath Web Service interface to Condor
1 Getting popular Figure 1: Condor downloads by platform Figure 2: Known # of Condor hosts.
Todd Tannenbaum Computer Sciences Department University of Wisconsin-Madison Quill / Quill++ Tutorial.
1 Condor BirdBath SOAP Interface to Condor Charaka Goonatilake Department of Computer Science University College London
Developer APIs to Condor + A Tutorial on Condor’s Web Service Interface Todd Tannenbaum, UW-Madison Matthew Farrellee, Red Hat.
Matthew Farrellee Computer Sciences Department University of Wisconsin-Madison Condor and Web Services.
HTCondor’s Grid Universe Jaime Frey Center for High Throughput Computing Department of Computer Sciences University of Wisconsin-Madison.
Condor Project Computer Sciences Department University of Wisconsin-Madison Extend/alter Condor via developer APIs/plugins CERN Feb Todd Tannenbaum.
Condor-G: An Update.
Presentation transcript:

Computer Sciences Department University of Wisconsin-Madison Developer APIs to Condor + A Tutorial on Condors Web Service Interface

2 Interfacing Applications w/ Condor Suppose you have an application which needs a lot of compute cycles You want this application to utilize a pool of machines How can this be done?

3 Some Condor APIs Command Line tools condor_submit, condor_q, etc DRMAA Condor GAHP JSDL RDBMS Condor Perl Module SOAP

4 Command Line Tools Dont underestimate them! Your program can create a submit file on disk and simply invoke condor_submit: system(echo universe=VANILLA > /tmp/condor.sub); system(echo executable=myprog >> /tmp/condor.sub);... system(echo queue >> /tmp/condor.sub); system(condor_submit /tmp/condor.sub);

5 Command Line Tools Your program can create a submit file and give it to condor_submit through stdin: PERL:fopen(SUBMIT, |condor_submit); print SUBMIT universe=VANILLA\n;... C/C++:int s = popen(condor_submit, r+); write(s, universe=VANILLA\n, 17/*len*/);...

6 Command Line Tools Using the +Attribute with condor_submit: universe = VANILLA executable = /bin/hostname output = job.out log = job.log +webuser = zmiller queue

7 Command Line Tools Use -constraint and –format with condor_q: % condor_q -constraint webuser==zmiller -- Submitter: bio.cs.wisc.edu : : bio.cs.wisc.edu ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD zmiller 10/11 06: :00:00 I hostname % condor_q -constraint 'webuser=="zmiller"' -format "%i\t" ClusterId -format "%s\n" Cmd /bin/hostname

8 Command Line Tools condor_wait will watch a job log file and wait for a certain (or all) jobs to complete: system(condor_wait job.log); can specify a timeout

9 Command Line Tools condor_q and condor_status –xml option So it is relatively simple to build on top of Condors command line tools alone, and can be accessed from many different languages (C, PERL, python, PHP, etc). However…

10 DRMAA DRMAA is a GGF standardized job- submission API Has C (and now Java) bindings Is not Condor-specific -- your app could submit to any job scheduler with minimal changes (probably just linking in a different library) SourceForge Project

11 DRMAA Easy to use, but Unfortunately, the DRMAA API does not support some very important features, such as: Two-phase commit Fault tolerance Transactions

12 Condor GAHP The Condor GAHP is a relatively low-level protocol based on simple ASCII messages through stdin and stdout Supports a rich feature set including two-phase commits, transactions, and optional asynchronous notification of events Is available in Condor 6.7.X

13 GAHP, cont Example: R: $GahpVersion: Nov NCSA\ CoG\ Gahpd $ S: GRAM_PING 100 vulture.cs.wisc.edu/fork R: E S: RESULTS R: E S: COMMANDS R: S COMMANDS GRAM_JOB_CANCEL GRAM_JOB_REQUEST GRAM_JOB_SIGNAL GRAM_JOB_STATUS GRAM_PING INITIALIZE_FROM_FILE QUIT RESULTS VERSION S: VERSION R: S $GahpVersion: Nov NCSA\ CoG\ Gahpd $ S: INITIALIZE_FROM_FILE /tmp/grid_proxy_ txt R: S S: GRAM_PING 100 vulture.cs.wisc.edu/fork R: S S: RESULTS R: S 0 S: RESULTS R: S 1 R: S: QUIT R: S

14 JSDL and Condor GridSAM: open source web service for job submission and monitoring Condor plugin for GridSAM enables JSDL submissions to Condor.

15 RDMS: Quill Job ClassAds information mirrored into an RDBMS Both active jobs and historical jobs Benefits BOTH scalability and accessibility QuillSchedd Job Queue log RDBMS Startd … Master Queue + History Tables

16 Condor Perl Module Perl module to parse the job log file Recommended instead of polling w/ condor_q Call-back event model (Note: job log can be written in XML)

17 Web Service Interface Simple Object Access Protocol Mechanism for doing RPC using XML (typically over HTTP or HTTPS) A World Wide Web Consortium (W3C) standard SOAP Toolkit: Transform a WSDL to a client library

18 Benefits of a Condor SOAP API Condor becomes a service Can be accessed with standard web service tools Condor accessible from platforms where its command-line tools are not supported Talk to Condor with your favorite language and SOAP toolkit

19 Condor SOAP API functionality Submit jobs Retrieve job output Remove/hold/release jobs Query machine status Query job status

20 Getting machine status via SOAP Your program SOAP library queryStartdAds() condor_collector Machine List SOAP over HTTP

21 Lets get some details…

22 The API Core API, described with WSDL, is designed to be as flexible as possible File transfer is done in chunks Transactions are explicit Wrapper libraries aim to make common tasks as simple as possible Currently in Java and C# Expose an object-oriented interface

23 Things we will cover Condor setup Necessary tools Job Submission Job Querying Job Retrieval Authentication with SSL and X.509 An important addition in late 6.7

24 Condor setup Start with a working condor_config The SOAP interface is off by default Turn it on by adding ENABLE_SOAP=TRUE Access to the SOAP interface is denied by default Set ALLOW_SOAP and DENY_SOAP, they work like ALLOW_READ/WRITE/… See section of the v6.7 manual for a description Example: ALLOW_SOAP=*/*.cs.wisc.edu

25 Necessary tools You need a SOAP toolkit Apache Axis (Java) - Microsoft.Net - gSOAP (C/C++) - ZSI (Python) - SOAP::Lite (Perl) - You need Condors WSDL files Find them in lib/webservice/ in your Condor release Put the two together to generate a client library $ java org.apache.axis.wsdl.WSDL2Java condorSchedd.wsdl Compile that client library $ javac condor/*.java All our examples are in Java using Apache Axis

26 Helpful tools The core API has some complex spots A wrapper library is available in Java and C# Makes the API a bit easier to use (e.g. simpler file transfer & job ad submission) Makes the API more OO, no need to remember and pass around transaction ids We are going to use the Java wrapper library for our examples You can download it from Will be included in Condor release

27 Submitting a job The CLI way… universe = vanilla executable = /bin/cp arguments = cp.sub cp.worked should_transfer_files = yes transfer_input_files = cp.sub when_to_transfer_output = on_exit queue 1 $ condor_submit cp.sub cp.sub: Explicit bits clusterid = X procid = Y owner = matt requirements = Z Implicit bits

28 Repeat to submit multiple jobs in a single cluster Repeat to submit multiple clusters The SOAP way… 1.Begin transaction 2.Create cluster 3.Create job 4.Send files 5.Describe job 6.Commit transaction Submitting a job

Begin transaction 2. Create cluster 3. Create job 4&5. Send files & describe job 6. Commit transaction Schedd schedd = new Schedd( Transaction xact = schedd.createTransaction(); xact.begin(30); int cluster = xact.createCluster(); int job = xact.createJob(cluster); File[] files = { new File(cp.sub) }; xact.submit(cluster, job, owner, UniverseType.VANILLA, /bin/cp, cp.sub cp.worked, requirements, null, files); xact.commit(); Submission from Java

30 Schedds location Max time between calls (seconds) Job owner, e.g. matt Requirements, e.g. OpSys==\Linux\ Extra attributes, e.g. Out=stdout.txt or Err=stderr.txt Schedd schedd = new Schedd( Transaction xact = schedd.createTransaction(); xact.begin(30); int cluster = xact.createCluster(); int job = xact.createJob(cluster); File[] files = { new File("cp.sub") }; xact.submit(cluster, job, owner, UniverseType.VANILLA, /bin/cp, cp.sub cp.worked, requirements, null, files); xact.commit(); Submission from Java

31 Querying jobs The CLI way… $ condor_q -- Submitter: localhost : : localhost ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD 1.0 matt 10/27 14: :46:42 C sleep … 42 jobs; 1 idle, 1 running, 1 held, 1 unexpanded

32 Also, getJobAds given a constraint, e.g. Owner==\matt\ String[] statusName = {, Idle, Running, Removed, Completed, Held }; int cluster = 1; int job = 0; Schedd schedd = new Schedd( ClassAd ad = new ClassAd(schedd.getJobAd(cluster, job)); int status = Integer.valueOf(ad.get(JobStatus)); System.out.println(Job is + statusName[status]); Querying jobs The SOAP way from Java…

33 Retrieving a job The CLI way.. Well, if you are submitting to a local Schedd, the Schedd will have all of a jobs output written back for you If you are doing remote submission you need condor_transfer_data, which takes a constraint and transfers all files in spool directories of matching jobs

34 Discover available files Remote file Local file Retrieving a job The SOAP way in Java… int cluster = 1; int job = 0; Schedd schedd = new Schedd( Transaction xact = schedd.createTransaction(); xact.begin(30); FileInfo[] files = xact.listSpool(cluster, job); for (FileInfo file : files) { xact.getFile(cluster, job, file.getName(), file.getSize(), new File(file.getName())); } xact.commit();

35 Authentication for SOAP Authentication is done via mutual SSL authentication Both the client and server have certificates and identify themselves Possible in late-late 6.7 (available by 6.8) It is not always necessary, e.g. in some controlled environments (a portal) where the submitting component is trusted A necessity in an open environment -- remember that the submit call takes the jobs owner as a parameter Imagine what happens if anyone can submit to a Schedd running as root…

36 Authentication setup Create and sign some certificates Use OpenSSL to create a CA CA.sh -newca Create a server cert and password-less key CA.sh -newreq && CA.sh -sign mv newcert.pem server-cert.pem openssl rsa -in newreq.pem -out server-key.pem Create a client cert and key CA.sh -newreq && CA.sh -sign && mv newcert.pem client-cert.pem && mv newreq.pem client-key.pem

37 Authentication config Config options… ENABLE_SOAP_SSL is FALSE by default _SOAP_SSL_PORT Set this to a different port for each SUBSYS you want to talk to over ssl, the default is a random port Example: SCHEDD_SOAP_SSL_PORT=1980 SOAP_SSL_SERVER_KEYFILE is required and has no default The file containing the servers certificate AND private key, i.e. keyfile after cat server-cert.pem server-key.pem > keyfile

38 Authentication config Config options continue… SOAP_SSL_CA_FILE is required The file containing public CA certificates used in signing client certificates, e.g. demoCA/cacert.pem All options except SOAP_SSL_PORT have an optional SUBSYS_* version For instance, turn on SSL for everyone except the Collector with ENABLE_SOAP_SSL=TRUE COLLECTOR_ENABLE_SOAP_SSL=FALSE

39 One last bit of config The certificates we generated have a principal name, which is not standard across many authentication mechanisms Condor maps authenticated names (here, principal names) to canonical names that are authentication method independent This is done through mapfiles, given by SEC_CANONICAL_MAPFILE and SEC_USER_MAPFILE Canonical map: SSL. \1 User map: (.*) \1 SSL is the authentication method,.* Address….* is a pattern to match against authenticated names, and \1 is the canonical name, in this case the username on the in the principal

40 HTTPS with Java Setup keys… keytool -import -keystore truststore -trustcacerts -file demoCA/cacert.pem openssl pkcs12 -export -inkey client-key.pem -in client- cert.pem -out keystore All the previous code stays the same, just set some properties javax.net.ssl.trustStore, javax.net.ssl.keyStore, javax.net.ssl.keyStoreType, javax.net.ssl.keyStorePassword Example: java -Djavax.net.ssl.trustStore=truststore - Djavax.net.ssl.keyStore=keystore - Djavax.net.ssl.keyStoreType=PKCS12 - Djavax.net.ssl.keyStorePassword=pass Example

41 Questions?