# Presentation: 937438

## Generating caGrid  Services

***caBIG Annual Meeting ***
***Washington D.C.***
***June 2008***

***Shannon Hastings***
***David Ervin***
***Ohio State University***

## Getting Connected: An example development process using caCORE to generate a data resource.

**Create Semantically Harmonized Data Model**

**Grid-ify**

- Generate
- Data Resource

## Getting Connected: An example development process using caCORE to generate a data resource.

**Create Semantically Harmonized Data Model**

**Grid-ify**

- Generate
- Data Resource

## Introduce Vision

**The one stop shop for grid service development**
- Provide a simple, yet powerful, graphical user interface (GUI) to encapsulate complexities of grid service development
- Provide an extensible toolkit with which grid services can be created and modified graphically and programmatically

## Introduce

**A framework which enables fast and easy creation of Globus and Standards based grid services.**
**Provide easy to use graphical service authoring tool.**
**Hide all “grid-ness” from the developer.**
**Utilize best practice layered grid service architecture.**
**Handle all core service architecture requirements for strongly typed and highly interoperable grid services.**
**Toolkit for creating and manipulating strongly typed grid services**
- Command line and GUI tools for service skeleton generation and automatic service/client code generation
**Utilizes other core grid services and architecture components**
- caDSR and GME for schemas of registered data types
- Security service architecture (Dorian, GridGrouper, CSM)
- Advertisement and Registration configuration and
- 	Index Service for discovery

## Introduce Graphical Development Environment (GDE)

**GUI for creating and manipulating a grid service**
- Provides means of simple creation of service skeleton that a developer can then implement, build, and deploy
- Automatic code generation of complete WSRF compliant grid service which is configured to provide:
- Security
- Advertisement
- Discovery
- Complete UnBoxed Client API
- Provides a set of tools which enable the developer to add/remove/modify/import methods of the service as well create sub-services/resources.
- Automatic code generation of all the required code, Globus grid service code/configuration, service configuration, implementation of the client, and stubbed implementation of the service

## Introduce Requirements

**Utilize best practice layered grid service architecture**
**Enable development of strongly-typed services**
- discovery and use of published data types
- self describing services through use of metadata
- advertisement and registration configuration with Index Service
**Generate meaningful object-oriented client APIs**
**Customizable and extensible via the use of plug-ins **
**Allow for implementation of secure services**
- provide customizable service-, method-, and resource- level security

## Addressing the Requirements

**Grid Services**
- Introduce uses the Globus Toolkit and Axis for creating, registering, discovering, and invoking these service operations as grid services
- Client uses the operation through a grid service interface and does not need to be aware of any implementation specific details of the grid service

## Service Layers

## Addressing the Requirements (cont)

**Strongly typed interfaces:**
- Introduce enables schema extraction from a GME or any other data model registry service so that the wsdl, beans, and service metadata can be automatically populated and the service will be using strongly typed with publicly accessible data types.
- Data model schema, and any referenced schemas, are extracted and placed in the schema directory of the services build skeleton and imported into the services WSDL.
- types can be used at service build time to automatically generate the objects and create strongly-typed grid service interfaces

- Example from caGrid

## Addressing the Requirements (cont)

**Providing Service Metadata:**
- Leverage Globus’ use of Java Naming and Directory Interface (JNDI) in order to support WSRF.
- Service metadata is provided as resource properties on the base service’s singleton resource.
- These resource properties are defined by xml schema.

## Addressing the Requirements (cont)

**Index Service Registration**
- Leverage Globus MDS in order to configure properties on the base resource of the service to be published to an MDS based Index Service.
- Provide configuration options for registration of static and dynamic service metadata which can then be used at runtime for service discovery.

- Example from caGrid

## Addressing the Requirements (cont)

**Providing Client Side Object Oriented API**
- Globus/Axis build process will automatically generate a client side object oriented API
- Introduce generates a wrapper for this API which matches the service designers interface to make a clean mapping from client to service.
- This wrapper will handle auto boxing/unboxing of the parameters into and out of document literal form.

## Addressing the Requirements (cont)

**Security:**
- Enable configuration for each service and for each method in a service.
- Support complete GSI security configuration for authentication and support for an authorization plug-in framework.
- Require service security metadata to be available anonymously via the grid service interface (*getServiceSecurityMetadata())* or the grid service’s resource properties.

