Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What is going on with this article?
@daikumatan

Rescale CLI を利用する

More than 3 years have passed since last update.

Rescale CLI を用いてAPIをキックし、ジョブを投入してみます。

0. API キーの取得

Rescaleにログイン後下記ステップで、APIキーを取得します。
この機能はエンタープライズバージョン限定の機能となっています。

  1. 画面右上のアカウント名をクリックします
  2. 設定をクリックします
  3. 画面左、APIをクリックします
  4. CLI から rescale.jar をダウンロードし、任意の場所に保存しました。私はMacですが、この例では /usr/local/bin/rescale.jar に保存したとし、以後記述します。
  5. 画面に従い APIキーを作成します。ドキュメントもダウンロードしておくと便利です。

Kobito.QmeKP7.png

1. Rescale API を用いた Hello world ジョブの投入

1.1 環境の設定

API-Keyの決定
TOKEN='<ブラウザから生成したAPIキー>'
Regionの決定
REGION="https://platform.rescale.jp/"

1.2 ランスクリプトの作成

ランスクリプト名の決定
SUBMIT='submit.sh'
runscriptの作成
cat << EOF > ${SUBMIT}
#!/bin/sh -f
#RESCALE_NAME="HelloWorld"
#RESCALE_CORES=1

echo "HelloWorld!" > hello_world
sleep 1000
EOF

1.3 Rescale CLI を用いた Hello world Job の投入

Jobの投入
java -jar /usr/local/bin/rescale.jar \ 
    -X ${REGION} submit \
    -p ${TOKEN} \
    -E -i ${SUBMIT}
result
2016-09-18 20:00:04,281 - Running SGE version of Rescale Client App
2016-09-18 20:00:04,293 - Executing Command.
2016-09-18 20:00:04,296 - Parsing Input Files
2016-09-18 20:00:04,296 - No existing files to include
2016-09-18 20:00:04,790 - No core type specified by user. Using default core type 'Nickel'
2016-09-18 20:00:04,793 - Did not find explicitly specified analysis, checking implicitly selected analyses
2016-09-18 20:00:04,793 - No implicitly selected analyses, assuming user-included analysis
2016-09-18 20:00:04,795 - Zipping Files
2016-09-18 20:00:04,795 - Creating temporary encrypted zip at /Users/daisuke/Documents/tmp/rescaleAPI/input.zip
2016-09-18 20:00:04,814 - Finished writing encrypted file
2016-09-18 20:00:04,814 - Uploading Files
2016-09-18 20:00:04,816 - Uploading: /Users/daisuke/Documents/tmp/rescaleAPI/run.sh
2016-09-18 20:00:04,817 - Uploading run.sh:
2016-09-18 20:00:07,665 - ##############################| 112B / 112B         
2016-09-18 20:00:08,207 - Uploading: /Users/daisuke/Documents/tmp/rescaleAPI/input.zip
2016-09-18 20:00:08,207 - Uploading input.zip:
2016-09-18 20:00:08,394 - ##############################| 1.22KB / 1.22KB     
2016-09-18 20:00:08,747 - Job: Saving Job
2016-09-18 20:00:09,246 - Job fWgWa: Saved
2016-09-18 20:00:09,246 - Job fWgWa: Submitting
2016-09-18 20:00:10,146 - Job fWgWa: Starting polling cycle
2016-09-18 20:01:10,328 - Job fWgWa: Status - Validated
2016-09-18 20:02:10,515 - Job fWgWa: Status - Validated
2016-09-18 20:03:10,686 - Job fWgWa: Status - Validated
2016-09-18 20:04:10,875 - Job fWgWa: Status - Validated
2016-09-18 20:05:11,068 - Job fWgWa: Status - Completed
2016-09-18 20:05:11,068 - Job fWgWa: Finished...
2016-09-18 20:05:11,068 - Job fWgWa: Downloading files to /Users/daisuke/Documents/tmp/rescaleAPI/output
2016-09-18 20:05:11,618 - Downloading output/file0
2016-09-18 20:05:11,618 - Downloading file0:
2016-09-18 20:05:12,475 - ##############################| 16B / 16B           
2016-09-18 20:05:12,475 - Downloading output/hello_world
2016-09-18 20:05:12,475 - Downloading hello_world:
2016-09-18 20:05:12,588 - ##############################| 16B / 16B           
2016-09-18 20:05:12,588 - Downloading output/inputs/file1
2016-09-18 20:05:12,588 - Downloading file1:
2016-09-18 20:05:12,715 - ##############################| 16B / 16B           
2016-09-18 20:05:12,716 - Downloading output/submit.sh
2016-09-18 20:05:12,716 - Downloading submit.sh:
2016-09-18 20:05:12,825 - ##############################| 112B / 112B         
2016-09-18 20:05:12,825 - Downloading output/run.sh
2016-09-18 20:05:12,825 - Downloading run.sh:
2016-09-18 20:05:12,996 - ##############################| 112B / 112B         
2016-09-18 20:05:12,996 - Downloading output/rescale-submit
2016-09-18 20:05:12,996 - Downloading rescale-submit:
2016-09-18 20:05:13,107 - ##############################| 320B / 320B         
2016-09-18 20:05:13,107 - Downloading output/process_output.log
2016-09-18 20:05:13,108 - Downloading process_output.log:
2016-09-18 20:05:13,237 - ##############################| 256B / 256B         
2016-09-18 20:05:13,237 - Downloading output/inputs/file2
2016-09-18 20:05:13,237 - Downloading file2:
2016-09-18 20:05:13,344 - ##############################| 16B / 16B           
2016-09-18 20:05:13,428 - Finished downloading files.

ハマりどころ

日本の場合、上記でちゃんと -X "https://platform.rescale.jp/" と指定する必要があります。
これをしないと"https://platform.rescale.com/" とjpではなくcom (US) に接続しようとして、認証が通りません。

2
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
daikumatan
2002-2015: Fujixerox, Numerical simulation Engineer 2015-2016: NVIDIA Japan, BD Manager 2016-2020: Rescale Japan, Evangelist 2020-Present: XTREME-D, CTO

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
2
Help us understand the problem. What is going on with this article?