CLI Reference

The roro CLI (Command Line Interface) allows you to start, stop, and manage your machine learning API projects.

Global flags

All the commands take a special, optional flas arguments:

  • --help: print the command's help message
  • --version: print the version number

Available commands

roro version

Displays the current version of the roro CLI client.

Usage: roro version

Output: roro, version <current-version-number>

Example

$ roro version
roro, version 0.1.10

roro login

Prompts the user for the login credentials user-id and password.

Usage: roro login

Output: Email address: <your-registered-email-address>
        Password:
        Login successful.

Options:
    --email registered email address
    --password
    --help display documentation for the command

Example

$ roro login [OPTIONS]
Email address: care@rorodata.com
Password:
Login successful.

You do not need to login when using the terminal in JupyterLab IDE.


roro projects

Displays a list of all active projects on a user's account.

Usage: roro projects [OPTIONS]

Output: List of current projects

Options:
    --help display documentation for the command

Example

$ roro projects
Email address: care@rorodata.com
Face Detection
Background Removal
Image Recognition

roro create

Create a new project.

Usage: roro create [OPTIONS] PROJECT

Output: Created project: PROJECT

PROJECT: Project name given by the user

Options:
    --help display documentation for the command

Example

$ roro create my-new-project
Created project: my-new-project

roro projects

Get a list of all projects in your workspace.

Usage: roro projects [OPTIONS]

Output: List of projects created on your account


Options: None

Example

$ roro projects
my-new-project
face-detection
background-removal

roro projects:delete

Delete a specific project from your workspace.

Usage: roro projects:delete [OPTIONS] NAME

Output: Project NAME deleted successfully

NAME: Project name given by the user

Options: None

Example

$ roro projects:delete my-new-project
Project my-new-project deleted successfully.

roro deploy

Deploy a service into production. Ensure that the deploy command is run from the same directory that contains the project roro.yml file. The deploy command looks at the roro.yml and installs all the required dependencies for the API endpoint to function flawlessly.

Usage: roro deploy [OPTIONS] 

Output: Deploying project <your-project-name>. This may take a few moments ...
        Building docker image ...done
        Updating scheduled jobs ...done
        Restarted one service.

            default: https://<your-project-name>.rorocloud.io/

        Deployed version 1 of <your-project-name>

Options:
    --help display documentation for the command

The service with name default is considered special and that specified service will be explosed at https://<your-project-name>.rorocloud.io. For services named other than default e.g. api then such services will be exposed at https://<your-project-name>--<service-name>.rorocloud.io

Example

$ roro deploy my-new-project

Deploying project my-new-project. This may take a few moments ...
Building docker image ...done
Updating scheduled jobs ...done
Restarted two services.

    default: https://my-new-project.rorocloud.io/
    api: https://my-new-project--api.rorocloud.io/

Deployed version 1 of my-new-project

What happens on roro deploy

  • All the files in the current project directory are archived and sent to rorodata platform
  • A docker image is created with the specified runtime as base image and all the dependencies in the requirements.txt (if, present) are installed
  • All the services specified in the roro.yml are (re)started and endpoints are created
  • The scheduled tasks are updated

Common errors

  • Error: Unable to find roro.yml: error implies that roro.yml is either missing or roro deploy is executed in a incorrect directory

roro ps

Shows all the processes currently running on a project. Ensure that the ps command is run from the same directory that contains the project roro.yml file.

Usage: roro ps [OPTIONS] 

Output: JOBID       STATUS     WHEN               TIME      INSTANCE TYPE    CMD
        ----------  ---------  -----------------  --------  ---------------  -------------------------------------
        <job-id-1>  success    December 20, 2017  6:07:34   S1               gunicorn webapp:server
        <job-id-2>  cancelled  December 20, 2017  5:17:24   S1               firefly -b 0.0.0.0:8080 train.predict

Options:
    -a, --all (optional string) display all the processes executed till date
    --help display documentation for the command

Example

$ roro ps

JOBID       STATUS     WHEN               TIME      INSTANCE TYPE    CMD
----------  ---------  -----------------  --------  ---------------  -------------------------------------
c733ffdd    success    December 20, 2017  6:07:34   S1               gunicorn webapp:server
43235bd4    cancelled  December 20, 2017  5:17:24   S1               firefly -b 0.0.0.0:8080 train.predict

roro run

Executes a given python script on a remote machine. By default, the command takes the smallest instance S1 - 1 Core - 1GB RAM. for more hardware options see Instances Ensure that the run command is run from the same directory that contains the project roro.yml file.

Usage: roro run [OPTIONS] [COMMAND]...

Options:
    -s, --instance-size (optional string)   size of the instance to run the job on
    --gpu               (optional string)   selectes a GPU instance     
    --help display documentation for the command

Example

$ roro run train.py
$ roro run --gpu train.py # runs the training on a GPU
$ roro --instance-size S2 train.py # runs the training on an S2 1Core - 2GB RAM machine