## Introduce Service Resource Contexts

**Enhanced Resource Pattern Support**
- now supports automated code generation of resource creation.
- Many bug fixes to support dynamic factory patterns to be created for creating and managing resources.

## Addressing the Requirements:Extensible Architecture

**Introduce provides an extension framework where it’s core functionality can be extended to provide customized solutions by leveraging the Introduce toolkit.**
**There are currently two types of extensions in Introduce**
- Service
- Types Discovery
**Extensions provide an “extension.xml” extension description and configuration.  The “extensions” directory of introduce hold the extensions in separate folders enabling them to easily be added and removed from the Introduce toolkit.**

## Addressing the Requirements:Extensible Architecture (cont)

**               ****Flow of execution for service extension components.**

## Introduce Software Updater

**New update support enables introduce to role updates out and move to newer versions of itself and it’s extensions.**

## Introduce Service Migration

**New Introduce Service Migration Framework enables introduce and it’s extensions to provide upgraders which can run against services built with older versions of introduce and/or it’s extensions and migrate the services forward.  **
- 1.0 services and forward will now be able to be migrated to work with newer versions of introduce with very little effort on the developers part.

## Recap Core Service Architecture

- Base service is a GT4 based WSRF capable grid service.
- Utilize compositional inheritance (in lieu of non-standard port type extensions) to enable the service to inherit required features such as providing service security metadata and access to resource properties.
- Utilize JNDI for registration configuration, server side configuration properties, and resources and resource properties.
- Provide client and service side wrappers which implement the service designers interface as opposed to the document literal interface generated by Axis.
- Provide metadata registration to the index service by configuring the Resource to register it’s service groups to a predefined MDS based Index Service.
- ServiceSecurityMetadata and it’s access operation enables programmatic bootstrapping of connection security configuration.

## Data Service Overview

**caGrid Data Services provide capability to expose data resources to the Grid**
**Specialization of caGrid grid services to expose data through a common query interface**
- Meet all base service requirements of caGrid services
**Present an object view of data sources**
- Exposed objects are registered in caDSR and their XML representation in GME
- Data Service Metadata describes information model
- Queries made with CQL Query objects
- Results returned as objects nested in a CQL Query Result Set
**Graphical Development tool, implemented as an extension to the Introduce Toolkit, is used to create the new grid service**

## Data Service Query Language

**Simple, “minimum entry” for data providers**
**Specifies a target object (result) type and selects the instances which satisfy the specified properties and nested object properties**
- Allows path navigation
- Provides logical grouping
- Provides name/predicate/value filtering on properties of objects
**Recursively defined**
**Ability to return full Objects, Set of attributes, count of results, or distinct attribute values**

## Demonstration

**A caCORE generated data resource which is not connected to the grid.**

- caBIO

- Grid

## Exposing the Resource:

**We will use the Introduce data service wizard to describe our data resource and generate a grid service.**

- caBIO

- Grid

## Exposing the Resource:

**Introduce will enable the user to browse data model in the caDSR and chose the ones which they are going to be exposing.**

- caBIO

- Grid

## Exposing the Resource:

**Then they will locate the schemas which describe the data models and will provide the wire protocol for transferring data instances.**

- caBIO

- Grid

## Exposing the Resource:

**Lastly the user will have to provide a CQL query processor to enable CQL query to be executed against the data resource. **

- caBIO

- Grid

## Exposing the Resource:

**Introduce and the caGrid Data Services Extension will create a grid service which can expose the data**
**      ****resource we described to the grid**

- caBIO

- Grid

## Data now available.

**Data now available.**

**Now that the service is generated it can be deployed so that the caCore data resource is available to the grid.**

- caBIO

- Grid

- caBIO
- Grid Service

- GridService

## How will users find me

**How will users find me**

**The services metadata needs to be registered to a caGrid Index Service so that a user/service can locate and use the service**

- caBIO

- Grid

- caBIO
- Grid Service

- GridService

## How will users find me

**How will users find me**

**When the service starts up in the container it will automatically register its metadata to a caGrid Index Service.**

- caBIO

- Grid

- caBIO
- Grid Service

- GridService

