All Products
Search
Document Center

E-MapReduce:SubmitRayJob

Last Updated:Jul 08, 2026

Submits a Ray job.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /api/v1/workspaces/{workspaceId}/rayJob HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

workspaceId

string

No

The workspace ID.

w-d2d82aa09155

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request struct.

entrypoint

string

No

The startup command.

python -c "print('hello ray job')"

name

string

No

The job name.

my-job

displayReleaseVersion

string

No

The Ray DPI engine version number.

err-1.2.0 (Ray 2.55.1, Python 3.12)

tags

array<object>

No

The tags.

object

No

key

string

No

The key.

jobname

value

string

No

The value.

test

networkServiceName

string

No

The network connectivity name.

vpc

runtimeEnvJson

string

No

The Ray runtime environment JSON string.

{"pip":["requests==2.26.0","pendulum==2.1.2"],"env_vars":{"KEY":"VALUE"}}

workingDir

string

No

The URL of the job code working directory.

oss://mybucket/rayjob.zip

metadataJson

string

No

The job metadata JSON string.

{"resourceName": "test"}

submissionMode

string

No

The job submission mode.

HTTPMode

entrypointNumCpus

string

No

The number of CPUs requested by the entrypoint task.

1

entrypointNumGpus

string

No

The number of GPUs requested by the entrypoint task.

0

entrypointMemory

string

No

The memory size requested by the entrypoint task.

4Gi

entrypointResources

string

No

The custom resource request JSON string for the entrypoint task.

{"fpu": 1}

shutdownAfterJobFinishes

boolean

No

Specifies whether to automatically destroy the temporary cluster after the job is completed. Default value: true.

true

ttlSecondsAfterFinished

integer

No

The number of seconds to wait before destroying the cluster. This parameter takes effect only when shutdownAfterJobFinishes is set to true.

60

activeDeadlineSeconds

integer

No

The timeout period of the job, which includes the cluster creation time and job runtime. The job is canceled if this period is exceeded.

3600

volumeIds

array

No

The list of mount volume IDs.

string

No

The managed file ID.

vol-12345678

headSpec

object

No

The Ray cluster head node parameters.

queueName

string

No

The queue name.

root_queue

cpu

string

No

The number of CPU cores.

2

memory

string

No

The memory size. Unit: Gi.

8Gi

enableAutoScaling

boolean

No

Specifies whether to enable automatic worker scaling.

true

idleTimeoutSeconds

integer

No

The worker idle timeout period after automatic scaling is enabled.

60

gpuSpec

string

No

The GPU instance type.

ecs.gn6i-c4g1.xlarge

workerSpec

array<object>

No

The Ray cluster worker node parameters.

object

No

The worker node struct.

groupName

string

No

The worker group name.

WorkerGroup1

workerType

string

No

The worker type.

CPU

replica

integer

No

The number of workers.

2

queueName

string

No

The queue name.

root_queue

cpu

string

No

The number of CPU cores.

4

memory

string

No

The memory size. Unit: Gi.

16Gi

minReplica

integer

No

The minimum number of workers after automatic scaling is enabled.

1

maxReplica

integer

No

The maximum number of workers after automatic scaling is enabled.

10

gpuSpec

string

No

The GPU instance type.

ecs.gn6i-c4g1.xlarge

extraParam

string

No

The extra parameter JSON string.

{"userDefinedFiles": "oss://mybucket/artifact/config.json,oss://mybucket/artifact/config2.json", "userRequirementsFile": "oss://mybucket/requirements.txt"}

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The request ID.

DD6B1B2A-5837-5237-ABE4-FF0C8944

submissionId

string

Ray Job ID。

rj-k7nm8ahl5te4tg91

Examples

Success response

JSON format

{
  "requestId": "DD6B1B2A-5837-5237-ABE4-FF0C8944",
  "submissionId": "rj-k7nm8ahl5te4tg91"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.