Using Cyberaide JavaScript to develop Ajax based Grid Apps – A Tutorial for Grid App Developers Gregor von Laszewski Fugang Wang Jun 22, 2009.

Slides:



Advertisements
Similar presentations
JavaScript and AJAX Jonathan Foss University of Warwick
Advertisements

JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
Grid Resource Allocation Management (GRAM) GRAM provides the user to access the grid in order to run, terminate and monitor jobs remotely. The job request.
Globus Toolkit 4 hands-on Gergely Sipos, Gábor Kecskeméti MTA SZTAKI
Report Distribution Report Distribution in PeopleTools 8.4 Doug Ostler & Eric Knapp 7264.
Open Grid Computing Environments Marlon Pierce, Suresh Marru, Gregor von Laszewski, Mary Thomas, Maytal Dahan, Gopi Kandaswamy, and Wenjun Wu.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Jefferson Ridgeway 2, Ifeanyi Rowland Onyenweaku 3, Gregor von Laszewski 1*, Fugang Wang 1 1* Indiana University, Bloomington, IN 47408, U.S.A.,
Reproducible Environment for Scientific Applications (Lab session) Tak-Lon (Stephen) Wu.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
UNIT-V The MVC architecture and Struts Framework.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
E-Science Workflow Support with Grid-Enabled Microsoft Project Gregor von Laszewski and Leor E. Dilmanian, Rochester Institute of Technology Abstract von.
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
ACM Web Development Workshop - PHP By Luis Torres.
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
JavaScript & jQuery the missing manual Chapter 11
DIRAC Web User Interface A.Casajus (Universitat de Barcelona) M.Sapunov (CPPM Marseille) On behalf of the LHCb DIRAC Team.
A Web 2.0 Portal for Teragrid Fugang Wang Gregor von Laszewski May 2009.
CSE 305 Theory of Database Tutorial on Connecting with Sybase from Java program and Developing GUI Jalal Mahmud, TA, CSE 305.
Holding slide prior to starting show. A Grid-based Problem Solving Environment for GECEM Maria Lin and David Walker Cardiff University Yu Chen and Jason.
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
Towards a Javascript CoG Kit Gregor von Laszewski Fugang Wang Marlon Pierce Gerald Guo
1. Introduction  The JavaScript Grid Portal is trying to find a way to access Grid through Web browser, while using Web 2.0 technologies  The portal.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Andrew J. Younge Golisano College of Computing and Information Sciences Rochester Institute of Technology 102 Lomb Memorial Drive Rochester, New York
CoG Kit Overview Gregor von Laszewski Keith Jackson.
Copyright 2007 Adobe Systems Incorporated. 1 ColdFusion 8 : Advanced AJAX Development Rakshith N Computer Scientist Jan 02, 2008.
The gLite API – PART I Giuseppe LA ROCCA INFN Catania ACGRID-II School 2-14 November 2009 Kuala Lumpur - Malaysia.
Grids and Portals for VLAB Marlon Pierce Community Grids Lab Indiana University.
Job Submission Condor, Globus, Java CoG Kit Young Suk Moon.
23:48:11Service Oriented Cyberinfrastructure Lab, Grid Portals Fugang Wang April 29
Through the development of advanced middleware, Grid computing has evolved to a mature technology in which scientists and researchers can leverage to gain.
Towards a unified Cyberaide architecture Fugang Wang May 29, 2009.
GRAM5 - A sustainable, scalable, reliable GRAM service Stuart Martin - UC/ANL.
Javascript Cog Kit By Zhenhua Guo. Grid Applications Currently, most grid related applications are written as separate software. –server side: Globus,
Image Management and Rain on FutureGrid: A practical Example Presented by Javier Diaz, Fugang Wang, Gregor von Laszewski.
Image Management and Rain on FutureGrid Javier Diaz - Fugang Wang – Gregor von.
Experiment Management with Microsoft Project Gregor von Laszewski Leor E. Dilmanian Acknowledgement: NSF NMI, CMMI, DDDAS
CSC 2720 Building Web Applications Server-side Scripting with PHP.
Introduction to Client-Side Web Development Introduction to Client-Side programming using JavaScript JavaScript; application examples 10 th February 2005.
Homework Assignment #1 J. H. Wang Oct. 13, Homework #1 Chap.1: 1.24 Chap.2: 2.13 Chap.3: 3.5, 3.13* (or 3.14*) Chap.4: 4.6, 4.12* –(*: optional.
1 Grid Portal for VN-Grid Cu Nguyen Phuong Ha. 2 Outline Some words about portals in principle Overview of OGCE GridPortlets.
Holding slide prior to starting show. A Portlet Interface for Computational Electromagnetics on the Grid Maria Lin and David Walker Cardiff University.
Java Commodity Grid (Java CogKit) Java CogKits allow developers to use commodity technologies such as Java or Python in programming the Grid based on Globus.
© Geodise Project, University of Southampton, Geodise Middleware & Optimisation Graeme Pound, Hakki Eres, Gang Xue & Matthew Fairman Summer 2003.
1 Web Servers (Chapter 21 – Pages( ) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System Architecture.
OGCE Components for Enhancing UltraScan Job Management. Suresh Marru,Raminder Singh, Marlon Pierce.
10:47:46Service Oriented Cyberinfrastructure Lab, Grid Job Management with Microsoft Project Leor Dilmanian
ICM – API Server & Forms Gary Ratcliffe.
© Geodise Project, University of Southampton, Geodise Middleware Graeme Pound, Gang Xue & Matthew Fairman Summer 2003.
Grid Interoperability Update on GridFTP tests Gregor von Laszewski
Korea Workshop May GAE CMS Analysis (Example) Michael Thomas (on behalf of the GAE group)
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
© Geodise Project, University of Southampton, Geodise Compute Toolbox Functions CommandFunctionCommandFunction gd_certinfo.
AJAX Use Cases for WSRP Subbu Allamaraju BEA Systems Inc WSRP F2F Meeting, May 2006.
The Gateway Computational Web Portal Marlon Pierce Indiana University March 15, 2002.
Daniele Spiga PerugiaCMS Italia 14 Feb ’07 Napoli1 CRAB status and next evolution Daniele Spiga University & INFN Perugia On behalf of CRAB Team.
Grappling Cloud Infrastructure Services with a Generic Image Repository Javier Diaz Andrew J. Younge, Gregor von Laszewski, Fugang.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
PythonCyc and other APIs A Python package to access Pathway Tools and its data using the Python programming language Mario Latendresse March 2016.
Web Services Essentials. What is a web service? web service: software functionality that can be invoked through the internet using common protocols like.
NCCUCS 軟體工程概論 Lecture 5: Ajax, Mashups April 29, 2014.
National College of Science & Information Technology.
Writing Grid Portlets.
Building Science Gateways and Managing Workflows with the Open Grid Computing Environment Toolkit Marlon Pierce, Suresh Marru, Zhenhua Guo, Fugang Wang,
Tutorial 10: Programming with javascript
Production Manager Tools (New Architecture)
Presentation transcript:

Using Cyberaide JavaScript to develop Ajax based Grid Apps – A Tutorial for Grid App Developers Gregor von Laszewski Fugang Wang Jun 22, 2009

Agenda  Prerequisite to use the framework for your development  How to use the JavaScript API to interact with Grid  Authentication; job/workflow submission and status monitor; file transfer, etc.  Mashup with other useful resources  Expand the mediator functionality while reusing the architecture

 Prerequisite to use the framework for your development  How to use the JavaScript API to interact with Grid  Authentication; job/workflow submission and status monitor; file transfer, etc.  Mashup with other useful resources  Expand the mediator functionality while reusing the architecture

 Please setup the three-tier cyberaide JavaScript framework first. A full instruction can be found at:  The framework has Mediator service, Agent, and a web client[1]. Your app will be a web client while based on the Cyberaide JavaScript API. [1] von Laszewski, G., Wang, F., Younge, A., He, X., Guo, Z., & Pierce, M. (2008). Cyberaide JavaScript: A JavaScript Commodity Grid Kit. Paper presented at the GCE08 at SC08, Austin, TX

Agenda  Prerequisite to use the framework for your development  How to use the JavaScript API to interact with Grid  Authentication; job/workflow submission and status monitor; file transfer, etc.  Mashup with other useful resources  Expand the mediator functionality while reusing the architecture

The usage of the Cyberaide JavaScript toolkit is shown through code snipes. The code itself is not runnable. Please setup the three-tier cyberaide JavaScript framework first as mentioned previously, and put the code snipes into your code where you want to fulfill the functionality. An Ajax Teragrid portal example developed based on the architecture and JavaScript API

// construct authenticator object for authentication using myproxy // make sure to use the attributes keys specified here. var auth = org.cyberaide.js.jsAuthenticator(url); auth.setAttribute("host", "myproxy.teragrid.org"); auth.setAttribute("port", 7512); auth.setAttribute("user", ’YOURTGUSERNAME'); auth.setAttribute("password", ’YOURPASSWORD'); // currently only 'myproxy' is supported auth.setProvider("myproxy");  How to authenticate through the Cyberaidejs?

// construct cyberaidejs object by pointing to the Agent service's url // Your call through the JavaScript API will be conducted to this Web service // Refer to the installation instruction for the ‘url’. var url = "../axis2/services/AgentService”; //If you followed each step, the url should be like this var cyberaidejs = new org.cyberaide.js.jsUtil(url); // authentication cyberaidejs.authenticate(auth, authResponse); // authResponse is the callback function handler

/* * the authenticate callback function */ function authResponse(ret) { if(ret){ //authenticated successfully! //put your code here } else{ //authentication failed //put your code here }

// define the job object //make sure to use the attributes keys specified here. var execObj = new org.cyberaide.js.jsExecutable(); execObj.setAttribute("cmd", "/bin/ls"); execObj.setAttribute("arg", "-l"); execObj.setAttribute("rHost", 'REMOTEHOST'); execObj.setAttribute("stdout", "lsoutput"); execObj.setAttribute("provider", "GT4"); // construct cyberaidejs object by pointing to the agent service's url var cyberaidejs = new org.cyberaide.js.jsUtil(url);  How to submit a job to remote machine to execute?

// construct a remote job through the executable object var strProj = cyberaidejs.constructRemoteJob(execObj); // submit the job by specifying constructed job specification, callback function. // you must be in authenticated status and in a valid session. cyberaidejs.submit(strProj, submitResponse); // submitResponse is the callback function handler

/* * callback function of submission */ function submitResponse(ret) { if(ret > 0){ //job submitted and job id returned. //your job id is 'ret', in Number format //do something here. } else { //job submission failed. //do something here. }

// Construct your Karajan workflow // var strProj =...; // assign the Karajan workflow to this string and submit it. // you must be in authenticated status and in a valid session. cyberaidejs.submit(strProj, submitResponse, null); // Construct cyberaidejs object by pointing to the agent service's url var cyberaidejs = new org.cyberaide.js.jsUtil(url); // callback function could be the same as in job submission  How to submit a workflow (in Karajan format)?

// construct cyberaidejs object by pointing to the agent service's url var cyberaidejs = new org.cyberaide.js.jsUtil(url); // Invoke the list function //do this only after you have been authenticated and in a valid session. cyberaidejs.list(listResponse); // listResponse is the callback function handler  How to query job/workflow list that user submitted?

/* * call back for submitted jobs listing */ function listResponse(jsonRet){ if(jsonRet != null){ var jsonRetObj = eval("(" + jsonRet + ")"); var wfids = jsonRetObj.wfids; var numIds = wfids.length; //now you got the jobs list with 'numIds' items in an array wfids //do something here. } // the jsonRet is in JSON format {"wfids": String[]}

// construct cyberaidejs object by pointing to the agent service's url var cyberaidejs = new org.cyberaide.js.jsUtil(url); // and then query the status with its id // do this only after you have submitted some job/workflow cyberaidejs.statusQuery(wfid, statusQueryResponse); // statusQueryResponse is the callback function handler  How to query job/workflow execution status?

/* * callback function of status query, to display the status info */ function statusQueryResponse(jsonRet){ if(jsonRet != null){ var jsonRetObj = eval("(" + jsonRet + ")") var wfid = jsonRetObj.wfid; var status = jsonRetObj.status; //now you get the workflowid and its current status, in a 'Number' format, //representing jobs finished so far in the workflow. //do something here. } // the jsonRet is in JSON format {"wfid":String,"status":String}

// construct cyberaidejs object by pointing to the agent service's url var cyberaidejs = new org.cyberaide.js.jsUtil(url); // call the queryOutput function // do this only after you have been authenticated and in a valid session. cyberaidejs.queryOutput(wfid, queryOutputResponse); // statusQueryResponse is the callback function handler  How to query output fileNAME of a job/workflow?

/* * display the returned output file names appropriately and add content retrieve links */ function queryOutputResponse(jsonRet){ if(jsonRet != null){ var jsonRetObj = eval("(" + jsonRet + ")"); var wfid = jsonRetObj.wfid; var resultFiles = jsonRetObj.resultFiles; //the result output file names for job/workflow with id 'wfid' have been stored //into array 'resultFiles' //you can display the filenames or get the REAL output through getOutput() method. } return false; } // the jsonRet is in JSON format {"wfid":String,"outputFiles":String[]}

// construct cyberaidejs object by pointing to the agent service's url var cyberaidejs = new org.cyberaide.js.jsUtil(url); // call the getOutput function // do this only after you have been authenticated and in a valid session. // wfid and filename specified job/workflow id and (one of) its output filename obtained through queryOutput cyberaidejs.getOutput(wfid, filename, getOutputResponse); // getOutputResponse is the callback function handler  How to get a specific output from a job/workflow execution?

/* * processing the returned output */ function getOutputResponse(jsonRet){ if(jsonRet != null){ var jsonRetObj = eval("(" + jsonRet + ")"); var wfid = jsonRetObj.wfid; var filename = jsonRetObj.filename; var content = jsonRetObj.content; //now you have got the output content of an output file for the job 'wfid' //your code for further processing goes herer.. } // the jsonRet is in JSON format {"wfid":String,"outputfilename":String,"output":String}

 How to do file transfer through cyberaidejs? // construct cyberaidejs object if not done yet var cyberaidejs = new org.cyberaide.js.jsUtil(url); // Invoke transfer function // source and dest are all URI per gridftp supported format, like file://PATH, gsiftp://HOST:PORT/PATH/TO/FILE // when using file:///~, it represents the user's remote home directory at where the mediator service resides, // using gsiftp://HOST:PORT/PATH/TO/FILE to point to the location at other remote resources like those from Teragrid // do this only after you have been successfully authenticated and is in valid session cyberaidejs.transfer(source, dest, transferResponse);

/* * the transfer callback function */ function transferResponse(ret, updateloc) { if(!ret){ //Transfered successfully! //Your code goes here } else{ //Transfer failed! //Your code goes here }

 Prerequisite to use the framework for your development  How to use the JavaScript API to interact with Grid  Authentication; job/workflow submission and status monitor; file transfer, etc.  Mashup with other useful resources  Expand the mediator functionality while reusing the architecture

You can develop sophisticated Grid app/portal/scientific gateway in Ajax style based on the JavaScript API. But you also can reuse the architecture and mashup useful resources in either server side or client side.  Mashup in client side. You could integrate resources from other sites in your JavaScript/DHTML code, while using the framework and API.  Mashup in server side. Due to the Cross-site restriction of JavaScript, sometime you have to mashup resources/services in server side. You could integrate them into the Agent service java code, or using other server side tools to process the resources/services and access them through your client JavaScript.

 Prerequisite to use the framework for your development  How to use the JavaScript API to interact with Grid  Authentication; job/workflow submission and status monitor; file transfer, etc.  Mashup with other useful resources  Expand the mediator functionality while reusing the architecture

You also can expand the functionalities of the Mediator service, while using the same architecture. In this way the expanded functionalities could be easily accessed by a web client through the framework. The possible functionalities could include supporting other Grid middle ware, supporting other HPC means like CUDA, and cloud computing related technologies like VM management & Amazon EC2. Some of these activities are being conducted or planned to be researched in our lab.

eraide-javascript THANKS! For more info, please visit: