Extending JICOS to nonJava Clients and Services - PowerPoint PPT Presentation

1 / 41
About This Presentation
Title:

Extending JICOS to nonJava Clients and Services

Description:

Extending Jicos to non-Java clients. Extending Jicos to non-Java services ... (Piglet) Supporting Information. HTML FORM Using HTML's FORM External Clients HTML ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 42
Provided by: andyp3
Learn more at: http://www.cs.ucsb.edu
Category:

less

Transcript and Presenter's Notes

Title: Extending JICOS to nonJava Clients and Services


1
Extending JICOS to non-Java Clients and Services
  • Andy Pippin
  • Masters Thesis Defense
  • April 12th, 2005

2
Agenda
  • Introduction to Jicos
  • Extending Jicos to non-Java clients
  • Extending Jicos to non-Java services
  • Administering a Jicos system

3
What is Jicos?Introduction to Jicos
  • Jicos is a Java-centric network computing
    service.
  • Where did Jicos come from?
  • SuperWeb, Javelin, CX
  • What computations are suited to Jicos?
  • Embarrassingly parallel computations
  • Divide conquer computations
  • Branch bound (e.g. traveling salesman)

4
Fibonacci A Jicos hello worldIntroduction to
Jicos
  • public Object execute ( Environment environment )
  • if ( n lt 2 )
  • return new Integer( 1 )
  • else
  • compute( new F( n - 1 ) )
  • compute( new F( n - 2 ) )
  • return( new AddInteger() )

5
Benefits of JavaIntroduction to Jicos
  • Platform independent
  • Java classes run relatively securely
  • Code mobility

6
A Jicos SystemIntroduction to Jicos
7
Benefits of JicosIntroduction to Jicos
  • Ease of application development
  • Tolerates faulty compute servers
  • Supports adaptive parallelism

8
Limitations of JicosIntroduction to Jicos
  • Java centricity
  • Clients must be written in Java
  • Tasks (hosted computations) must be written in
    Java.
  • The human time to start stop a Jicos system is
    proportional to the number of machines in it.

9
Extending JicosIntroduction to Jicos
  • Non-Java clients can use Jicos tasks
  • For example, a web browser
  • Jicos tasks can use non-Java services
  • For example, a Matlab engine
  • Administration start-up tear-down
  • AdminTool framework

10
Agenda
  • Introduction to Jicos
  • Extending Jicos to non-Java clients
  • Extending Jicos to non-Java services
  • Administering a Jicos system

11
A Typical Jicos ClientExternal Client
  • public static void main( String args )
  • // get a reference to a HSP (Host Service
    Provider)
  • HspAgent agent new HspAgent( args0 )
  • Client2Hsp hsp agent.getClient2Hsp()
  • // login
  • Environment environment new Environment(
    null, null )
  • hsp.login( environment )
  • // compute
  • int number Integer.parseInt( args1 )
  • Task task new F( number )
  • Integer value (Integer) hsp.compute( task
    )
  • // logout
  • Invoice invoice hsp.logout()

12
Non-Java Clients
Oh... Okay!
???
RMI
XML
XML
13
How It All WorksExternal Client
Task over RMI
!
!
XML over HTTP
???
!
Answer over RMI
Response over HTTP
14
Incoming DataExternal Client
  • XML
  • The Collector uses XPath
  • The XML Path Language (W3C)
  • Typically used in XML transforms (XSLT)
  • An HTTP ltFORMgt can be converted to XML

15
Example Input FibonacciExternal Client
  • HTTP header
  • POST /ExternalRequest HTTP/1.1
  • header
  • header
  • Content-Length 321
  • /ExternalRequest_at_taskNamejicos.examples.external.
    fibonacci.Fibonacci/ExternalRequest/Fibonacci/n1
    0
  • HTTP ? XML
  • ltExternalRequest taskNamejicos.examples.exte
    rnal.fibonacci.Fibonaccigt
  • ltFibonaccigt
  • ltngt10lt/ngt
  • lt/Fibonaccigt
  • lt/ExternalRequestgt

16
Collector/External ProcessorExternal Client
  • The Collector extracts items from the input
  • Task class name
  • Response type
  • Passes the rest of the input to the External
    Request Processor (ERP).

17
Converting the XML to JavaExternal Client
  • XML
  • ltExternalRequest taskNamejicos.examples.exte
    rnal.fibonacci.Fibonaccigt
  • ltFibonaccigt
  • ltngt10lt/ngt
  • lt/Fibonaccigt
  • lt/ExternalRequestgt
  • Fibonacci.fromXml()
  • Uses XPath queries
  • this.n externalRequest.getValue(
  • /ExternalRequest/Fibonacci/n )

18
Submitting the TaskExternal Client
Task over RMI
???
!
!
Answer over RMI
19
Converting the Jicos AnswerExternal Client
  • Convert the Java Result to XML
  • createResult()
  • Should be able to convert XML ? HTML
  • Convert the XML Result for the Client
  • Uses XSLT stylesheet (if available)
  • Calls toHtmlString() (if appropriate)
  • Just send raw XML (lt? lt )

20
Sending the XML AnswerExternal Client
!
!
Response over HTTP
21
Example Fibonacci ResultExternal Client
  • Convert response
  • this.FofN resultXml.getValue(
    /ExternalResult/Fibonacci/FofN )
  • String xml Fib( this.n )
    this.FofN \r\n
  • On browser
  • Fib( 10 ) 89

