Ejemplo n.º 1
0
 def verify():
     job_data = list(list_jobs().values())[0]
     print(job_data)
     job_id_from_api = list(list_jobs().keys())[0]
     correct_state = job_data["status"] == "SUCCEEDED"
     correct_id = job_id == job_id_from_api
     return correct_state and correct_id
Ejemplo n.º 2
0
def jobs(ctx, format: str):
    url = ctx.obj["api_server_url"]
    format = AvailableFormat(format)
    print(
        get_state_api_output_to_print(
            list_jobs(api_server_url=url, _explain=_should_explain(format)),
            format=format,
        )
    )
Ejemplo n.º 3
0
def jobs(ctx, format: str, filter: List[Tuple[str, str]]):
    url = ctx.obj["api_server_url"]
    format = AvailableFormat(format)
    print(
        get_state_api_output_to_print(
            list_jobs(
                api_server_url=url,
                filters=filter,
                _explain=_should_explain(format),
            ),
            format=format,
        )
    )
Ejemplo n.º 4
0
def test_list_jobs(shutdown_only):
    ray.init()
    client = JobSubmissionClient(
        f"http://{ray.worker.global_worker.node.address_info['webui_url']}")
    job_id = client.submit_job(  # noqa
        # Entrypoint shell command to execute
        entrypoint="ls", )

    def verify():
        job_data = list(list_jobs().values())[0]
        job_id_from_api = list(list_jobs().keys())[0]
        correct_state = job_data["status"] == "SUCCEEDED"
        correct_id = job_id == job_id_from_api
        return correct_state and correct_id

    wait_for_condition(verify)
    print(list_jobs())
Ejemplo n.º 5
0
def jobs(ctx):
    url = ctx.obj["api_server_url"]
    pprint(list_jobs(url))
Ejemplo n.º 6
0
def jobs(ctx, format: str):
    url = ctx.obj["api_server_url"]
    print(
        get_state_api_output_to_print(list_jobs(api_server_url=url),
                                      format=AvailableFormat(format)))