NGC | Catalog
CatalogResourcesClara Deploy CLI [Deprecated]

Clara Deploy CLI [Deprecated]

Logo for Clara Deploy CLI [Deprecated]
Description
The Clara CLI package contains a set of command line tools to setup and manage the Clara Platform
Publisher
NVIDIA
Latest Version
0.8.1-2108.1
Modified
April 4, 2023
Compressed Size
75.64 MB

Clara Deploy SDK is being consolidated into Clara Holoscan SDK

More info https://catalog.ngc.nvidia.com/orgs/nvidia/teams/clara/collections/claradeploy

Clara SDK CLI

This asset requires the Clara Deploy SDK. Follow the instructions on the Clara Ansible page to install the Clara Deploy SDK.

Overview

clara is a command line interface for managing and interacting with the Clara Deploy SDK. clara looks for a file named config.yaml in ~/.clara/. You can specify alternate configuration by setting the --config flag and can point to a remote host using the --host flag. You can execute commands with --verbose flag to get command output with additional details.

Installation

Clara CLI itself does not have any prerequisites in general, but there can be prerequisites depending on the functionality of CLI you want to use. For example, if you want to create a pipeline, then Clara Platform must be running for the command to function successfully.

Download the latest cli.zip file and extract the binaries into /usr/bin/

sudo unzip cli.zip -d /usr/bin/ && sudo chmod 755 /usr/bin/clara*

Generate clara completion script for Bash

sudo bash -c 'clara completion bash > /etc/bash_completion.d/clara-completion.bash' && exec bash

Configure CLI

Configure clara CLI to use your NGC credentials.

clara config --key NGC_API_KEY [--orgteam NGC_ORG/NGC_TEAM] [-y|--yes]

Please note the slash (/) between ORG and TEAM. If --orgteam is not specified, the orgteam defaults to 'nvidia/clara' which points to the publicly available Clara NGC artifacts.

Configuration for Private NGC Org/Team

If the desired Clara component (e.g. platform, render server, etc.) resides in a private org/team within NGC, ensure to run clara config with the correct private --orgteam parameter otherwise Kubernetes will fail to pull the container image for the desired Clara component.

Commands

The following table includes short descriptions and the general syntax for all of the clara commands.

Command Syntax Description
cancel clara cancel [flags] Cancel a resource
config clara config [flags] Configures NGC credentials for CLI
create clara create [type] [flags] Create a resource.
delete clara delete [type] [flags] Delete a resources.
describe clara describe [type] [flags] Describe a resource.
download clara download JOB_ID:SRC_PATH [DEST_PATH] [flags] Download files associated with a job.
list clara list [type] [flags] List all instances of specified resource type.
logs clara logs [flags] Read clara job operator logs.
start clara start [type] [flags] Start a resource.
upload clara upload [flags] Upload a resource
version clara version Displays the clara cli and clara platform version info

For more information about commands enter clara [command] --help in your terminal window.

Examples: Common Operations

Use the following set of examples to help you familiarize yourself with running the commonly used clara operations:

# Configures NGC credentials for use by CLI. Default 'orgteam' is 'nvidia/clara'
$ clara config --key NGC_API_KEY [--orgteam NGC_ORG/NGC_TEAM] [-y|--yes]

# Upload model
$ clara create model -p [MODEL_DIRECTORY] -t [MODEL_TYPE] [--raw]

# List models
$ clara list models

# Delete model(s)
$ clara delete models [MODEL_ID]...

# Upload model
$ clara create model -p [MODEL_DIRECTORY] -t [MODEL_TYPE] [--raw]

# List models
$ clara list models

# Delete model(s)
$ clara delete models [MODEL_ID]...

# Create a new pipeline
$ clara create pipeline -p PIPELINE_DEFINITION_FILE

# See the pipeline definition being used
$ clara describe pipeline -p PIPELINE_ID

# Create a new job
$ clara create job -n NAME -p PIPELINE_ID [-f [FILE | DIRECTORY]] [-i JOB_PRIORITY] [--start]

# Start a created job
$ clara start job -j JOB_ID [-a KEY=VALUE]...

# Get job status and associated information
$ clara describe job -j JOB_ID

# Get list of all jobs
$ clara list jobs [--all] | [--canceled] | [--evicted] | [--faulted] | [--healthy] | [--pending] | [--running] | [--stopped] | [--terminated] | [--quiet]

# Get list of all pipelines
$ clara list pipeliens

# Submit request to cancel job(s)
$ clara cancel jobs [-j JOB_ID1,JOB_ID2...] [--all]

# Upload payload
$ clara upload payload -p PAYLOAD_ID -f {FILE | DIRECTORY}