Common errors

  • Error: Unable to find roro.yml: error implies that roro.yml is either missing or roro deploy is executed in a incorrect directory
  • Selecting incorrect hardware. Ensure that you choose from the options provided here

roro run:notebook

Launches a Jupyter Notebook with all dependencies installed as specified in the roro.yml file and requirements.txt file in the project folder. By default, the command takes the smallest instance S1 - 1 Core - 1GB RAM. for more hardware options see Remote Machines Ensure that the run:notebook command is run from the same directory that contains the project roro.yml file.

Usage: roro run:notebook [OPTIONS] 

Output: 

Options:
    -s, --instance-size (optional string)   size of the instance to run the job on
    --gpu               (optional string)   selectes a GPU instance     
    --help display documentation for the command

By default, each project has two storage volumes in the cloud - \notebooks and \data. All the notebooks are stored in the \notebooks volume and users can store all project specific data in \data volume. Both volumes are elastic and grow on-demand.

Example

$ roro run:notebook train.py
Starting a job

Jupyter notebook is available at:
https://517832f3.rorocloud.io/?token=rorocloud

The jupyter notebook server can be stooped using:
    roro stop 517832f3

$ roro run:notebook --gpu # runs the training on a GPU
Starting a job

Jupyter notebook is available at:
https://517345f3.rorocloud.io/?token=rorocloud

The jupyter notebook server can be stooped using:
    roro stop 517345f3

$ roro --instance-size S2 train.py # runs the training on an S2 1Core - 2GB RAM machine
Starting a job

Jupyter notebook is available at:
https://51734r5.rorocloud.io/?token=rorocloud

The jupyter notebook server can be stooped using:
    roro stop 51734r5

Common errors

  • Error: Unable to find roro.yml: error implies that roro.yml is either missing or roro deploy is executed in a incorrect directory
  • Selecting incorrect hardware. Ensure that you choose from the options provided here

roro logs

Displays all the logs for a selected JOBID. Ensure that the logs command is run from the same directory that contains the project roro.yml file.

Usage: roro logs [OPTIONS] JOBID

Output: [2017-12-20 11:27:53 +0000] [5] [INFO] Starting gunicorn 19.7.1
        [2017-12-20 11:27:53 +0000] [5] [INFO] Listening at: http://0.0.0.0:8080 (5)
        ...

Options:
    -s, --show-timestamp (optional string)
    -f, --follow         (optional string)
    --help display documentation for the command

Example

$ roro logs c733ffdd

[2017-12-20 11:27:53 +0000] [5] [INFO] Starting gunicorn 19.7.1
[2017-12-20 11:27:53 +0000] [5] [INFO] Listening at: http://0.0.0.0:8080 (5)
[2017-12-20 11:27:53 +0000] [5] [INFO] Using worker: sync
[2017-12-20 11:27:53 +0000] [8] [INFO] Booting worker with pid: 8
[2017-12-20 17:35:23 +0000] [5] [INFO] Handling signal: term
...

Common errors

  • Error: Unable to find roro.yml: error implies that roro.yml is either missing or roro deploy is executed in a incorrect directory
  • Incorrect JOBID

roro config

Command to set and unset configuration and environment variables. config can be used to store secrets such as database URL, access keys for third-party services. The config variables are set in the environment of every process that is run in the projects.

Usage: roro config [OPTIONS]

Output: <your-project-name> Config Vars
        <variable-name>:<value>

Options:
    --help display documentation for the command

Example

$ roro config 
==== face-detection Config Vars
DATABASE_URL: postgres://etybe5IB9:Q0JoZYU0v@db1.exmaple.com

$ roro config:set X=s3cr3t Y=2
==== face-detection Config Vars
DATABASE_URL: postgres://etybe5IB9:Q0JoZYU0v@db1.exmaple.com
secret: s3cr3t
Y: 2

$ roro config:unset X
Updated Config Vars

$ roro config
==== face-detection Config Vars
DATABASE_URL: postgres://etybe5IB9:Q0JoZYU0v@db1.exmaple.com
Y: 2

Services are note restarted on config:set and config:unset. Services can be restarted by executing roro deploy again.


roro volumes

Display storage volumes associated with the project. Volumes are used for storing persistent data. Each project gets two volumes by default.

  • \data: store input data, intermediate data or output data
  • \notebooks: store all the Jupyter notebooks
Usage: roro volumes [OPTIONS]

Output: data
        notebooks
        <custom-volume-name>
        <custom-volume-name>
        ...

Options:
    --help display documentation for the command

Example

$ roro volumes
data
notebooks

roro volumes:add

This command is used to add a new volume to the existing project. Ensure that the volumes:add command is run from the same directory that contains the project roro.yml file.

Usage: roro volumes:add [OPTIONS] VOLUME_NAME

Output: Volume <new-volume-name> added to the <your-project-name>

Options:
    --help display documentation for the command

Example

$ roro volumes:add checkpoint
Volume checkpoint added to the face-detection

$ roro volumes
data
notebooks
checkpoint

roro volumes:remove

