def placement_groups(ctx, format: str): url = ctx.obj["api_server_url"] print( get_state_api_output_to_print( list_placement_groups(api_server_url=url), format=AvailableFormat(format), ))
def placement_groups(ctx, format: str): url = ctx.obj["api_server_url"] format = AvailableFormat(format) print( get_state_api_output_to_print( list_placement_groups(api_server_url=url, _explain=_should_explain(format)), format=format, ) )
def test_list_pgs(shutdown_only): ray.init() pg = ray.util.placement_group(bundles=[{"CPU": 1}]) # noqa def verify(): pg_data = list(list_placement_groups().values())[0] correct_state = pg_data["state"] == "CREATED" is_id_hex = is_hex(pg_data["placement_group_id"]) correct_id = pg.id.hex() == pg_data["placement_group_id"] return correct_state and is_id_hex and correct_id wait_for_condition(verify) print(list_placement_groups())
def placement_groups(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_placement_groups( api_server_url=url, filters=filter, _explain=_should_explain(format), ), format=format, ) )
def placement_groups(ctx): url = ctx.obj["api_server_url"] pprint(list_placement_groups(url))
def verify(): pg_data = list(list_placement_groups().values())[0] correct_state = pg_data["state"] == "CREATED" is_id_hex = is_hex(pg_data["placement_group_id"]) correct_id = pg.id.hex() == pg_data["placement_group_id"] return correct_state and is_id_hex and correct_id