13.1. Overview of clara

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.

13.1.1. Syntax

Use the following syntax to run clara commands from you terminal window:

clara [action] [flags]
and
clara [command] [type] [flags]

where action, command, type and flags are:

  • action: Specifies an action that is taken. Valid actions are start, stop and version. These actions are explained in detail in the clara commands documentation.

  • command: Specifies the operation that you want to perform on one or more resources. Currently, clara supports the create command. Additional commands coming soon.

  • type: Specifies the resource type. Resource types are case-sensitive and must be specified in the plural form. Currently, clara supports the pipelines resource type. Support for additional resource types coming soon.

  • flags: Specifies optional or required flags. For example, you can use the –config flag to specify the location of alternate configuration.

If you need help, just run clara --help from the terminal window.

13.1.2. Actions

The folliwng table includes short descriptions and the general syntax for all of the clara actions.

Action

Syntax

Description

start

clara start

Starts the Clara Deploy SDK

stop

clara stop [-y --yes]

Stops the Clara Deploy SDK.

version

clara version

Displays the version of clara

Remember: for more information about actions enter clara [action] --help in your terminal window.

13.1.3. Commands

The following table includes short descriptions and the general syntax for all of the clara commands. This table will expand as we add support for additional commands.

Command

Syntax

Description

create

clara create [type] [flags]

Create a resource.

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

13.1.4. Resource Types

The following table includes a list of all the supported resource types. This table will expand as we add support for additional resource types.

Resource Name

API Service

Description

pipelines

Pipelines Service

References pipelines in the Clara Deploy SDK.

Remember: for more information about resource types enter clara [command] [type] --help in your terminal window.

13.1.5. Examples: Common Operations

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

# Start the Clara Deploy SDK
clara start

# Create a new pipeline
clara create pipelines -p <file | directory>

# Stop the Clara Deploy SDK
clara stop

13.1.6. Plugins

Plugins, described in more detail in the plugin overview document, extend clara functionality.

13.1.6.1. Examples: Creating and Using Plugins

Use the following set of examples to help you familiarize yourself with writing and using clara plugins:

# Create a simple plugin in any language and name the resulting executable file
# so that it begins with the prefix "clara-"
$ cat ./clara-hello
#!/bin/bash

# This plugin prints the words "hello world"
echo "hello world"

# With our plugin written, let's make it executable
$ sudo chmod +x ./clara-hello

# and move it to a location in our PATH
$ sudo mv ./clara-hello /usr/local/bin

# We have now created and "installed" a Clara plugin.
# We can begin using our plugin by invoking it from clara as if it were a regular command
$ clara hello
hello world
# We can "uninstall" a plugin by simply removing it from our PATH
$ sudo rm /usr/local/bin/clara-hello

We can think of plugins as a means to build more complex functaionlity on top of the existing kubectl commands.

By default, the following three plugins are installed with installing clara: clara-dicom, clara-render and clara-results.

13.1.6.2. Examples: Using the 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. More information about clara-dicom can be found here.

# Start the DICOM Adapter with default configuration
$ clara dicom start

# Start the DICOM Adapter with custom configuration
$ clara dicom start -f <file>

# Stop the DICOM Adapter
$ clara dicom stop

13.1.6.3. Examples: Using the clara-render Plugin

clara-render manages a cinematic render service that facilitates visualizing medical images that are output from the Clara Deploy SDK. More information about clara-render can be found here.

# Start the render service
$ clara render start

# Stop the render service
$ clara render stop

13.1.6.4. Examples: Using the clara-results plugin

clara-results manages a results service that facilitates linking output from pipelines to external services. More information about clara-results can be found here.

# Start the results service with default configuration
$ clara results start

# Start the results service with custom configuration
$ clara results start -f <file>

# Stop the results service
$ clara results stop