22
Sending the ResponseExternal Client
  • When to send the response back?
  • Short computations wait for result
  • Dont send a response until there is an answer
  • Browser will sit and spin
  • Long computations poll
  • Immediately send a response with a result id
  • Check back for the answer

23
Required FunctionsExternal Client
  • Implement default (no-arg) constructor
  • Implement XmlConverter
  • fromXml() // XML ? Java
  • createShared() // XML ? Shared Object
  • createInput() // XML ? Input Object
  • createResult() // Result ? XML
  • getStyleSheet() // XSLT transformation
  • toHtmlString() // (XML) Result ? HTML

24
Agenda
  • Introduction to Jicos
  • Extending Jicos to non-Java clients
  • Extending Jicos to non-Java services
  • Administering a Jicos system

25
Modifications to JicosExternal Services
  • Jicos any Task can be performed on any Host
  • However, a Task using an External (non-Java)
    Service may not be able to run on any Host
  • Licensing issues
  • Partitioned information
  • Required a modification to Jicos
  • Route Task to a proper Host

26
How it All WorksExternal Services
27
Class HierarchyExternal Services
  • External Services class hierarchy
  • TaskExternal extends Task
  • HostExternal extends Host
  • TaskServerExternal extends
  • Service specific classes extend those classes
  • TaskMatlab extends TaskExternal
  • H ostMatlab extends HostExternal
  • TaskServerMatlab extends TaskServerExternal
  • Jicos then routes Tasks of a certain class
    towards Hosts of that class, where the task can
    access the service.

28
HostExternalExternal Services
  • Provides the interaction between the Task and the
    external service
  • Exposes services functions
  • Controls service

29
Non-Java API JNIExternal Services
  • Java Native Interface
  • Requires a loadable library (.so/.dll/.dynlib)
  • Invokes native code just like Java code
  • JNI provides functions to perform object creation
    and modification (e.g. arrays)
  • Java can have a segmentation fault? ?

30
Task FlowExternal Services
Task
Task
MTask
Task
MTask
Task
MTask
Task
Task
MTask
Task
31
Example Using MatlabExternal Services
  • The HostMatlab keeps a reference to the Matlab
    engine.
  • TaskMatlab uses this reference to perform a
    Matlab computation
  • Exposed functions
  • putVariable( name, value )
  • evalString( matlabCommand )
  • getVariable( name )

32
Agenda
  • Introduction to Jicos
  • Extending Jicos to non-Java clients
  • Extending Jicos to non-Java services
  • Administering a Jicos system

33
Starting a Jicos SystemAdminTool
  • Previously
  • Log in to remote machine, start a HSP
  • Log in to another machine, start a TaskServer
  • Log in to another machine, start a Host
  • Log in to another machine, start a Host
  • Log in to another machine, start a Host
  • Log in to another machine, start a Host
  • Log in to another machine, start a Host
  • Finally, start a client.

34
ChameleonAdminTool
  • Starting a system now
  • Administrator installs Chameleon to start up as a
    system daemon
  • User starts a Console with a starting
    configuration
  • Take a sip of your favorite beverage
  • All requested Jicos components are started
  • Done

35
Example Start Configuration FileAdminTool
  • lt?xml version1.0gt
  • ltJicosgt
  • ltMachinesgt
  • ltMachine namelinux09
    addrlinux09.engr.ucsb.edu /gt
  • ltGroup namecsilgt
  • ltMachine namewacko
    addrwacko.cs.ucsb.edu/gt
  • ltMachine namedilbert
    addr128.111.43.60/gt
  • lt/Groupgt
  • lt/Machinesgt
  • ltHsp nameFibonacci groupcsil hosts0gt
  • ltTaskServer groupcsil hosts0gt
  • ltHost groupcsilgt
  • ltHost groupcsilgt
  • ltHost machinelinux09
    exttypematlabgt
  • lt/TaskServergt
  • lt/Hspgt
  • lt/Jicosgt

36
TuiConsoleAdminTool
  • Admin framework is also interactive
  • TuiConsole (Text User Interface)
  • Start/stop components
  • ping services
  • Misc development tools (RMI registry)
  • GuiConsole
  • Future Work

37
Summary
  • Extending to non-Java clients
  • ? XML?Java?Jicos?Java?XML ?
  • Extending to non-Java services
  • Java Native Interface
  • Controlling a Jicos system (AdminTool)
  • Chameleon / Console / TuiConsole

38
(No Transcript)
39
Dedicated to my Assistant (Piglet)
40
Supporting Information
  • HTML ltFORMgt

41
Using HTMLs ltFORMgtExternal Clients
  • ltHTMLgt
  • ltBODYgt
  • ltFORM ACTIONhttp//localhost8181/ExternalReques
    t
  • METHODpostgt
  • ltINPUT TYPEhidden
  • NAME/ExternalRequest_at_taskName
  • VALUEjicos.examples.external.fibonacci.F
    ibonaccigt
  • lt/INPUTgt
  • Please enter the Fibonacci Number
  • ltINPUT TYPEtext SIZE5
  • NAME/ExternalRequest/Fibonacci/ngt
  • lt/INPUTgt
  • ltINPUT TYPEsubmitgtlt/INPUTgt
  • ltINPUT TYPEresetgtlt/INPUTgt
  • lt/FORMgt
  • lt/HTMLgt
Write a Comment
User Comments (0)
About PowerShow.com