def create_single_node(api_key, **kwargs):
    utils.validate_workspace_input(kwargs)
    kwargs["experimentTypeId"] = constants.ExperimentType.SINGLE_NODE
    del_if_value_is_none(kwargs)
    experiments_api = client.API(config.CONFIG_EXPERIMENTS_HOST, api_key=api_key)
    command = experiments_commands.CreateExperimentCommand(api=experiments_api)
    command.execute(kwargs)
Exemple #2
0
def run(api_key, **kwargs):
    utils.validate_workspace_input(kwargs)
    del_if_value_is_none(kwargs)
    jsonify_dicts(kwargs)

    command = RunCommand(api_key=api_key)
    command.execute(**kwargs)
def create_and_start_multi_node(ctx, api_key, show_logs, **kwargs):
    utils.validate_workspace_input(kwargs)
    del_if_value_is_none(kwargs)
    experiments_api = client.API(config.CONFIG_EXPERIMENTS_HOST, api_key=api_key)
    command = experiments_commands.CreateAndStartExperimentCommand(api=experiments_api)
    experiment = command.execute(kwargs)
    if experiment and show_logs:
        ctx.invoke(list_logs, experiment_id=experiment["handle"], line=0, limit=100, follow=True, api_key=api_key)
def create_and_start_hyperparameter(api_key, **hyperparameter):
    utils.validate_workspace_input(hyperparameter)
    common.del_if_value_is_none(hyperparameter, del_all_falsy=True)

    command = hyperparameters_commands.CreateAndStartHyperparameterCommand(
        api_key=api_key,
        workspace_handler=get_workspace_handler(api_key),
    )
    command.execute(hyperparameter)
Exemple #5
0
def create_single_node(api_key, **kwargs):
    utils.validate_workspace_input(kwargs)
    common.del_if_value_is_none(kwargs, del_all_falsy=True)

    command = experiments_commands.CreateSingleNodeExperimentCommand(
        api_key=api_key,
        workspace_handler=get_workspace_handler(api_key),
    )
    command.execute(kwargs)
Exemple #6
0
def create_job(ctx, api_key, **kwargs):
    utils.validate_workspace_input(kwargs)
    del_if_value_is_none(kwargs)
    jsonify_dicts(kwargs)

    command = jobs_commands.CreateJobCommand(api_key=api_key, workspace_handler=get_workspace_handler())
    job = command.execute(kwargs)
    if job is not None:
        ctx.invoke(list_logs, job_id=job["handle"], line=0, limit=100, follow=True, api_key=api_key)
Exemple #7
0
def create_and_start_single_node(ctx, api_key, show_logs, **kwargs):
    utils.validate_workspace_input(kwargs)
    common.del_if_value_is_none(kwargs, del_all_falsy=True)

    command = experiments_commands.CreateAndStartSingleNodeExperimentCommand(
        api_key=api_key,
        workspace_handler=get_workspace_handler(api_key),
    )
    experiment = command.execute(kwargs)
    if experiment and show_logs:
        ctx.invoke(list_logs, experiment_id=experiment["handle"], line=0, limit=100, follow=True, api_key=api_key)
Exemple #8
0
    def _validate_input(input_data):
        utils.validate_workspace_input(input_data)

        workspace_url = input_data.get('workspaceUrl') or input_data.get("workspace_url")
        workspace_path = input_data.get('workspace')
        workspace_archive = input_data.get('workspaceArchive') or input_data.get("workspace_archive")

        if workspace_path not in ("none", None):
            path_type = utils.PathParser().parse_path(workspace_path)

            if path_type != utils.PathParser.LOCAL_DIR:
                if path_type == utils.PathParser.LOCAL_FILE:
                    workspace_archive = workspace_path
                elif path_type in (utils.PathParser.GIT_URL, utils.PathParser.S3_URL):
                    workspace_url = workspace_path

                workspace_path = None

        return workspace_archive, workspace_path, workspace_url
def create_multi_node(api_key, **kwargs):
    utils.validate_workspace_input(kwargs)
    del_if_value_is_none(kwargs)
    experiments_api = client.API(config.CONFIG_EXPERIMENTS_HOST, api_key=api_key)
    command = experiments_commands.CreateExperimentCommand(api=experiments_api)
    command.execute(kwargs)