Skip to content

Commit

Permalink
[jobs] Initial http jobs server on head node (ray-project#19657)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaodong committed Oct 23, 2021
1 parent d656b3a commit e53fecf
Show file tree
Hide file tree
Showing 10 changed files with 244 additions and 889 deletions.
64 changes: 64 additions & 0 deletions dashboard/modules/job/data_types.py
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
320 changes: 0 additions & 320 deletions dashboard/modules/job/job_agent.py

This file was deleted.

Loading

0 comments on commit e53fecf

Please sign in to comment.