forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jobs] Initial http jobs server on head node (ray-project#19657)
- Loading branch information
Showing
10 changed files
with
244 additions
and
889 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
from pydantic import BaseModel | ||
from enum import Enum | ||
|
||
|
||
class JobStatus(str, Enum): | ||
PENDING = "PENDING" | ||
RUNNING = "RUNNING" | ||
STOPPED = "STOPPED" | ||
SUCCEEDED = "SUCCEEDED" | ||
FAILED = "FAILED" | ||
|
||
|
||
class JobSpec(BaseModel): | ||
# Dict to setup execution environment, better to have schema for this | ||
runtime_env: dict | ||
# Command to start execution, ex: "python script.py" | ||
entrypoint: str | ||
# Metadata to pass in to configure job behavior or use as tags | ||
# Required by Anyscale product and already supported in Ray drivers | ||
metadata: dict | ||
# Likely there will be more fields needed later on for different apps | ||
# but we should keep it minimal and delegate policies to job manager | ||
|
||
|
||
# ==== Job Submit ==== | ||
|
||
|
||
class JobSubmitRequest(BaseModel): | ||
job_spec: JobSpec | ||
# Globally unique job id. It’s recommended to generate this id from | ||
# external job manager first, then pass into this API. | ||
# If job server never had a job running with given id: | ||
# - Start new job execution | ||
# Else if job server has a running job with given id: | ||
# - Fail, deployment update and reconfigure should happen in job manager | ||
job_id: str = None | ||
|
||
|
||
class JobSubmitResponse(BaseModel): | ||
job_id: str | ||
|
||
|
||
# ==== Job Status ==== | ||
|
||
|
||
class JobStatusRequest(BaseModel): | ||
job_id: str | ||
|
||
|
||
class JobStatusResponse(BaseModel): | ||
job_status: JobStatus | ||
|
||
|
||
# ==== Job Logs ==== | ||
|
||
|
||
class JobLogsRequest(BaseModel): | ||
job_id: str | ||
|
||
|
||
# TODO(jiaodong): Support log streaming #19415 | ||
class JobLogsResponse(BaseModel): | ||
stdout: str | ||
stderr: str |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.