Esempio n. 1
0
def compile_pyfile(pyfile, function_name, output_path, type_check):
    sys.path.insert(0, os.path.dirname(pyfile))
    try:
        filename = os.path.basename(pyfile)
        with kfp_compiler_main.PipelineCollectorContext() as pipeline_funcs:
            __import__(os.path.splitext(filename)[0])
        _compile_pipeline_function(pipeline_funcs, function_name, output_path,
                                   type_check)
    finally:
        del sys.path[0]
Esempio n. 2
0
def compile_pyfile(pyfile,
                   function_name,
                   output_path,
                   type_check,
                   allow_telemetry,
                   generate_pipelinerun=False,
                   enable_artifacts=False):
    sys.path.insert(0, os.path.dirname(pyfile))
    try:
        filename = os.path.basename(pyfile)
        with kfp_compiler_main.PipelineCollectorContext() as pipeline_funcs:
            __import__(os.path.splitext(filename)[0])
        _compile_pipeline_function(pipeline_funcs,
                                   function_name,
                                   output_path,
                                   type_check,
                                   allow_telemetry=allow_telemetry,
                                   generate_pipelinerun=generate_pipelinerun,
                                   enable_artifacts=enable_artifacts)
    finally:
        del sys.path[0]