「pione-client」の版間の差分
(→オプション -b) |
(→オプション一覧) |
||
(同じ利用者による、間の10版が非表示) | |||
行1: | 行1: | ||
− | '''pione-client'''とは[[ | + | '''pione-client'''とは[[PIONE定義書]]や[[隠蔽化パッケージ]]から処理を実行する[[PIONE]]の[[コマンド]]です。 |
== オプション一覧 == | == オプション一覧 == | ||
行13: | 行13: | ||
<td>location</td> | <td>location</td> | ||
<td>必須</td> | <td>必須</td> | ||
− | <td>実行する[[PIONE定義書]]または[[ | + | <td>実行する[[PIONE定義書]]または[[隠蔽化パッケージ]]</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
行32: | 行32: | ||
<td></td> | <td></td> | ||
<td>プロセス間通信で使用するIPアドレス:ポート番号</td> | <td>プロセス間通信で使用するIPアドレス:ポート番号</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>--delegate-tuple-space</td> | ||
+ | <td>なし</td> | ||
+ | <td>なし</td> | ||
+ | <td>[[タプル空間]]の管理を[[タプル空間ブローカ]]に委譲する(未実装)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
行43: | 行49: | ||
<td>FEATURES</td> | <td>FEATURES</td> | ||
<td></td> | <td></td> | ||
− | <td>特性</td> | + | <td>[[特性(PIONE)]]</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
行67: | 行73: | ||
<td>URI</td> | <td>URI</td> | ||
<td></td> | <td></td> | ||
− | <td> | + | <td>通知を受けるアドレス:ポート番号(ポート番号は省略可)</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
行73: | 行79: | ||
<td>URI</td> | <td>URI</td> | ||
<td></td> | <td></td> | ||
− | <td> | + | <td>通知として送信するブロードキャストアドレス:ポート番号(ポート番号は省略可)</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>--params</td> | <td>--params</td> | ||
− | <td></td> | + | <td>[[#オプション --params]]参照</td> |
− | <td></td> | + | <td>なし</td> |
− | <td> | + | <td>パラメータの設定</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
行90: | 行96: | ||
<td>--rehearse</td> | <td>--rehearse</td> | ||
<td>[SCENARIO]</td> | <td>[SCENARIO]</td> | ||
− | <td></td> | + | <td>デフォルトシナリオ</td> |
− | <td> | + | <td>パッケージ内で実行するシナリオ名</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
行103: | 行109: | ||
<td>N</td> | <td>N</td> | ||
<td></td> | <td></td> | ||
− | <td> | + | <td>タスクワーカの要求数</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
行115: | 行121: | ||
<td>なし</td> | <td>なし</td> | ||
<td>なし</td> | <td>なし</td> | ||
− | <td> | + | <td>スタンドアローンモード</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
行121: | 行127: | ||
<td>[BOOLEAN]</td> | <td>[BOOLEAN]</td> | ||
<td></td> | <td></td> | ||
− | <td> | + | <td>ストリームモード</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
行127: | 行133: | ||
<td>N</td> | <td>N</td> | ||
<td></td> | <td></td> | ||
− | <td> | + | <td>タスクワーカの最大プロセス起動数</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>--timeout</td> | <td>--timeout</td> | ||
<td>SEC</td> | <td>SEC</td> | ||
− | <td></td> | + | <td>0</td> |
− | <td> | + | <td>タイムアウト設定(秒)(0のときはタイムアウトしない)</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
行209: | 行215: | ||
</pre> | </pre> | ||
BaseDirディレクトリが作成され、その中に結果などが格納されています。<br> | BaseDirディレクトリが作成され、その中に結果などが格納されています。<br> | ||
+ | <br> | ||
+ | |||
+ | === オプション --dry-run === | ||
+ | <pre> | ||
+ | $ pione-client HelloWorld.pione --dry-run | ||
+ | ==> &Anonymous:Root([],{}) | ||
+ | --> Rule Application: &Anonymous:Root([],{}) | ||
+ | --> Distribution: &Anonymous:Root([],{}) | ||
+ | >>> &Anonymous:Main([],{}) | ||
+ | ==> &Anonymous:Main([],{}) | ||
+ | SH ------------------------------------------------------------ | ||
+ | SH echo "Hello PIONE world !" > message.txt | ||
+ | SH ------------------------------------------------------------ | ||
+ | <-- Distribution: &Anonymous:Root([],{}) | ||
+ | <-- Rule Application: &Anonymous:Root([],{}) | ||
+ | <== &Anonymous:Root([],{}) | ||
+ | <== &Anonymous:Main([],{}) | ||
+ | $ ls ./process/ | ||
+ | output pione-process.log | ||
+ | $ cat ./process/output/message.txt | ||
+ | $ | ||
+ | </pre> | ||
+ | ドライランモードではシェルスクリプトの実行をせず、出力ファイルを空ファイルで作成します。<br> | ||
<br> | <br> | ||
行255: | 行284: | ||
</pre> | </pre> | ||
MultiplyingInput内のデータを入力としてprocess/input内にコピーし、処理を実行しています。<br> | MultiplyingInput内のデータを入力としてprocess/input内にコピーし、処理を実行しています。<br> | ||
+ | <br> | ||
+ | |||
+ | === オプション --params === | ||
+ | ParamTest.pione | ||
+ | <pre> | ||
+ | param $val | ||
+ | |||
+ | Rule Main | ||
+ | output 'message.txt' | ||
+ | Action | ||
+ | echo "{$val}" > message.txt | ||
+ | End | ||
+ | </pre> | ||
+ | 上記の[[PIONE定義書]]は変数としてvalが宣言されてそれをmessage.txtに書き込む処理です。--paramsよりvalに値を入れて実行します。<br> | ||
+ | <br> | ||
+ | |||
+ | 実行結果<br> | ||
+ | <pre> | ||
+ | $ pione-client ParamTest.pione --params='{val:123}' | ||
+ | "{val:123}" | ||
+ | ==> &Anonymous:Root([],{}) | ||
+ | --> Rule Application: &Anonymous:Root([],{}) | ||
+ | --> Distribution: &Anonymous:Root([],{}) | ||
+ | >>> &Anonymous:Main([],{}) | ||
+ | ==> &Anonymous:Main([],{}) | ||
+ | SH ------------------------------------------------------------ | ||
+ | SH echo "123" > message.txt | ||
+ | SH ------------------------------------------------------------ | ||
+ | <-- Distribution: &Anonymous:Root([],{}) | ||
+ | <== &Anonymous:Main([],{}) | ||
+ | <-- Rule Application: &Anonymous:Root([],{}) | ||
+ | <== &Anonymous:Root([],{}) | ||
+ | $ cat process/output/message.txt | ||
+ | 123 | ||
+ | </pre> | ||
+ | val=123としてmessage.txtに書き込まれました。<br> | ||
+ | <br> | ||
+ | |||
+ | === オプション --rehearse === | ||
+ | ==== 入力ファイルの準備 ==== | ||
+ | [[シナリオ]]を含んだ[[パッケージ]]を入力ファイルとします。<br> | ||
+ | <br> | ||
+ | |||
+ | Multiplying.pione<br> | ||
+ | <pre> | ||
+ | .@ PackageName :: "Multiplying" | ||
+ | |||
+ | param val := 1 | ||
+ | |||
+ | Rule Main | ||
+ | input 'test.in' | ||
+ | output 'test.out' | ||
+ | Action | ||
+ | awk '{ print $1*{$val} }' {$I[1]} > {$O[1]} | ||
+ | End | ||
+ | </pre> | ||
+ | 上記の[[PIONE定義書]]は入力データtest.inを必要としていますので、test.inのディレクトリ名を相対パスで設定します。<br> | ||
+ | <br> | ||
+ | |||
+ | /SnarioMulti/input/test.in | ||
+ | <pre> | ||
+ | 1 | ||
+ | 2 | ||
+ | 3 | ||
+ | 4 | ||
+ | |||
+ | </pre> | ||
+ | <br> | ||
+ | |||
+ | /SnarioMulti/Scenario.pione | ||
+ | <pre> | ||
+ | .@ ScenarioName :: "Multi4" | ||
+ | .@ ParamSet :: "{val:4}" | ||
+ | </pre> | ||
+ | 今回はtest.inの値を4倍にするシナリオとしています。<br> | ||
+ | <br> | ||
+ | |||
+ | これらのファイルを[[pione package build]]でパッケージ化します。(/testディレクトリに作成した場合)<br> | ||
+ | <pre> | ||
+ | $ pione package build test/ | ||
+ | info: update the package info file: local:/test/pione-package.json | ||
+ | info: update the scenario info file: local:/test/SinarioMulti/pione-scenario.json | ||
+ | info: Package local:/Multiplying.ppg has been built successfully. | ||
+ | </pre> | ||
+ | <br> | ||
+ | |||
+ | ==== 実行結果 ==== | ||
+ | <pre> | ||
+ | $ pione-client Multiplying.ppg --rehearse "Multi4" | ||
+ | ==> &Multiplying:Root([test.in],{}) | ||
+ | --> Rule Application: &Multiplying:Root([test.in],{}) | ||
+ | --> Distribution: &Multiplying:Root([test.in],{}) | ||
+ | >>> &Multiplying:Main([test.in],{}) | ||
+ | ==> &Multiplying:Main([test.in],{}) | ||
+ | SH ------------------------------------------------------------ | ||
+ | SH awk '{ print $1*4 }' test.in > test.out | ||
+ | SH ------------------------------------------------------------ | ||
+ | <== &Multiplying:Main([test.in],{}) | ||
+ | <-- Distribution: &Multiplying:Root([test.in],{}) | ||
+ | <-- Rule Application: &Multiplying:Root([test.in],{}) | ||
+ | <== &Multiplying:Root([test.in],{}) | ||
+ | info: Rehearsal Result: Succeeded | ||
+ | </pre> | ||
+ | |||
+ | /process/output/test.out | ||
+ | <pre> | ||
+ | 4 | ||
+ | 8 | ||
+ | 12 | ||
+ | 16 | ||
+ | |||
+ | </pre> | ||
+ | test.inに対して全ての値が4倍されています。<br> | ||
+ | <br> | ||
+ | |||
+ | ==== outputの確認 ==== | ||
+ | [[シナリオ]]の中にoutputディレクトリを含めることもできますが、これは作成されたファイルとこの中のデータを比較して一致していることと存在していることを確かめることに使用します。<br> | ||
+ | |||
+ | ===== 一致する場合 ===== | ||
+ | /SnarioMulti/output/test.out | ||
+ | <pre> | ||
+ | 4 | ||
+ | 8 | ||
+ | 12 | ||
+ | 16 | ||
+ | |||
+ | </pre> | ||
+ | 上記を含めて[[パッケージ]]を作成し、実行してみます。<br> | ||
+ | <br> | ||
+ | |||
+ | <pre> | ||
+ | $ pione-client Multiplying.ppg --rehearse "Multi4" | ||
+ | ==> &Multiplying:Root([test.in],{}) | ||
+ | --> Rule Application: &Multiplying:Root([test.in],{}) | ||
+ | --> Distribution: &Multiplying:Root([test.in],{}) | ||
+ | |||
+ | -中略- | ||
+ | |||
+ | <-- Rule Application: &Multiplying:Root([test.in],{}) | ||
+ | <== &Multiplying:Root([test.in],{}) | ||
+ | info: Rehearsal Result: Succeeded | ||
+ | </pre> | ||
+ | Rehearsal Result: Succeededと表示され、出力ファイルが想定通りであると判断できます。<br> | ||
+ | <br> | ||
+ | |||
+ | ===== データが違う場合 ===== | ||
+ | /SnarioMulti/output/test.out | ||
+ | <pre> | ||
+ | 1 | ||
+ | 2 | ||
+ | 3 | ||
+ | 4 | ||
+ | |||
+ | </pre> | ||
+ | 上記を含めて[[パッケージ]]を作成し、実行してみます。<br> | ||
+ | <br> | ||
+ | |||
+ | <pre> | ||
+ | $ pione-client Multiplying.ppg --rehearse "Multi4" | ||
+ | ==> &Multiplying:Root([test.in],{}) | ||
+ | --> Rule Application: &Multiplying:Root([test.in],{}) | ||
+ | --> Distribution: &Multiplying:Root([test.in],{}) | ||
+ | |||
+ | -中略- | ||
+ | |||
+ | <-- Rule Application: &Multiplying:Root([test.in],{}) | ||
+ | <== &Multiplying:Root([test.in],{}) | ||
+ | Rehearsal Result: Failed | ||
+ | - test.out is different from expected result. | ||
+ | </pre> | ||
+ | ... is different from expected result.と表示され、出力ファイルが意図した通りでないことが分かります。<br> | ||
+ | <br> | ||
+ | |||
+ | ===== ファイルが存在しない場合 ===== | ||
+ | /SnarioMulti/output/test.output | ||
+ | <pre> | ||
+ | 4 | ||
+ | 8 | ||
+ | 12 | ||
+ | 16 | ||
+ | |||
+ | </pre> | ||
+ | 上記を含めて[[パッケージ]]を作成し、実行してみます。<br> | ||
+ | <br> | ||
+ | |||
+ | <pre> | ||
+ | $ pione-client Multiplying.ppg --rehearse "Multi4" | ||
+ | ==> &Multiplying:Root([test.in],{}) | ||
+ | --> Rule Application: &Multiplying:Root([test.in],{}) | ||
+ | --> Distribution: &Multiplying:Root([test.in],{}) | ||
+ | |||
+ | -中略- | ||
+ | |||
+ | <-- Rule Application: &Multiplying:Root([test.in],{}) | ||
+ | <== &Multiplying:Root([test.in],{}) | ||
+ | Rehearsal Result: Failed | ||
+ | - test.output doesn't exist. | ||
+ | </pre> | ||
+ | ... doesn't exist.と表示され、想定しているファイルが作成されなかったことが分かります。<br> | ||
<br> | <br> |
2015年3月31日 (火) 04:31時点における最新版
pione-clientとはPIONE定義書や隠蔽化パッケージから処理を実行するPIONEのコマンドです。
目次
オプション一覧
オプション | 型 | デフォルト | 説明 |
---|---|---|---|
引数 | location | 必須 | 実行するPIONE定義書または隠蔽化パッケージ |
-b | LOCATION | ./process/ | 処理のベースディレクトリ |
--client-ui | TYPE | Type of the client's user interface | |
--communication-address | URI | プロセス間通信で使用するIPアドレス:ポート番号 | |
--delegate-tuple-space | なし | なし | タプル空間の管理をタプル空間ブローカに委譲する(未実装) |
--dry-run | なし | なし | ドライランモード |
--features | FEATURES | 特性(PIONE) | |
--file-cache-method | NAME | simple | ファイルキャッシュ方式名: simple, no_cache |
--file-sliding | [BOOLEAN] | ファイルスライド処理 | |
-i | LOCATION | Set input directory | |
--notification-receiver | URI | 通知を受けるアドレス:ポート番号(ポート番号は省略可) | |
--notification-target | URI | 通知として送信するブロードキャストアドレス:ポート番号(ポート番号は省略可) | |
--params | #オプション --params参照 | なし | パラメータの設定 |
--parent-front | URI | set parent front URI | |
--rehearse | [SCENARIO] | デフォルトシナリオ | パッケージ内で実行するシナリオ名 |
--request-from | URI | URI that the client requested the job from | |
--request-task-worker | N | タスクワーカの要求数 | |
--session-id | ID | Session id of the job | |
--stand-alone | なし | なし | スタンドアローンモード |
--stream | [BOOLEAN] | ストリームモード | |
-t | N | タスクワーカの最大プロセス起動数 | |
--timeout | SEC | 0 | タイムアウト設定(秒)(0のときはタイムアウトしない) |
--color | BOOLEAN | true | 出力結果の文字に色を付ける |
--debug | [TYPE] | system | デバッグモードで実行 |
-h | [FORMAT] | txt | ヘルプを表示 |
-v | なし | なし | バージョンを表示 |