short course on grid computing jornadas chilenas de computación 2010 infonor-chile 2010 november...

39
Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson University of North Carolina Charlotte Oct 15 2010 © Barry Wilkinson Session 5 Portal Interface Design 1

Upload: neil-austin

Post on 08-Jan-2018

219 views

Category:

Documents


0 download

DESCRIPTION

Provides access to Grid computing services: Security Services –Management of certificates Remote File Management –Access to files and directories –Moving files Remote job management –Job submission –Workflow management Grid information services –Static information (machine type, etc.) –Dynamic information (machine load, etc.) Portals also provide access to information -- anything related to tasks at hand, including communication with virtual organization. 3

TRANSCRIPT

Page 1: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Short Course on Grid Computing

Jornadas Chilenas de Computación 2010INFONOR-CHILE 2010

November 15th - 19th, 2010Antofagasta, Chile

Dr. Barry WilkinsonUniversity of North Carolina Charlotte

Oct 15 2010 © Barry Wilkinson

Session 5 Portal Interface Design

1

Page 2: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Grid Portal• Web page designed to provide a user-friendly interface to a Grid computing environment rather than a command line interface.

• Portal should:– Hide details of Grid middleware– Provides single sign-on to access to Grid computing services, distributed resources and Grid information.

2

Page 3: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Provides access to Grid computing services:• Security Services

– Management of certificates• Remote File Management

– Access to files and directories– Moving files

• Remote job management– Job submission– Workflow management

• Grid information services– Static information (machine type, etc.)– Dynamic information (machine load, etc.)

• Portals also provide access to information -- anything related to tasks at hand, including communication with virtual organization.

3

Page 4: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Portal ToolkitsA software framework and components to put together a portal easily.

•Ideally re-useable software components •Potentially components developed by others can be incorporated.•Ideally, standard interfaces should exist.•Ideally, presentation layer that the user sees should be separated in software construction from back-end.

4

Page 5: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Generating server-side dynamic contentCan use languages such as C and Java to create HTML pages.

Technologies specifically for generating server-side dynamic content :

• CGI (Common Gateway Interface)–Oldest - standard protocol between Web servers and client applications

• PHP (originally Personal Home Page, now Hypertext Preprocessor)– Scripting language specifically designed for server-side dynamic content–non-Java technology

• ASP.NET (Active Server Pages .NET framework)– Microsoft Web application framework that can provide dynamic content – Successor to ASP (Active Server Pages).– Non-Java technology

• Java Servlets• JSP (Java Server Pages)

Many Grid portals focus on Java implementations using Java Servlets/JSP5

Page 6: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Java Servlets• Small Java programs (objects) that receive requests from Web

clients and generate responses, usually handling HTTP requests/responses.

• Allows a software developer to add dynamic content to a Web server using Java platform.*

• Generate content commonly HTML but may be other data such as XML.*

• Can maintain state across server transactions by various means.

• javax.servlet package defines required methods that must be implemented for client-servlet interaction.

* http://en.wikipedia.org/wiki/Java_Servlet

6

Page 7: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Servlet container

• A Web server that provides environment for servlets

• Maps URLs to specific servlets.

servlet engine - Another term for servlet support.

e.g. Apache Tomcat with Gridsphere portal

7

Page 8: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Using Java servlets alone would typically require invoked Java programs to create HTML using println statements.

Java Server Pages (JSP)A complementary SUN technology to Java servlets .Used to create Java servlet code from static content.

•JSP file is an HTML page with embedded JSP tags.

•JSP tags provide for creating servlet Java code.

•This Java code created automatically from JSP file by JSP compiler.

•Code might be fully compiled machine-executable code or Java byte code executed by a JVM.

8

Page 9: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

JSP/Java servlet environment

9

Page 10: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Portlets• A general approach for portal design developed in

the early-mid 2000’s

• Presentational layer of portal constructed with portlets – software components

