0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ABCIでホストしたサーバーをlocalhostで確認する

0
Last updated at Posted at 2025-11-22

ABCIについて

確認方法

複数の異なるアプリーケーションで試しました.
試行錯誤して見つけた方法なので,他に効率の良い方法があればコメントいただきたいです.

Flask

[XXXXX@hnode001]$ python app.py
実装例
app.run(debug=True, host='hnode001', port=8000)
  • インタラクティブジョブでFlaskのサーバーを起動するプログラムを実行
  • host名はインタラクティブジョブのホスト名を指定host=hnode001
  • ポート名は空いているポートを使用port=8000
local terminal 1
ssh -i "/path/identity_file" -L 10022:login:22 -l  "username" as.v3.abci.ai
  • usernameと秘密鍵への/path/identity_fileを指定
  • ポート番号10022は適宜変更してください
local terminal 2
ssh -N -L 8081:hnode001:8000 -l "username" -i "/path/identity_file" -p 10022 localhost
  • 8081: localのポート番号
  • 8000: abci側のポート番号
  • username, /path/identity_fileは同様に指定
  • 10022はterminal 1と合わせたポート番号を使用
http://localhost:8081
  • 8081にブラウザでアクセス

Rerun

sample code
import rerun as rr
import time

rr.init("rerun_test")

server_uri = rr.serve_grpc()

rr.log("world", rr.ViewCoordinates.RIGHT_HAND_Z_UP, static=True)

rr.log("world/hello_sphere", rr.Boxes3D(
    half_sizes=[1.0, 1.0, 1.0],
    centers=[0.0, 0.0, 0.0],
    colors=[255, 0, 0],
    radii=1.0,
))

while True:
    time.sleep(1.0)
  • インタラクティブジョブでrerunの可視化プログラムを実行
local terminal 1
ssh -i "/path/identity_file" -L 10022:login:22 -l  "username" as.v3.abci.ai
local terminal 2
ssh -N -L 8081:hnode001:9876 -l "username" -i "/path/identity_file" -p 10022 localhost
  • 8081: localのポート番号
  • 9876: rerunのデフォルトポート番号(pythonプログラム側で変更可能)
    上記同様
local terminal 3
rerun --connect rerun+http://127.0.0.1:8081/proxy
  • localにもrerunのpython仮想環境の準備が必須
  • port番号は8081を指定
  • 自動でrerun viewerのwindowが立ち上がる

Viser

sample code
import time

import viser


def main():
    server = viser.ViserServer()
    server.scene.add_icosphere(
        name="/hello_sphere",
        radius=0.5,
        color=(255, 0, 0),  # Red
        position=(0.0, 0.0, 0.0),
    )

    print("Open your browser to http://localhost:8080")
    print("Press Ctrl+C to exit")

    while True:
        time.sleep(10.0)

if __name__ == "__main__":
    main()

  • インタラクティブジョブでviserの可視化プログラムを実行
local terminal 1
ssh -i "/path/identity_file" -L 10022:login:22 -l  "username" as.v3.abci.ai
local terminal 2
ssh -N -L 8081:hnode001:8080 -l "username" -i "/path/identity_file" -p 10022 localhost
  • 8081: localのポート番号
  • 8080: viserのデフォルトポート番号(pythonプログラム側で変更可能)
http://localhost:8081
  • 8081にブラウザでアクセス
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?