Command Line Interface (CLI)

Denzel comes with a CLI for the developers use.
At any moment you can use the --help flag to see the help menu
$ denzel --help

Usage: denzel [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  launch         Builds and starts all services
  logs           Show service logs
  logworker      Show worker log
  response       Set response manner (sync/async) and sync timeout
  restart        Restart services
  shell          Connect to service bash shell
  shutdown       Stops and deletes all services
  start          Start services
  startproject   Builds the denzel project skeleton
  status         Examine status of services and worker
  stop           Stop services
  updateosreqs   Run shell commands from requirements.sh on all services
  updatepipreqs  Update services according to requirements.txt
  updatereqs     Update services using requirements.txt and requirements.sh
For command specific help you can follow a command with the --help flag (ex. denzel launch --help)

Note

Except from the startproject command, all other commands must be executed from within project directory

startproject

Usage: denzel startproject NAME

Builds the denzel project skeleton.

NAME

Name of the project

--gpu|--no-gpu

Support for NVIDIA GPU

Default: --no-gpu

Examples

  • Start a project named “iris_classifier” with the default CPU image

    $ denzel startproject iris_classifier
    
  • Start a project named “iris_classifier” with a GPU image

    $ denzel startproject --gpu iris_classifier
    

launch

Usage: denzel launch [OPTIONS]

Builds and starts all services.

--api-port <INTEGER>

API endpoints port

Default: 8000

--monitor-port <INTEGER>

Monitor UI port

Default: 5555

Examples

  • Launch project with the default ports (8000 for API and 5555 for monitoring)

    $ denzel launch
    
  • Launch a project with 8080 as the API port

    $ denzel launch --api-port 8080
    

shutdown

Usage: denzel shutdown [OPTIONS]

Stops and deletes all services, if you wish only to stop use the stop command.

--purge|--no-purge

Discard the docker images

Default: --no-purge

Examples

  • Shutdown a denzel project, removing all containers

    $ denzel shutdown
    
  • Shutdown a denzel project, removing all containers and remove related docker images (denzel and redis)

    $ denzel shutdown --purge
    

start

Usage: denzel start

Start services

Examples

Start the application services

$ denzel start

stop

Usage: denzel stop

Stop services

Examples

Start the application services

$ denzel stop

restart

Usage: denzel restart

Restart services (equal to calling stop and then start).

Examples

Restart the denzel services

$ denzel restart

status

Usage: denzel status [OPTIONS]

Examine status of services and worker. Use this to monitor the status of your project.

--live|--no-live

Live status view

Default: --no-live

Examples

  • Examine application status, statically

    $ denzel status
    
  • View application status in a live manner, automatically updating

    $ denzel status --live
    

logs

Usage: denzel logs [OPTIONS]

Show service logs

--service [api|denzel|monitor|redis|all]

Target service

Default: all

--live|--no-live

Follow logs output

Default: --no-live

Examples

  • Examine all of the services logs, statically

    $ denzel logs
    
  • Examine only the denzel service logs, statically

    $ denzel logs --service denzel
    
  • View all of the service logs in a live manner, automatically updating

    $ denzel logs --live
    

logworker

Usage: denzel logworker [OPTIONS]

Show worker log

--live|--no-live

Follow logs output

Default: --no-live

Examples

  • Examine the worker logs, statically

    $ denzel logworker
    
  • View the worker logs in a live manner, automatically updating

    $ denzel logs --service denzel
    

shell

Usage: denzel shell [OPTIONS]

Connect to service bash shell. This is only for advanced usage, shouldn’t be used in standard scenarios.

--service [api|denzel|monitor|redis]

Target service

Default: denzel

Examples

  • Start an interactive shell session in the denzel service (default)

    $ denzel shell
    
  • Start an interactive shell session in the api service

    $ denzel shell --service api
    

updateosreqs

Usage: denzel updateosreqs

Run shell commands from requirements.sh. This command uses /bin/bash for execution and treats the file as a bash script. Notice, that due to docker and apt caching issues, if you have a apt-get install command, make sure you precede it with update, e.g. apt-get update && apt-get install <package-name>. There is no need to use sudo, these commands will run as root.

Note

Every time you call updateosreqs, all of the contents of requirements.sh will be executed.

Examples

Install htop command on all services

$ echo "apt-get update && apt-get install htop" >> requirements.sh
$ denzel updateosreqs

updatepipreqs

Usage: denzel updatepipreqs

Update services according to requirements.txt. This command always uses the pip --upgrade flag, so requirements will always be updated to the latest version. If you wish to install a specific version, specify it in the requirements.txt file. This command will initiate a restart so updates will apply.

Examples

Update the Python packages using the requirements.txt file

$ denzel updatepipreqs

updatereqs

Usage: denzel updatereqs

Updates services according to requirements.txt and requirements.sh, equivalent to calling updatepipreqs and updateosreqs consecutively, but faster.

Examples

Update the Python packages using requirements.txt and execute shell script requirements.sh

$ denzel updatereqs

response

Usage denzel response [OPTIONS]

Set response manner (sync/async) and sync timeout

--sync|--async

Responses synchronicity [required]

--timeout

Sync response timeout in seconds

Default: 5.0

Examples

  • Set synchronous response mode (default)

    $ denzel --sync
    
  • Set asynchronous response mode with the default response timeout of 5 seconds

    $ denzel --async
    
  • Set asynchronous response mode with response timeout of 10 seconds

    $ denzel --async --timeout 10