• Each portlet provides specific functionality and a window within portal

• Each portlet can be associated with a particular service

• User can have any number of portlets (will be associated with user’s persistent context).

10

Page 11: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Portlets

11

Page 12: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Portlet server and portlet container• Portlets can be compared to servlets and requires

a similar environment called a portlet container managed by a portlet server.

• In general, portlets do not communicate with each other, only with the services they front-end, and only provide for the presentation-level.

• With the portlet approach, it should be easy to reconfigure user’s view.

• Different portlets from different sources should be able to be plugged into portal.

12

Page 13: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Portlet development

Several groups developed portlet API’s including:• IBM’s Websphere portlet API’s• Open-source Apache Jetspeed project.

After early experiences of portal designs in mid-late 1990’s, effort made to develop a Java portlet specification in 2000-2002 period leading to Java Specification Request JSR 168 Portlet Specification released in Oct. 2003.

JSR 168 Based upon Apache Jetspeed portlets.

13

Page 14: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Java Specification Request JSR 168Portlet Specification

(Also called Java Portlet Specification version 1.0)

Portlet code generally has the following structure:

1. Initialize2. Render portlet3. For a request received:

Accept request and perform required back-end actionsRender display according to result

4. Finalize and destroy portlet

14

Page 15: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

15

Page 16: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

OGCE portal release 2• Core set of JSR 168 compatible Grid portlets. • Portal independent of specific container.• Two portal containers supported:

– uPortal– GridSphere

Consortium established “Fall 2003 to foster collaborations and shareable components with portal developers worldwide”

16

Page 17: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

GridSphere• Portal framework provides an open-source portlet

based Web portal.

17

Page 18: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Core GridSphere portlets•Login•Locale, profile and layout personalization• Administration portlets for creation of users, groups, portlet management•Localization support French, English, Spanish, German, Dutch, Czech, Polish, Hungarian, Italian, Arabic, Japanese, and Chinese

onto which many other portlets can be installed from various sources, for example:•myProxy server portlet,•Globus job submission and control portlets,•information services portlets•collaborative tools such as Sakai, etc.

18

Page 19: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

GridSphere portlets deployed into a servlet engine (Tomcat)

19

Page 20: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Hands-on session

• Purpose is to create and test portlets within the Gridsphere portal.

• Done on your own computer.• Need to install Tomcat and Gridsphere.

20

Page 21: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Hands-on session

• We have two versions posted:– Using GridSphere version 2 (most commonly used version)

– Using GridSphere version 3 (more recent version)

• We will use version 3 in the hands-on session which is slightly simpler to use, although here we will highlight the differences.

21

Page 22: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

8-2.22

Step 1 -- Download and Install Tomcat

Page 23: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Step 2: Download and Install Gridsphere

After downloading from:

http://localhost:8080/gridsphere/

and installing Gridsphere, need to fill in administrator set-up screen(s).

23

Page 24: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

After filling details, get Gridsphere login screen.

Similar to UNCC/UNCW Grid portal except PURSe registration portlet installed on Grid portal (a separate package)

GridSphere v 2

GridSphere v 324

Page 25: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Creating your own portlet

GoalCreate and deploy a portlet that will accept one number and say whether it is odd or even (“oddeven” portlet)

The code for this portlet is given.

You simply have to deploy it.

Later you can ceate your own portlets.

25

Page 26: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

26

Page 27: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Portlet layout

27

Page 28: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Files

Need to provide:

• Java source file that does evaluation, with• JSP file for dynamically generating HTML,

and

• Portlet deployment descriptor file(s)

28

Page 29: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

HTML/JSP file

HTML page layout defined in JSP file called MainPage.jsp

Mostly simple HTML code modified with JSP tags added at beginning.

29

Page 30: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

MainPage.jspFig 8.20 30

Page 31: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Java portletcode

