Ray Job Submission CLI

This section contains commands for the Ray Job Submission.

ray job submit

Submits a job to be run on the cluster.

Example:

ray job submit – python my_script.py –arg=val

PublicAPI: This API is stable across Ray releases.

ray job submit [OPTIONS] ENTRYPOINT...

Options

--address <address>

Address of the Ray cluster to connect to. Can also be specified using the RAY_ADDRESS environment variable.

--job-id <job_id>

DEPRECATED: Use – submission-id instead.

--submission-id <submission_id>

Submission ID to specify for the job. If not provided, one will be generated.

--runtime-env <runtime_env>

Path to a local YAML file containing a runtime_env definition.

--runtime-env-json <runtime_env_json>

JSON-serialized runtime_env dictionary.

--working-dir <working_dir>

Directory containing files that your job will run in. Can be a local directory or a remote URI to a .zip file (S3, GS, HTTP). If specified, this overrides the option in –runtime-env.

--no-wait

If set, will not stream logs and wait for the job to exit.

--log-style <log_style>

If ‘pretty’, outputs with formatting and color. If ‘record’, outputs record-style without formatting. ‘auto’ defaults to ‘pretty’, and disables pretty logging if stdin is not a TTY.

Options

auto | record | pretty

--log-color <log_color>

Use color logging. Auto enables color logging if stdout is a TTY.

Options

auto | false | true

-v, --verbose

Arguments

ENTRYPOINT

Required argument(s)

Warning

When using the CLI, do not wrap the entrypoint command in quotes. For example, use ray job submit --working_dir="." -- python script.py instead of ray job submit --working_dir="." -- "python script.py". Otherwise you may encounter the error /bin/sh: 1: python script.py: not found.

ray job status

Queries for the current status of a job.

Example:

ray job status <my_job_id>

PublicAPI (beta): This API is in beta and may change before becoming stable.

ray job status [OPTIONS] JOB_ID

Options

--address <address>

Address of the Ray cluster to connect to. Can also be specified using the RAY_ADDRESS environment variable.

--log-style <log_style>

If ‘pretty’, outputs with formatting and color. If ‘record’, outputs record-style without formatting. ‘auto’ defaults to ‘pretty’, and disables pretty logging if stdin is not a TTY.

Options

auto | record | pretty

--log-color <log_color>

Use color logging. Auto enables color logging if stdout is a TTY.

Options

auto | false | true

-v, --verbose

Arguments

JOB_ID

Required argument

ray job stop

Attempts to stop a job.

Example:

ray job stop <my_job_id>

PublicAPI (beta): This API is in beta and may change before becoming stable.

ray job stop [OPTIONS] JOB_ID

Options

--address <address>

Address of the Ray cluster to connect to. Can also be specified using the RAY_ADDRESS environment variable.

--no-wait

If set, will not wait for the job to exit.

--log-style <log_style>

If ‘pretty’, outputs with formatting and color. If ‘record’, outputs record-style without formatting. ‘auto’ defaults to ‘pretty’, and disables pretty logging if stdin is not a TTY.

Options

auto | record | pretty

--log-color <log_color>

Use color logging. Auto enables color logging if stdout is a TTY.

Options

auto | false | true

-v, --verbose

Arguments

JOB_ID

Required argument

ray job logs

Gets the logs of a job.

Example:

ray job logs <my_job_id>

PublicAPI (beta): This API is in beta and may change before becoming stable.

ray job logs [OPTIONS] JOB_ID

Options

--address <address>

Address of the Ray cluster to connect to. Can also be specified using the RAY_ADDRESS environment variable.

-f, --follow

If set, follow the logs (like tail -f).

--log-style <log_style>

If ‘pretty’, outputs with formatting and color. If ‘record’, outputs record-style without formatting. ‘auto’ defaults to ‘pretty’, and disables pretty logging if stdin is not a TTY.

Options

auto | record | pretty

--log-color <log_color>

Use color logging. Auto enables color logging if stdout is a TTY.

Options

auto | false | true

-v, --verbose

Arguments

JOB_ID

Required argument

ray job list

Lists all running jobs and their information.

Example:

ray job list

PublicAPI (beta): This API is in beta and may change before becoming stable.

ray job list [OPTIONS]

Options

--address <address>

Address of the Ray cluster to connect to. Can also be specified using the RAY_ADDRESS environment variable.

--log-style <log_style>

If ‘pretty’, outputs with formatting and color. If ‘record’, outputs record-style without formatting. ‘auto’ defaults to ‘pretty’, and disables pretty logging if stdin is not a TTY.

Options

auto | record | pretty

--log-color <log_color>

Use color logging. Auto enables color logging if stdout is a TTY.

Options

auto | false | true

-v, --verbose