Skip to main content

aiopcli

Project description

aiopcli

Installation

pip install aiopcli

Examples

# 単体コンテナイメージを登録
# デフォルトapi serverポートが8080

$ aiopcli image push my-image

{"imageId": "i-0123456789"}

$ aiopcli servable create --name=my-servable \
    --api-server=i-0123456789 \
    --api-port=80 \
    --liveness-endpoint=/health \
    --readiness-endpoint=/health

{"servableId": "s-z15uerp3mehdxg33"}

$ aiopcli env create --tag=test --servable=s-z15uerp3mehdxg33 --server-plan=basic
# env id 321が返却されれば、
$ aiopcli env get test
$ aiopcli env get 321
# が同じ結果を返却

# default endpointがmultipart/form-dataを受け取る場合
$ aiopcli predict test -Fimage=@invoice.png

# servableがapplication/jsonを受け取る場合
$ aiopcli predict 321 -d'{"inputs": {"array": [0, 4, 8]}}'

# 別のendpointを叩く
$ aiopcli predict 321 --endpoint=receipt/read -Fimage=@receipt.jpg

# apiコンテナログを抽出
$ aiopcli env logs 321
# 直近5分分のみ
$ aiopcli env logs 321 --since=5m
# 直近1分半分のみ
$ aiopcli env logs 321 --since=1m30s
# 推論コンテナのログ
$ aiopcli env logs 321 --container=triton-server

# この端末で登録されたenvを全て確認
$ aiopcli status

# envを削除
$ aiopcli delete test

# 推論サーバ(tritonserver, TF Servingなど)こみのコンテナイメージ登録
$ api_image=$(aiopcli image push api-server | jq -r .imageId)
$ inference_image=$(aiopcli image push inference-server | jq -r .imageId)
$ aiopcli servable create --name=my-image \
    --api-server=$api_image \
    --inference-server=$inference_image \
    --api-port=8000 \
    --metrics-port=8002 \  # tritonの場合のみ
    --liveness-endpoint=/health \
    --readiness-endpoint=/health/ready

Usage guide

基本設定で作成

aiopcli create --servable=<servable-id> --server-plan=<basic,standard,gpu_basic>

tagを付けて作成

aiopcli create --tag=<tag> --servable=<servable-id> --server-plan=<basic,standard,gpu_basic>

環境を削除

aiopcli delete <tagまたはenv_id>

単体envのステータスを確認

aiopcli status <tagまたはenv_id>

cliで作成したenvのステータスを確認

aiopcli status

プロフィール(ホスト・APIキー)を設定してコマンドを実行

aiopcli --profile=<profile> <command> <arg> ...
# または
aiopcli -p<profile> <command> <arg> ...

host・apikeyをoverrideして実行

aiopcli --host=<host> --apikey=<apikey> <command> <arg> ...
# または
aiopcli --host=<host> -k<apikey> <command> <arg> ...

custom docker imageを登録

# イメージをプッシュ
image_id=$(aiopcli image push single-custom:develop | jq -r .imageId)

# apiserver
aiopcli servable create --name=single-custom \
    --api-server=$image_id \
    --api-port=8000 \
    --liveness-endpoint=/health \
    --readiness-endpoint=/health

# apiserver & inferenceserver
aiopcli servable create --name=double-custom \
  --api-server=API_IMAGE_ID \
  --inference-server=INFERENCE_IMAGE_ID

Configuration

利用可能な環境変数

AIOP_CONFIG=~/.aiop
AIOP_LOG_LEVEL=INFO
AIOP_PROFILE=stg
AIOP_HOST=https://aiops.inside.ai
AIOP_APIKEY=ICMxJ0Z4PTtvbHE/ITd8Njk4RCgjcy5TL0E3b0YwRj83R2hXKTl8WFAiaGdpSU55fH0kd0IsOCJSZ1AwaUJuPVhWdFJvO1B0O09OQDtsOkVtPydKOnRaIUcqIm8ibFghWitiKTlxUVsqQWkkPG9lJFNbNyNrJzRoNTZzaTF7P2djMy9zKTg4JHZNMVEpQlBIayYkQTtRR2luOEIsXj1iO0JzRyJAdzBaVn1HbWNcc0k5X0JUO0tLeC1vdnRnNTVxLEJfbEEmR1lZNl97ZSZALl9FNnxDYSh+Q09WYHxDPEBqeWYhM1BUbDR5YEw0aCh3UlM6TnAxPmMhXzNnZ3YoYQ==

設定ファイルフォーマットはtoml。 デフォルト保存先: ~/.aiopAIOP_CONFIG環境変数で設定可。

# プロフィールのデフォルト
default = "stg"

# apikeyのデフォルト
apikey = "ICMxJ0Z4PTtvbHE/ITd8Njk4RCgjcy5TL0E3b0YwRj83R2hXKTl8WFAiaGdpSU55fH0kd0IsOCJSZ1AwaUJuPVhWdFJvO1B0O09OQDtsOkVtPydKOnRaIUcqIm8ibFghWitiKTlxUVsqQWkkPG9lJFNbNyNrJzRoNTZzaTF7P2djMy9zKTg4JHZNMVEpQlBIayYkQTtRR2luOEIsXj1iO0JzRyJAdzBaVn1HbWNcc0k5X0JUO0tLeC1vdnRnNTVxLEJfbEEmR1lZNl97ZSZALl9FNnxDYSh+Q09WYHxDPEBqeWYhM1BUbDR5YEw0aCh3UlM6TnAxPmMhXzNnZ3YoYQ=="

# profiles
[profiles.stg]
log_level = "INFO"

[profiles.prod]
apikey = "QDd+VC55cy1tLV4rQXo2bSZ1OXsgOnx0UzUwbDpEUEQ/UXc3cihvPmtBWHBTWj1LT1w+RXY/aCksbCthVUZGdFUzd2d6e1IrRi5zUycxKlp9YFxEdjE0PXNAXEtGVyZhOC14WWtcXXcoWls6OScxJmlkTSwrTDttc0ouIzhFLEZGJ3xFJWhpI3lpeV1iJ24nSjsyICcgRzxEIi95cGF0eU96TmheaWcobEk+RVxGX01ZYz9jfk9cbThIRyUpaXpLdDklJCR5eTVjYzwyb3F6J2pqJEZbckViNG16PHQkK3xqdUtBSjpRY1UoYiQ1MHBHLitYazUzKD52aVddXzYsbA=="

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiopcli-1.3.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

aiopcli-1.3.0-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file aiopcli-1.3.0.tar.gz.

File metadata

  • Download URL: aiopcli-1.3.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for aiopcli-1.3.0.tar.gz
Algorithm Hash digest
SHA256 127bf9f7ff463b4927c384ebe8822e93bce3f42d3f1fda683fc3813687c4b50a
MD5 fd1c17a4775951ade740fbd9e1e63aa6
BLAKE2b-256 fc5fd7f59007d0a53f9a72e784bacf2d318e9c8982139accd8927d17fec09cc9

See more details on using hashes here.

File details

Details for the file aiopcli-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: aiopcli-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for aiopcli-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f592a2c9d35029ac3bc1c535466d8a0018b4ad01b2de84a8cc0720b9bd7a75d7
MD5 630b1c9d8e039b7da1e5232b74fadad2
BLAKE2b-256 9842e9219c23018fb38d03d72ae13b3967fa9750ae4169be3d8e088a18f19746

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page