CLI Reference Documentation

Last updated 3 months ago

Current version: PyPI version‚Äč

just is Clusterone's command line interface. It allows users to administrate projects, datasets, and individual jobs on Clusterone from the command line.

With version 0.11, the syntax for the stop job command has changed from just stop [options] to just stop job [options]!

Please be aware of this change and modify your scripts accordingly. The old syntax is no longer supported. See the bottom of this page for more information.

Installation & Configuration

The CLI is included with the Clusterone Python package. Install it through pip:

pip install clusterone

Enterprise

If you have a VPC or on-premise installation, you need to point the CLI to your installation.

  • Get the endpoint from your onboarding document

  • Run just config endpoint <your endpoint>, where endpoint looks like https://clusterone.com/api/. https://clusterone.com also works, the trailing /api is added automatically.

The configuration needs to be run only once, it persists through CLI launches and updates.

See the just config documentation page for more information.

Usage

This is the basic structure of a just command:

just <command> [<subcommand>...] [<arg>...] [options]

Commands can be followed by subcommands. For example, just create project [options] creates a new project, while just create dataset [options] creates a new dataset.

Some commands require a mandatory argument. For example, just rm job requires the name or ID of the job to delete: just rm job my-job.

Additionally, the just create job command allows passing custom arguments to the Python script executed by the job.

A command can have zero to multiple options, different options need to be separated by a space.

General Options

-h, --help

Display the help. To display the general help use:

just --help

To display a list of available options for each command, type:

just <command> --help

--version

Display the current version of just and exit.

New Syntax for Stop Command in v0.11

With version 0.11, the syntax for the command to stop a running job is changing from just stop [options] to just stop job [options].

The reason for this change is the introduction of Jupyter notebooks in Clusterone and the addition of notebook commands in the CLI. While in the past, just stop could only refer to jobs, you are now able to stop both jobs and notebooks. Thus, the addition of the just stop notebook command required renaming the command to stop a job.

Script Migration

If you have scripts that call the just CLI and are running on Linux or Mac, you can update your script as follows:

sed -i.bak -e 's/just stop/just stop job/' path_to_your_script

This will: a) change all occurrences of just stop to just stop job. b) create a backup file called path_to_your_script.bak located next to your script file in case you ever want to revert the script actions.

Troubleshooting

just: command not found

In some cases, the command line cannot find the just command after installing the clusterone Python package.

If you've installed the package with the --user option via pip, try running this command:

export PATH=$PATH:~/.local/bin

This will update your PATH variable to search for packages in the local user directory.

If this solves the problem, you can make the change persistent by adding it to your .bashrc / .bash_profile via:

echo "export PATH=$PATH:~/.local/bin" >> .bashrc

or

echo "export PATH=$PATH:~/.local/bin" >> .bash_profile