# Delete payloads
$ clara delete payloads -p PAYLOAD_ID[,PAYLOAD_ID...]

Plugins

Plugins extend clara with new sub-commands, allowing for new and custom features not included in the main distribution of clara.

Installing clara plugins

A plugin is nothing more than a standalone executable file, who name begins with clara-. To install a plugin, simply move this executable file to /usr/bin.

Plugins included in cli.zip on NGC

clara-platform plugin

clara-platform plugin facilitates management of Clara Platform deployment.

# Start the Clara Deploy SDK (clara platform must be pulled for this command to work. See `clara-pull` plugin below)
$ clara platform start

# Stop the Clara Deploy SDK
$ clara platform stop [-y | --yes]

# Restart the Clara Deploy SDK
$ clara platform restart [-y | --yes]

clara-pull plugin

clara-pull facilitates installation of different Clara Components and Reference Pipelines. If version is not specified, latest version of the resource is downloaded.

# Pulls clara platform helm charts and configures CLI
$ clara pull platform [ -v VERSION_NUMBER ][ -y | --yes ]

# Pulls clara dicom-adapter helm charts and configures CLI
$ clara pull dicomadapter [ -v VERSION_NUMBER ][ -y | --yes ]
$ clara pull dicom-adapter [ -v VERSION_NUMBER ][ -y | --yes ]
$ clara pull dicom [ -v VERSION_NUMBER ][ -y | --yes ]

# Install clara-renderer helm charts
$ clara pull clararenderer [ -v VERSION_NUMBER ][ -y | --yes ]
$ clara pull clara-renderer [ -v VERSION_NUMBER ][ -y | --yes ]
$ clara pull render [ -v VERSION_NUMBER ][ -y | --yes ]
$ clara pull renderer [ -v VERSION_NUMBER ][ -y | --yes ]

# Install clara-console helm charts
$ clara pull claraconsole [ -v VERSION_NUMBER ] [ -y | --yes ]
$ clara pull clara-console [ -v VERSION_NUMBER ] [ -y | --yes ]
$ clara pull console [ -v VERSION_NUMBER ] [ -y | --yes ]

# Pulls clara pipeline
$ clara pull pipeline [-v VERSION_NUMBER] [-d DESTINATION_DIR]

clara-dicom plugin

clara-dicom manages a DICOM Adapter that facilitates the input and output of DICOM files to and from the Clara Deploy SDK.

# Start the DICOM Adapter with default configuration (clara dicomadapter chart must be pulled for this command to work)
$ clara dicom start

# Start the DICOM Adapter with custom configuration
$ clara dicom start -f CONFIG-FILE

# Restart the DICOM Adapter
$ clara dicom restart [-y | --yes]

# Stop the DICOM Adapter
$ clara dicom stop [-y | --yes]

# Add (SCP) AE Title-Pipeline mapping
$ clara dicom create aetitle [-n NAME] -a AE_TITLE [-o] [-i UID1,UID2,UID3] [-p Job.Processor.Assembly.NameSpace.Class] key1=value1 key2=value2 key3=value3

# Delete (SCP) AE Title-Pipeline mapping
$ clara dicom delete aetitle -n NAME

# List all (SCP) AE Title-Pipeline mappings
$ clara dicom list aetitle

# Add DICOM Source for SCP
$ clara dicom create source -a AE_TITLE -i HOSTNAME_IP

# Delete DICOM Source of SCP
$ clara dicom delete source -n NAME

# List all DICOM Sources of SCP
$ clara dicom list source

# Add DICOM Destination for Clara SCU
$ clara dicom create destination -n NAME -a AE_TITLE -i HOSTNAME_IP -p PORT

# Delete DICOM Destination of SCU
$ clara dicom delete destination -n NAME

# List all DICOM Destinations of SCU
$ clara dicom list destination

# Get DICOM Adapter health and status
$ clara dicom status

clara-render plugin

clara-render manages a cinematic render service that facilitates visualizing medical images that are output from the Clara Deploy SDK.

# Start the render service (clara renderer chart must be pulled for this command to work)
$ clara render start

# Restart the render service
$ clara render restart [-y | --yes]

# Stop the render service
$ clara render stop [-y | --yes]

clara-console plugin

clara-console manages the Clara Management Console instance.

# Start the Clara Management Console (clara management console chart must be pulled for this command to work)
$ clara console start

# Restart the Clara Management Console
$ clara console restart [-y | --yes]

# Stop the Clara Management Console
$ clara console stop [-y | --yes]

License

An End User License Agreement is included with the product. By pulling and using the Clara Deploy asset on NGC, you accept the terms and conditions of these licenses.