Grid Computing
グリッド協議会 グリッドチュートリアル 第2回
第2回「Globus Toolkit v.4 のインストールと利用」
日本アイ・ビー・エム システムズ・エンジニアリング株式会社 松井 学
ビジネス・ユニットの名前 この文書のデータの利用または公開には、最終ページに記載されている制限事項が適用されます。 IBM Corporation I 8/4/05 2 © 2007 IBM Corporation PSU_temp_0522
Globus Toolkitで何ができるのか?
グリッドのアプリケーション/システムを構築するための道具箱
–
Grid環境での要求
•
セキュリティ
•
情報サービス
•
資源管理
•
データ管理
....
グリッドアプリケーション構築のためのライブラリー、コマンドツール群
–
システムではない
–
一部のツールだけでも選択して導入可能
•
GT
*13のなかでGT2機能のみを活用してるケース
Globus Toolkit
安全でなければならない 安全でなければならない 計算機を利用したい 計算機を利用したい データ転送したいデータ転送したい 基本機能を提供 どこに何があるか どこに何があるか *1 GT:Globus Toolkitの略ビジネス・ユニットの名前 この文書のデータの利用または公開には、最終ページに記載されている制限事項が適用されます。 IBM Corporation I 8/4/05 3 © 2007 IBM Corporation PSU_temp_0522
Globus Toolkit のアーキテクチャ
砂時計モデルによる実装の容易化
砂時計モデルによる実装の容易化
ユーザー・アプリケーション
コレクティブ・サービス
リソース
コネクティビティ
ファブリック
ツールとアプリケーション
ディレクトリ、
診断、監視
リソースと
サービスへの
セキュア・
アクセス
多様な資源
コンピュータ、ストレージ、
ネットワーク、センサーなど
Globus Toolkitビジネス・ユニットの名前 この文書のデータの利用または公開には、最終ページに記載されている制限事項が適用されます。 IBM Corporation I 8/4/05 4 © 2007 IBM Corporation PSU_temp_0522
GT4での層構造
コンピューター資源、ネットワーク資源 WS-RFを含むWebサービス Globus サービス群 OGSA サービス群 そのほか グリッドMW アプリケーション プロトコル ミドルウェア(MW) Application 基盤ソフト グリッド協議会第11回ワークショップ「Globus Worldトピック紹介(中田 秀基 氏)」資料より引用5
© 2005 IBM Japan Systems Engineering Co., Ltd.
GT4が提供する機能
• Common Runtime– GT4のweb / pre-web サービスに対する実行環境を提供
• Execution Management– ジョブの初期化、モニタリング、管理、スケジュール、調整
の機能を提供
• Data Management– データ転送、レプリケーションの機能を提供
• Information Services– グリッド上のリソース/サービスを発見、モニタリングする機
能を提供
• Security– ユーザー/サービスの認証、認可、安全な通信、クリデン
シャル管理、グループ管理の機能を提供
6
© 2005 IBM Japan Systems Engineering Co., Ltd.
GT4が提供する機能(本日の範囲)
• Common Runtime– GT4のweb
/ pre-web
サービスに対する実行環境を提供
• Execution Management– ジョブの初期化、モニタリング、管理、スケジュール、調整
の機能を提供
• Data Management– データ転送、レプリケーションの機能を提供
• Information Services– グリッド上のリソース/サービスを発見、モニタリングする機
能を提供
• Security– ユーザー/サービスの認証、認可、安全な通信、クリデン
シャル管理、グループ管理の機能を提供
7
© 2005 IBM Japan Systems Engineering Co., Ltd.
Java WS Core コンポーネント
Java Services in Apache Axis Plus GT Libraries and Handlers
Your Python Service Your Java Service GRAM RFT Delegation Index Trigger Python WS Core Your C Service C WS Core RLS Pre-WS MDS CAS Pre-WS G R AM SimpleCA MyProxy OGSA-DAI GridFTP C Services using GT Libraries and Handlers
SERVER
CLIENT
Interoperable
WS-I-compliant
SOAP messaging
Your Java Client Your C Client Your Python Client Your Java Client Your C Client Your Python Client Your Java Client Your C Client Your Python Client Your Java Client Your C Client Your Python ClientX.509 credentials =
common authentication
Python hosting, GT Libraries Java WS Core8
© 2005 IBM Japan Systems Engineering Co., Ltd.
WS Core、WSコンポーネント、カスタムサービス
• GT4のWSコンポーネントは
– WS-I準拠のメッセージングによる高い相互利用性を持つ
– GSIによる共通したセキュリティ基盤を利用
プレーンなWebサービス、WSRFベースのWebサービス、クライアントの
独自実装と組み合わせ、柔軟なアプリケーション構築が可能
Custom Web Services WS-Addressing, WSRF, WS-Notification Custom WSRF Web Services GT4 WSRF Web Services WSDL, SOAP, WS-Security User Applications Registry Administration GT4 Contai ner GRAM, RFT, MDS-Index, Trigger, MDS-Archive, CAS, Delegation,OGSA-DAI, GTCP
A Globus Primer, P.23 より抜粋
Grid Computing
Web Services Resource Framework (WSRF)
イントロダクション
Globus Toolkit v.4 (Java WS Core)の
インストールと利用
Grid Computing
注意
この章の内容は、厳密ではありません
Grid Computing
WSRFの基礎概念:
「Webサービス時代のクッキー」を出発点に
Cookie
–“Web”に追加された、”Statefull session”を実現する仕組み ショッピング・カート、申し込みフォーム、・・・
WSRF
–Webサービスに追加された、”Statefull Interaction”を実現する仕組み 「状態を保持しない実装で、状態に依存した処理を行う」 「状態に依存した処理が多い」 グリッド・コンピューティングを 「状態に依存しない実装が推奨される」 Webサービスで実現したい 状態を(他所)から取得する。そのためのIDを受け取る ID ID IDに基づく処理Grid Computing HTTP TCP IP SOAP UDP SMTP
WSRFとCookie、相違点(1):IDの埋め込み場所
SOAPヘッダー/ボディを使って、IDの受け渡しを行う
–
SOAPレイヤーより上で、”Stateful Interactionを実現する”
–
この面に関するHTTP依存を取り除く
CookieはHTTPヘッダに含まれる
–
標準的なSOAPエンジンを活用可能
Axis 2.0
WS-Addressing対応
WS-AddressingGrid Computing WS-Addressing SOAP with HTTP TCP IP UDP SMTP
WSRFとCookie、相違点(2):高度な標準化
操作の標準化
Æ “WS-Resource”(抽象概念)
「IDを使って出来ること(出来なければならないこと)」の標準化
– サーバー側の”WS-Resource”を特定できる(できなければならない) WS-Resource ≒”サービス + 状態” (後述) “Implied Resource Pattern”
– 標準化された方法で”WS-Resource”の状態を把握/ セットできる(できなければならない) WS-ResourceProperties – 標準化された方法で”WS-Resource”を破棄できる (できなければならない) WS-ResourceLifetime – ・・・ ID WS-Resource IDに基づく 標準的な処理 標準化された メッセージ ID WS DL WS-ResourceProperties, .. /e tc / services
Grid Computing
WSRFとCookie、相違点(3):高度な標準化
上位ミドルウェア、ツールにおける基礎としての役割
Globus Toolkit Version 4
Apache
その他、各上位規格の実装
「ミドルウェアが使う技術」という側面が強い
–
Globus Toolkit Version 4には、WS-Resourceを用いて実現さ
れた上位機能が含まれている
ジョブ実行
ファイル転送
…
Grid Computing
参考資料からの抜粋
WSRF:http://www.oasis-open.org/committees/wsrf/charter.php
– Web services implementations are often stateless in that they maintain no
dynamic state whose lifetime exceeds the processing of an individual message. The statelessness of Web service implementations is a valuable asset to their availability and ability to accommodate dynamic workloads.
– Web service interfaces, on the other hand, often imply the need for some form of
stateful interaction with the clients of the service. This may be manifest in a conversational style of use of a particular Web service interface in which some aspect of the result of one operation influences the execution of the next operation.
The state in interactions with such interfaces is typically contained in or referred to from the messages that are exchanged with the target service. Inferences
concerning the nature of the state may sometimes be made, but only in an
application-specific fashion and not in a generic manner that can be exploited
easily by tooling.
HTTP Cookie
– “Persistent Client State : HTTP Cookies”
http://wp.netscape.com/newsref/std/cookie_spec.html
– RFC2965: “HTTP State Management Mechanism”
This document specifies a way to create a stateful session with Hypertext
Transfer Protocol (HTTP) requests and responses. It describes three new
headers, Cookie, Cookie2, and Set-Cookie2, which carry state information between participating origin servers and user agents.
Grid Computing
Web Services Resource Framework
Globus Toolkit v.4 (Java WS Core)の
インストールと利用
17
© 2005 IBM Japan Systems Engineering Co., Ltd.
WSRF (Web Services Resource Framework)
• Webサービスでリソースを使用するためのフレームワーク
– WS-Resourceという概念の導入:
WS-Resource = Webサービス + リソース
– リソースには複数のプロパティを定義することができ、状
態を保持させることができる
イン タ ー フ ェ ー スWebサービス
リソースWS-Resource
リソース プロパティA WS-Resource
C
A
B
<process:ProcessProperties>
<process:csName> xclock </process:csName> <process:executionState> Suspended Ready </ …> <process:handle> 2824 </process:handle> <q:MayOrMayNotHaveSomeProperty> Red </…> … <wsrl:TerminationTime> 09 Nov 2005 09:45:29 GMT<…/> </process:ProcessProperties> <wsdl:portType name="Process" wsrf-rp:ResourceProperties="process:ProcessProperties"> … </wsdl:portType> WS-Resource <wsa:EndpointReference> <wsa:Address> http://some.org/AService </wsa:Address> <wsa:ReferenceParameters> <tns:process> C </tns:process> <wsa:ReferenceParameters> </wsa:EndpointReference> <wsa:EndpointReference> <wsa:Address> http://some.org/AService </wsa:Address> <wsa:ReferenceParameters> <tns:process> C </tns:process> <wsa:ReferenceParameters> </wsa:EndpointReference>
WSDM :A Web Services Stack for Management Composing WS Standards より引用 (GGF14, IBM)
19
© 2005 IBM Japan Systems Engineering Co., Ltd.
リソースを使うために必要なことは?
• 以下の4つができれば最低限のことはできる
– リソースの生成
– リソースの取得
– リソースの操作
– リソースの破棄
• 他にもいろいろあると便利ですが・・・
– 本チュートリアルでは省略します
20
© 2005 IBM Japan Systems Engineering Co., Ltd. クライアント
リソースの生成
• サービスの外部の動きは、従来のWebサービスと同様
– サービスの呼出し部分、結果の取得部分
実行環境
イン タ ー フ ェ ー スWebサービス
要求 メッセージ アドレス メッセージ要求 1 2 3 リソース id 4 応答メッセージ id 5 6 アドレス <wsa:EndpointReference> <wsa:Address>http://../CounterService</wsa:Address> <wsa:ReferenceProperties> <CounterKey>32932466</CounterKey> </wsa:ReferenceProperties> <wsa:ReferenceParameters/> </wsa:EndpointReference>21
© 2005 IBM Japan Systems Engineering Co., Ltd. クライアント
リソースの取得、操作
• WS-Resource (Webサービス+リソース)
実行環境
イン タ ー フ ェ ー スWebサービス
リソース WS-Resource 要求 メッセージ アドレス id 1 2 要求 メッセージ 3 リソース リソース id 応答 メッセージ 4 <ns1:CounterKey soapenv:mustUnderstand="0" xmlns:ns1 ="http://counter.com" xmlns:soapenv="http://schemas.xmls oap.org/soap/envelope/">32932466</ns1:CounterKey>22
© 2005 IBM Japan Systems Engineering Co., Ltd.
WSDL, SOAPメッセージからJavaオブジェクトへ
WSDL クライアント実装 スタブ サービス実装 スタブ GT4 コンテナInternet
WSDL2Java WSDL2JavaJava
オブジェクト
SOAP
メッセージ
23
© 2005 IBM Japan Systems Engineering Co., Ltd.
サービス実装の詳細
リソースの実装クラスで、 状態を保持する
サービスの実装クラス GT4 WS Java Core Design, P4 より抜粋
24
© 2005 IBM Japan Systems Engineering Co., Ltd.
サービス実装とオペレーションプロバイダ
• オペレーションプロバイダ
– サービスの機能を構成する、再利用可能なJavaオブジェ
クト
– サービス実装クラスのコーディングを軽減
– server-config.wsdd (Axisのdeployment descriptor) で指
定
CounterService +createCounter(:CreateCounter):CreateCounterResponse +add(:int):int サービスのその他の機能は、 WSDDに記述されたオペレー ションプロバイダが受け持つ25
© 2005 IBM Japan Systems Engineering Co., Ltd.
server-config.wsdd
<?xml version="1.0" encoding="UTF-8"?>
<deployment name="defaultServerConfig" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java=“http://xml.apache.org/axis/wsdd/providers/java”
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<service name="CounterService" provider="Handler" use="literal" style="document"> <parameter name="allowedMethodsClass" value="com.counter.CounterPortType"/> <parameter name="handlerClass" value="org.globus.axis.providers.RPCProvider"/> <parameter name="className“
value="org.globus.wsrf.samples.counter.CounterService"/>
<wsdlFile>share/schema/core/samples/counter/counter_service.wsdl</wsdlFile> <parameter name="scope" value="Application"/>
<parameter name="providers" value="DestroyProvider SetTerminationTimeProvid
er GetRPProvider QueryRPProvider GetMRPProvider SubscribeProvider GetCur
rentMessageProvider"/>
</service> ...
オペレーションプロバイダを 指定
26
© 2005 IBM Japan Systems Engineering Co., Ltd.
デプロイ可能な形式へのパッケージング
WSDL jndi-config.xml server-config.wsdd サービス実装 build.xml スタブクラス GARファイルコンテナへデプロイ
27
© 2005 IBM Japan Systems Engineering Co., Ltd.
実行環境
リソースの破棄 (WS-ResourceLifetime)
• 不必要になったリソースを破棄する2つの方法
– 即時破棄
– スケジュール指定による破棄
• リソースの「有効期限」を表わすプロパティを操作することで、スケ
ジュール指定による破棄を実現する
リソース 5分後破棄 リソース28
© 2005 IBM Japan Systems Engineering Co., Ltd.