This command removes the specified volume from your project. Ensure that the volumes:remove command is run from the same directory that contains the project roro.yml file.

Usage: roro volumes:remove [OPTIONS] VOLUME_NAME

Output: Removes a new volume from the project

Options:
    --help display documentation for the command

Example

$ roro volumes:ls
notebooks
data
my-custom-volume

$ roro volumes:remove my-custom-volume
Volume my-custom-volume removed.
...

Default volumes \data and \notebooks cannot be removed


roro volumes:ls

This command displays all the contents of the selected volume. Ensure that the volumes:ls command is run from the same directory that contains the project roro.yml file.

Usage: roro volumes:ls [OPTIONS] VOLUME_NAME

Output: Files in the volume or a specific directory in the volume

Options:
    --help display documentation for the command

Example

$ roro volumes:ls notebooks
face-detection.ipynb

$ roro volumes:ls data:sensor_input
2017-11-25.txt
2017-11-26.txt
2017-11-27.txt
2017-11-28.txt
...

roro cp

This command to move contents between cloud storage and local folder.

Usage: roro cp [OPTIONS] SRC DEST

Output: 

Options:
    --help display documentation for the command

File upload size is restricted to 100MB, for more capacity contact us.

Example

# Downloads file from cloud to local machine
$ roro cp volume:/dataset.txt ./dataset.txt

# Uploads file from local machine to cloud
$ roro cp ./dataset.txt volume:/dataset.txt

roro stop

Command to force stop a specific job. Important to specify the JOBID for the process to be stopped.

Usage: roro stop [JOBID] 

Output: 

Options:
    --help display documentation for the command

Example

$ roro stop c733ffdd

Model management at CLI

roro models

This command displays list of all the models saved in the project. Ensure that the models command is run from the same directory that contains the project roro.yml file.

Usage: roro models [OPTIONS]

Output: List of models in the project

Options:
    --help display documentation for the command

Example

$ roro models
face-detection v1
zebra-gan v3

roro models:log

Check all the past models committed to the model repository.

Usage: roro models:log [OPTIONS] [NAME]

Output: String of key-value pairs of meta data

Options:
    -a, --all               (optional string)   Show all fields
    --help display documentation for the command

Example

$ roro models:log
Model-ID: 5a7c7b4a06a9
Model-Name: VGG16-tl-model
Model-Version: 2
Date: 2017-10-02 08:32:05.944665

        updated the face-detection model

Model-ID: e248967f260d
Model-Name: VGG16-tl-model
Model-Version: 1
Date: 2017-10-02 08:23:51.536668

        built new face-detection model

Model-ID: 93581e275bda
Model-Name: logistic-regression-model
Model-Version: 1
Date: 2017-10-02 08:07:30.016198

        built simple regression model


$ roro models:log logistic-regression-model
Model-ID: 93581e275bda
Model-Name: logistic-regression-model
Model-Version: 1
Date: 2017-10-02 08:07:30.016198

        built simple regression model

roro models:show

The command displays all the detailed meta data of a specific model.

Usage: roro models:show [OPTIONS] MODELREF

Output: String of key-value pairs of meta data

Options:
    --help display documentation for the command

Example

$ roro models:show logistic-regression-model:1
Model-ID: 93581e275bda
Model-Name: logistic-regression-model
Model-Version: 2
Date: 2017-10-02 08:07:30.016198
Categorical-Columns: grade,home_ownership,purpose
Content-Encoding: joblib
Numerical-Columns: sub_grade_num,short_emp,emp_length_num,dti,payment_inc_ratio,delinq_2yrs,delinq_2yrs_zero,inq_last_6mths,last_delinq_none,last_major_derog_none,open_acc,pub_rec,pub_rec_zero,revol_util
Test-Score: 0.811846431485

        built simple regression model

roro models:download

Command to download a specific model to your local machine.

Usage: roro models:download [OPTIONS] MODELREF

Output: Downloads model to local machine

Options:
    --help display documentation for the command

Example

$ roro models:download logistic-regression-model:1

Scheduling periodic tasks

There is support for scheduling periodic tasks such as retraining of a model at a set frequency when the new dat aarrives. Tasks are specified in the roro.yml file.

project: <your-project-name>
runtime: <runtime-choice>

tasks
    - name: <task-name>
      command: <python command> 
      size: <hardware-size>                 # optional
      when: <specify time frequency>

Example

# roro.yml

project: face-detection
runtime: python3-keras

# Train the face-detection model everyday
tasks:
    - name: train
      command: python train.py
      size: G1
      when: every day at 11:55

The when field can be written in simple English-like format, some examples below:

every day at 10:00 AM
every day at 10:00 PM
every day at 20:00
every week on sunday at 10:00 AM
every month on first day at 10:00 AM
every month on day 2 at 10:00 AM

Scheduled tasks are updated after each new deploy. To update the task frequency, edit the relevant roro.yml file.

Feedback

Help us improve the documentation. Flag errors, issues or request how-tos, guides and tutorials on our #documentation channel on our Slack