-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load performance test pipelines from files #796
Load performance test pipelines from files #796
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ckadner The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
bb10915
to
0d05b2a
Compare
* Add perf_test_config.yaml with paths of test pipelines * Add a 'Status' column to output CSV file * Update compile_pyfile to remove loaded pipeline module after compilation to allow subsequent imports of another module with the same name Resolves kubeflow#778 Signed-off-by: Christian Kadner <[email protected]>
0d05b2a
to
acf623e
Compare
@@ -82,6 +82,7 @@ def compile_pyfile(pyfile, function_name, output_path, type_check, tekton_pipeli | |||
_compile_pipeline_function(pipeline_funcs, function_name, output_path, type_check, tekton_pipeline_conf) | |||
finally: | |||
del sys.path[0] | |||
sys.modules.pop(os.path.splitext(filename)[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Python caches previsously loaded modules, this change was required to allow using the compile_pyfile()
method multiple times within the same Python process and enable loading different pipeline scripts from files with the same ("module") name, i.e. we have multiple condition.py
samples.
Without this change, we would get these errors:
ValueError trying to compile /Users/ckadner/PycharmProjects/kfp-tekton_ckadner/samples/flip-coin/condition.py: A function with @dsl.pipeline decorator is required in the py file.
ValueError trying to compile /Users/ckadner/PycharmProjects/kfp-tekton_ckadner/samples/flip-coin-custom-task/condition.py: A function with @dsl.pipeline decorator is required in the py file.
@Tomcli -- sorry for the concurrent PRs and difficult merging process. I hope by adding the changes you made to |
/lgtm |
Thanks @Tomcli |
* Add perf_test_config.yaml with paths of test pipelines * Add a 'Status' column to output CSV file * Update compile_pyfile to remove loaded pipeline module after compilation to allow subsequent imports of another module with the same name Resolves kubeflow#778 Signed-off-by: Christian Kadner <[email protected]>
Description of your changes:
Updates to the performance test script:
performance_test.py
outside of thecompiler
folder (since the scope is beyond compiler testing)perf_test_config.yaml
with paths of test pipelinesStatus
column to output CSV filecompile_pyfile
to remove loaded pipeline module after compilation to allow subsequent imports of another module with the same nameHow to run it:
Output:
Which issue is resolved by this Pull Request:
Resolves: #778
/cc @Tomcli
/cc @yhwang