public class OddEven extends ActionPortlet { private static final String DISPLAY_PAGE = "MainPage.jsp"; public void init(PortletConfig config) throws PortletException { super.init(config); DEFAULT_VIEW_PAGE = "prepare"; } public void action(ActionFormEvent event) throws PortletException { TextFieldBean value1 = event.getTextFieldBean("valueTF1"); TextBean answer = event.getTextBean("answer"); int val = Integer.parseInt( value1.getValue() ); if (value1.getValue() == null ) { answer.setValue(""); } else { if( isEven(val) ) { answer.setValue("The number: " + value1.getValue() + " is Even"); } else { answer.setValue("The number: " + value1.getValue() + " is Odd"); } } setNextState(event.getActionRequest(), DISPLAY_PAGE); } public void prepare(RenderFormEvent event) throws PortletException { setNextState(event.getRenderRequest(), DISPLAY_PAGE); } public boolean isEven(int val) { return val % 2 == 0; }}

31

Page 32: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Deployment descriptor filesGridSphere version 2 -- Three user-defined deployment descriptor files:

– Portlet.xml JSR 168 standard, describing portlet– Layout.xml GridSphere file describing layout of portlet within page– Group.xml GridSphere file describing a collection of portlets

GridSphere version 3 -- One user-defined deployment descriptor file

– Portlet.xml JSR 168 standard, describing portlet

(There are other deployment files, which generated automatically during deployment.)

32

Page 33: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

… <portlet> <description xml:lang="en">Odd Even Portlet</description> <portlet-name>OddEven</portlet-name> <display-name xml:lang="en">Odd Even Portlet</display-name> <portlet-class>edu.uncc.abw.portlets.OddEven</portlet-class> <expiration-cache>60</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>edit</portlet-mode> <portlet-mode>help</portlet-mode> </supports> <supported-locale>en</supported-locale> <portlet-info> <title>Odd Even</title> <short-title>Odd Even</short-title> <keywords>odd even</keywords> </portlet-info> </portlet></portlet-app>

Portlet.xml

Portlet

Fig 8.22 33

Page 34: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

<portlet-tabbed-pane> <portlet-tab label="Odd Even"> <title lang="en">Odd Even</title> <portlet-tabbed-pane style="sub-menu"> <portlet-tab label="oddeventab"> <title lang="en">Odd Even</title> <table-layout> <row-layout> <column-layout> <portlet-frame label="Odd Even"> <portlet-class> edu.uncc.abw.portlets.OddEven </portlet-class> </portlet-frame> </column-layout> </row-layout> </table-layout> </portlet-tab> </portlet-tabbed-pane> </portlet-tab></portlet-tabbed-pane>

Layout.xml

Specified columns and rows of a table in portlet. Components are in cells of table.

Path to portlet code(There is an alternative format using # symbol)

34

Page 35: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

group.xmlSpecifies group for portlet

<?xml version="1.0" encoding="UTF-8"?><portlet-group> <group-name>demo</group-name> <group-description>The demo group</group-

description> <group-visibility>PUBLIC</group-visibility> <portlet-role-info> <portlet-class>edu.uncc.abw.portlets.OddEven </portlet-class> <required-role>USER</required-role></portlet-role-info></portlet-group>

Group name

Portlet

Fig 8.24 35

Page 36: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

8-2.36

Directory Structure

src holds directory structure leading to java source file

webapp holds deployment descriptor files

Page 37: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

8-2.37

webapp\WEB-INF directory

Layout.xml

Portlet.xml

Group.xml

Page 38: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

JSR 286Portlets Specification v2.0

Updated version of JSR 168 released in June 2008 after about fives years of development.

Backward compatible with JSR 168 portlets

JSR 168 portlets can be deployed in JSR 286 portlet containers.

JSR 286 incorporates inter-portlet communication, which was absent in JSR 168. JSR 286 includes an alignment with WSRP version 2 (Web Services for Remote Portlets, an OASIS standard).

38

Page 39: Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson

Questions

39