Skip to content

CLI Examples

This article provides examples of popular use cases illustrating how to use the Command Line Interface (CLI)

Login

Login via run:ai sign in page (web)

You can login from the UI, if you are using SSO or credentials

runai login

Login via terminal (credentials)

runai login user -u john@acme.com -p "password"

Submitting a workload

Naming a workload

Use the commands below to provide a name for a workload.

Setting a the workload name ( my_workload_name)

runai workspace submit my-workload-name -p test -i ubuntu 

Setting a random name with prefix (prefix=workload type)

    runai workspace submit -p test -i ubuntu 

Setting a random name with specific prefix (prefix determined by flag)

runai workspace submit --prefix-name my-prefix-workload-name -p test -i ubuntu 

Labels and annotations

Labels

runai workspace submit -p test -i ubuntu --label name=value --label name2=value2

Annotations

runai workspace submit -p test -i ubuntu --annotation name=value --annotation name2=value2

Container's environment variables

runai workspace submit -p test -i ubuntu -e name=value -e name2=value2

Requests and limits

runai workspace submit  -p alon -i runai.jfrog.io/demo/quickstart-demo   --cpu-core-request 0.3 --cpu-core-limit 1 --cpu-memory-request 50M --cpu-memory-limit 1G  --gpu-devices-request 1 --gpu-memory-request 1G

Submit and attach to process

runai workspace submit  -p alon -i python  --attach -- python3

Submit a jupiter notebook

runai workspace submit --image jupyter/scipy-notebook -p alon --gpu-devices-request 1 --external-url container=8888 --name-prefix jupyter --command -- start-notebook.sh --NotebookApp.base_url='/${RUNAI_PROJECT}/${RUNAI_JOB_NAME}' --NotebookApp.token=''