@click.command()<EOL>@click.option('<STR_LIT>', '<STR_LIT>', type=str)<EOL>@click.option('<STR_LIT>', '<STR_LIT>', multiple=True, type=click.Path(exists=True),<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', type=str,<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', type=str, help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', type=str,<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', type=int,<EOL>help="<STR_LIT>")<EOL>@click.option('<STR_LIT>', is_flag=True, default=False,<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', is_flag=True, default=False,<EOL>help='<STR_LIT>')<EOL>@click.pass_context<EOL>@clean_outputs<EOL>def run(ctx, project, file, name, tags, description, ttl, u, l):  
if not file:<EOL><INDENT>file = PolyaxonFile.check_default_path(path='<STR_LIT:.>')<EOL><DEDENT>if not file:<EOL><INDENT>file = '<STR_LIT>'<EOL><DEDENT>specification = check_polyaxonfile(file, log=False).specification<EOL>spec_cond = (specification.is_experiment or<EOL>specification.is_group or<EOL>specification.is_job or<EOL>specification.is_build)<EOL>if not spec_cond:<EOL><INDENT>Printer.print_error(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(specification.kind))<EOL>if specification.is_notebook:<EOL><INDENT>click.echo('<STR_LIT>')<EOL><DEDENT>elif specification.is_tensorboard:<EOL><INDENT>click.echo('<STR_LIT>')<EOL><DEDENT>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>if u:<EOL><INDENT>if project:<EOL><INDENT>Printer.print_error('<STR_LIT>')<EOL>click.echo('<STR_LIT>')<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>ctx.invoke(upload, sync=False)<EOL><DEDENT>user, project_name = get_project_or_local(project)<EOL>project_client = PolyaxonClient().project<EOL>tags = validate_tags(tags)<EOL>def run_experiment():<EOL><INDENT>click.echo('<STR_LIT>')<EOL>experiment = ExperimentConfig(<EOL>name=name,<EOL>description=description,<EOL>tags=tags,<EOL>config=specification.parsed_data,<EOL>ttl=ttl)<EOL>try:<EOL><INDENT>response = PolyaxonClient().project.create_experiment(user,<EOL>project_name,<EOL>experiment)<EOL>cache.cache(config_manager=ExperimentManager, response=response)<EOL>Printer.print_success('<STR_LIT>'.format(response.id))<EOL><DEDENT>except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:<EOL><INDENT>Printer.print_error('<STR_LIT>')<EOL>Printer.print_error('<STR_LIT>'.format(e))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>def run_group():<EOL><INDENT>click.echo('<STR_LIT>')<EOL>experiments_def = specification.experiments_def<EOL>get_group_experiments_info(**experiments_def)<EOL>experiment_group = ExperimentGroupConfig(<EOL>name=name,<EOL>description=description,<EOL>tags=tags,<EOL>content=specification._data)  <EOL>try:<EOL><INDENT>response = project_client.create_experiment_group(user,<EOL>project_name,<EOL>experiment_group)<EOL>cache.cache(config_manager=GroupManager, response=response)<EOL>Printer.print_success('<STR_LIT>'.format(response.id))<EOL><DEDENT>except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:<EOL><INDENT>Printer.print_error('<STR_LIT>')<EOL>Printer.print_error('<STR_LIT>'.format(e))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>def run_job():<EOL><INDENT>click.echo('<STR_LIT>')<EOL>job = JobConfig(<EOL>name=name,<EOL>description=description,<EOL>tags=tags,<EOL>config=specification.parsed_data,<EOL>ttl=ttl)<EOL>try:<EOL><INDENT>response = project_client.create_job(user,<EOL>project_name,<EOL>job)<EOL>cache.cache(config_manager=JobManager, response=response)<EOL>Printer.print_success('<STR_LIT>'.format(response.id))<EOL><DEDENT>except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:<EOL><INDENT>Printer.print_error('<STR_LIT>')<EOL>Printer.print_error('<STR_LIT>'.format(e))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>def run_build():<EOL><INDENT>click.echo('<STR_LIT>')<EOL>job = JobConfig(<EOL>name=name,<EOL>description=description,<EOL>tags=tags,<EOL>config=specification.parsed_data,<EOL>ttl=ttl)<EOL>try:<EOL><INDENT>response = project_client.create_build(user,<EOL>project_name,<EOL>job)<EOL>cache.cache(config_manager=BuildJobManager, response=response)<EOL>Printer.print_success('<STR_LIT>'.format(response.id))<EOL><DEDENT>except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:<EOL><INDENT>Printer.print_error('<STR_LIT>')<EOL>Printer.print_error('<STR_LIT>'.format(e))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>logs = None<EOL>if specification.is_experiment:<EOL><INDENT>run_experiment()<EOL>logs = experiment_logs<EOL><DEDENT>elif specification.is_group:<EOL><INDENT>run_group()<EOL><DEDENT>elif specification.is_job:<EOL><INDENT>run_job()<EOL>logs = job_logs<EOL><DEDENT>elif specification.is_build:<EOL><INDENT>run_build()<EOL>logs = build_logs<EOL><DEDENT>if l and logs:<EOL><INDENT>ctx.obj = {'<STR_LIT>': '<STR_LIT>'.format(user, project_name)}<EOL>ctx.invoke(logs)<EOL><DEDENT>
Run polyaxonfile specification.

    Examples:

    \b
    ```bash
    $ polyaxon run -f file -f file_override ...
    ```

    Upload before running

    \b
    ```bash
    $ polyaxon run -f file -u
    ```

    Run and set description and tags for this run

    \b
    ```bash
    $ polyaxon run -f file -u --description="Description of the current run" --tags="foo, bar, moo"
    ```
    Run and set a unique name for this run

    \b
    ```bash
    polyaxon run --name=foo
    ```

    Run for a specific project

    \b
    ```bash
    $ polyaxon run -p project1 -f file.yaml
    ```