Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
raunakab committed Dec 14, 2024
1 parent b5f53eb commit 78b483e
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions .github/ci-scripts/job_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import asyncio
from pathlib import Path

from ray.job_submission import JobStatus, JobSubmissionClient


def parse_env_var_str(env_var_str: str) -> dict:
iter = map(
Expand Down Expand Up @@ -33,23 +31,25 @@ def submit_job(
if args.enable_ray_tracing:
env_vars["DAFT_ENABLE_RAY_TRACING"] = "1"

client = JobSubmissionClient(address="http://localhost:8265")
job_id = client.submit_job(
entrypoint=f"python {entrypoint_script} {entrypoint_args}",
runtime_env={
"working_dir": working_dir,
"env_vars": env_vars,
},
)

asyncio.run(wait_on_job(client.tail_job_logs(job_id), timeout_s=60 * 30))

status = client.get_job_status(job_id)
assert status.is_terminal(), "Job should have terminated"
if status != JobStatus.SUCCEEDED:
job_info = client.get_job_info(job_id)
raise RuntimeError(f"Job failed with {job_info.error_type} error: {job_info.message}")
print(f"Job completed with {status}")
print(env_vars)

# client = JobSubmissionClient(address="http://localhost:8265")
# job_id = client.submit_job(
# entrypoint=f"python {entrypoint_script} {entrypoint_args}",
# runtime_env={
# "working_dir": working_dir,
# "env_vars": env_vars,
# },
# )

# asyncio.run(wait_on_job(client.tail_job_logs(job_id), timeout_s=60 * 30))

# status = client.get_job_status(job_id)
# assert status.is_terminal(), "Job should have terminated"
# if status != JobStatus.SUCCEEDED:
# job_info = client.get_job_info(job_id)
# raise RuntimeError(f"Job failed with {job_info.error_type} error: {job_info.message}")
# print(f"Job completed with {status}")


if __name__ == "__main__":
Expand Down

0 comments on commit 78b483e

Please sign in to comment.