Welcome to nboxβs documentation!#
Good documentation is always a work in silence.
Hi, there πΎ!
nbox
is SDK for NimbleBox.ai, it provides built in access to
all the APIs and packages them in the most user friendly manner. Writing MLOps pipelines from scratch
can be a daunting task and this is a breakdown of how nbox works. Find the complete open source code
on github. Install the package from pipy
:
pip install nbox
For convinience you should add nbox
to your path by setting up an alias. Throughout the rest of the
documentation we will be using nbx
as the CLI:
# go to your .bashrc or .zshrc and add
alias nbx="python3 -m nbox"
In order to effectively use this package, you must have a password set. You can get it by going to Profile β Reset Password.
When loading nbox
for the first time, it will prompt you the username and password and create a secrets
file at ~/.nbx/secrets.json
. This file then contains all the information that you donβt have to
fetch manually again.
APIs#
The objective is to make using ML π₯Ά. For this it is paramount that APIs be deeper, user functions be kept to minimum and most relavant. This documentation contains the full spec of everything, but hereβs all the APIs you need to know:
nbox
βββ Model # Framework agnostic Model
βΒ βββ __call__
βΒ βββ deploy
βΒ βββ train_on_instance (WIP)
βΒ βββ train_on_jobs (WIP)
βββ Operators # How jobs are combinations of operators
βΒ βββ __call__
βΒ βββ deploy
βββ Jobs # For controlling all your jobs
βΒ βββ logs # stream logs right on your terminal
βΒ βββ trigger # manually trigger a job
βββ Instance
βββ __call__ # Run any command on the instance
βββ mv (WIP) # Move files to and from NBX-Build
Though the underlying framework will keep on increasing we already use Protobufs, gRPC along with auto generating code files.
CLI#
To provide zero differences between using CLI and packages, we use python-fire that makes CLIs using python objects. Example, letβs just say you want to turn off any instance
# In case of script
Instance(i = "nbox-dev", workspace_id = "99mhf3h").stop()
# In case of CLI
nbx build --i="nbox-dev" --workspace_id="99mhf3h" stop
GET#
Or you can see the status by making GET calls from CLI along with jq
:
$ nbx get "workspace/99mhf3h/projects/2892" | tail -n 1 | jq
> {
"data": {
"auto_backup": null,
"auto_shutdown_time": -1,
"autoshutdown": false,
"clone_access": false,
"created_time": "1647858175.0",
"creator": "Bruce Wayne",
"dedicated_hw": false,
"editor": "csv2",
...
If you want to see something be added or found bug, raise an issue.
Hope you enjoy this.
Yash Bonde (NimbleBox.ai R&D)