Rescale CLI Commands

This section provides a list of various commands the Rescale CLI App supports. You can also go through the Rescale CLI Tutorial/articles/rescale-cli-tutorial-110/ for additional information on using CLI commands. Please note the following -

  • If you set up the API key as an environemnt variable Simplifying CLI Commands page, you may omit [-p <api-token>] from the below commands.

  • Rescale CLI defaults to the US platform If you are a user on any of the other global platforms (EU, JP, KR, ITAR), please specify your regional platform using the -X flag in your CLI command. For example:

EU rescale-cli -X submit -p <api-token> -i <input-script>
Japan rescale-cli -X submit -p <api-token> -i <input-script>
Korea rescale-cli -X submit -p <api-token> -i <input-script>
ITAR rescale-cli -X submit -p <api-token> -i <input-script>
  • If you wish to get help on Rescale CLI Commands, you can use the -h flag. Example -
    rescale-cli -h

You can obtain information about Rescale Core Types and the Softwares available using the following commands and flags :

COMMAND rescale-cli list-info -<flag-type> [-p <api-token>]

-c Retrieves information about RESCALE core types
-a Retrieves information about softwares available

Submit a job

Submits a job on the Rescale platform. You can login to the Rescale platform to check the submitted job.

COMMAND rescale-cli submit [-p <api-token>] -i <input-script-file>

1) -q or --quiet Suppresses all logging output that would normally go to STDOUT. This is useful when piping the script output to another script.
2) -E or --end-to-end Runs the job end-to-end : uploading input files, submitting the job, monitoring for the results and downloading the results files.
3) -f <file1> <file2> ... <fileN> Filter output files to be downloaded after the job finishes. This flag can be used with submit only while running an end-to-end job.

Stop a job

Submits a request to cleanly shutdown the currently running job

COMMAND rescale-cli stop [-p <api-token>] -j <job-id>

Delete a job

Submits a request to delete a completed job

COMMAND rescale-cli delete [-p <api-token>] -j <job-id>

Check job status

Requests the specified job's status. Place in a loop to monitor continuously. It is recommended that an exponential backoff algorithm is used to monitor jobs that take long.

COMMAND rescale-cli status [-p <api-token>] -j <job-id>

Download files from a completed job

Downloads all the result files after the job run.

COMMAND rescale-cli sync [-p <api-token>] -j <job-id>

-s <file1> <file2> ... <fileN> Output file filtering using "string pattern matching" searching.
(Since it happens on the server side, searching more robust
and faster - Recommended)
-f <file1> <file2> ... <fileN> Output file filtering using "glob" (Happens on the client side).
*is a wildcard that will match any string of characters and
? is a wildcard that will match any single character
--exclude <file1>,<file2>, ... ,<fileN> Excludes the specified files from downloading.
-n <job-id> To sync all jobs newer than a specific job. App will create
individual directories as - rescale_job_<job-ID>
-d <sync-time> For continuous syncing, the user may specify a
sync time. The time in seconds would determine
the delay time between two sync attempts

Download files from a running job

Downloads a specific file from a running job. It downloads a copy of the file (that exists at that time) to the user's local directory in which they executed the command. Second, it will append a time stamp to the file name, the filename will be formatted as "download_{timestamp}_{original_filename}".

COMMAND rescale-cli download-file [-p <api_key>] -j <job_id> -f <filename>

-f <file1> <file2> ... <fileN> Output file filtering using "string pattern matching"
(Happens on the client side)

Upload files to Rescale cloud storage

COMMAND rescale-cli upload -p <api-token> -f <file1> ... <fileN>

-e To see an extended set of metadata during upload
--quiet To suppress non-json output from the command, if the CLI is being embedded in a larger script.
--p-cluster <cluster-id> This flag will enable the submission of additional jobs to a persistent cluster. The persistent cluster must be launched through the Web UI and must already be running. It is not possible to start a persistent cluster from the CLI. The <cluster-id> value can obtained from the Web UI URL for the specific cluster (ie<cluster-id>/status). Start by selecting the Clusters tab in the navigation bar, and then select the persistent cluster instant.
Note that this ID is not the <job-id>. Also, as with all persistent clusters, the user must terminate the cluster through the Web UI. The following image shows how to find the `: Cluster ID