## Service Creation Demonstration

**Service Creation Demonstration**

**Service Creation Demonstration:**
**	****create a caBIO grid data service**

## Service Creation

**Populate required variables for service creation**
***Name*** = published service name
***Creation Direction*** = directory to create the skeleton
***Package*** = the java package you wish to use for your service
***Namespace Domain*** = the namespace to be used to define the service interface and types
**Choose Extensions**

## Introduce Service Creation Architecture

*The Introduce Service Properties are a set if base properties*
*required for creating this service such as desired location to *
*create the service, namespace to use, package name to use, *
*and service name.*

## Created Skeleton Layout

**Created Skeleton Layout**

- = introduce managed

- = globus/axis managed

- = developer implements

## Created Skeleton Layout (cont)

**Created Skeleton Layout (cont)**

## Created Skeleton Layout (cont)

**Created Skeleton Layout (cont)**

## Inside the Introduce created service

**Inside the Introduce created service**

**Services have many moving and configurable parts which support features such as:**
- Advertisement
- Discovery
- Invocation
- Security (Authentication/Authorization)
- Stateful Resources
**The Introduce Toolkit can keep all these features in sync as the developer creates and modifies the grid service**

## Modification

- Add/Remove/Modify
-  Operations
-  Resource properties
-  Service properties
-  Service contexts (services and resources)
-  Service, method, and resource level security settings

## Introduce Service Modification Architecture

**Introduce Service Modification Architecture**

## Service Deployment and Invocation Demonstration

**Service Deployment and Invocation Demonstration**

**Service Deployment Demonstration**
**Deploy caBIO grid service**
**Start up service container**

## Example CQL Query

**Example CQL Query**

| Return all Genes with a symbol beginning with
BRCA and have an associated Taxon with a scientificName equal to “Homo sapiens”: |
| --- |
| <CQLQuery xmlns="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
  <Target name="gov.nih.nci.cabio.domain.Gene">

  </Target>
</CQLQuery> |

## Example CQL Query

**Example CQL Query**

| Return all Genes with a symbol beginning with BRCA and have an associated Taxon with a scientificName equal to “Homo sapiens”: |
| --- |
| <CQLQuery xmlns="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
  <Target name="gov.nih.nci.cabio.domain.Gene">

      <Attribute name="symbol" predicate="LIKE“ value="BRCA%"/>

  </Target>
</CQLQuery> |

- LIKE “BRCA%”

## Example CQL Query

**Example CQL Query**

| Return all Genes with a symbol beginning with BRCA and have an associated Taxon with a scientificName equal to “Homo sapiens”: |
| --- |
| <CQLQuery xmlns="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
  <Target name="gov.nih.nci.cabio.domain.Gene">
    <Group logicRelation="AND">
      <Attribute name="symbol" predicate="LIKE“ value="BRCA%"/>
        <Association roleName="taxon“  name="gov.nih.nci.cabio.domain.Taxon">

        </Association>
    </Group>
  </Target>
</CQLQuery> |

- LIKE “BRCA%”

## Example CQL Query

**Example CQL Query**

| Return all Genes with a symbol beginning with BRCA and have an associated Taxon with a scientificName equal to “Homo sapiens”: |
| --- |
| <CQLQuery xmlns="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
  <Target name="gov.nih.nci.cabio.domain.Gene">
    <Group logicRelation="AND">
      <Attribute name="symbol" predicate="LIKE“ value="BRCA%"/>
        <Association roleName="taxon“  name="gov.nih.nci.cabio.domain.Taxon">
          <Attribute name=“scientificName" predicate=“EQUAL_TO” value=“Homo sapiens"/>
        </Association>
    </Group>
  </Target>
</CQLQuery> |

- LIKE “BRCA%”

- = “Homo sapiens”

## Service Deployment and Invocation Demonstration

**Service Deployment and Invocation Demonstration**

**Service Invocation Demonstration**
**Implement client test function**
**Invoke client with CQL query**

## Recap

**Recap**

**Created service with introduce.**
**Deployed service.**
**Started container.**
**Implemented client test function.**
**Invoked client against our new service.**

## More Information

**http://cagrid.org**
- Tutorials
- Documentation
- Software Downloads
- Support Mailing Lists
- Much Much More