def start_schedule(cluster_name: str, deployment_path: str, **kwargs): # Load details cluster_details = load_cluster_details(cluster_name=cluster_name) if cluster_details['cloud']['infra'] == 'azure': executor = GrassAzureExecutor(cluster_name=cluster_name) executor.start_schedule(deployment_path=deployment_path)
def start_schedule(cluster_name: str, deployment_path: str, **kwargs): # Load details cluster_details = load_cluster_details(cluster_name=cluster_name) if cluster_details["mode"] in ["grass/azure", "grass/on-premises"]: executor = GrassAzureExecutor(cluster_name=cluster_name) executor.start_schedule(deployment_path=deployment_path) else: raise BadRequestError( f"Unsupported command in mode '{cluster_details['mode']}'.")
def start_schedule(cluster_name: str, deployment_path: str, **kwargs): # Late import. from maro.cli.grass.executors.grass_azure_executor import GrassAzureExecutor from maro.cli.grass.executors.grass_local_executor import GrassLocalExecutor from maro.cli.grass.executors.grass_on_premises_executor import GrassOnPremisesExecutor from maro.cli.utils.details_reader import DetailsReader from maro.utils.exception.cli_exception import BadRequestError # Load details cluster_details = DetailsReader.load_cluster_details( cluster_name=cluster_name) if cluster_details["mode"] == "grass/azure": executor = GrassAzureExecutor(cluster_name=cluster_name) executor.start_schedule(deployment_path=deployment_path) elif cluster_details["mode"] == "grass/local": executor = GrassLocalExecutor(cluster_name=cluster_name) executor.start_schedule(deployment_path=deployment_path) elif cluster_details["mode"] == "grass/on-premises": executor = GrassOnPremisesExecutor(cluster_name=cluster_name) executor.start_schedule(deployment_path=deployment_path) else: raise BadRequestError( f"Unsupported operation in mode '{cluster_details['mode']}'.")