-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Test/Sample test] Fix the imparity between experiment name setting of notebook samples and python samples #2362
[Test/Sample test] Fix the imparity between experiment name setting of notebook samples and python samples #2362
Conversation
Maybe it would be easier to just fix #2292 |
@@ -129,7 +129,9 @@ def _compile(self): | |||
self._run_pipeline = raw_args['run_pipeline'] | |||
|
|||
if self._run_pipeline: | |||
nb_params['experiment_name'] = self._test_name + '-test' | |||
if not raw_args['notebook_params']['experiment_name']: |
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.
Could you move all the yaml validation codes in one function, including the yamale validate?
@@ -129,7 +129,9 @@ def _compile(self): | |||
self._run_pipeline = raw_args['run_pipeline'] |
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.
Could you add some comments in the schema yaml about the run_pipeline:
- for python samples: setting it true means submitting the pipeline.
- for notebook samples: setting it true means telling the test infra that the sample will submit a pipeline run and the test infra will inject the experiment_name.
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.
In other words: run_pipeline means submitting the run for python sample and checking the results in the notebook sample.
nb_params['experiment_name'] = self._test_name + '-test' | ||
if not raw_args['notebook_params']['experiment_name']: | ||
raise ValueError('Experiment name is required if pipeline run is expected.') | ||
nb_params['experiment_name'] = raw_args['notebook_params']['experiment_name'] |
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.
The fact that the experiment_name value in the config yaml is not used(but generated by the test infra) should be noted in the schema yaml file, similar to the output value not being used. WDYT?
/hold further work needed. |
Could you specify what further work is required? Maybe put a link here? |
Sure. Since #2292 is done, I think it will be beneficial to incorporate the newly introduced mechanism here, which will reduce the need of injecting experiment names. |
I think it is beneficial to explicitly add the experiment_name in the notebook examples, though. Or else, what is the default experiment_name when the env_var is not configured? WDYT? |
Per my reading it should be 'Default'. Sure, we can specify the experiment name in the notebook, but IMO changing it through env var will allow us to get rid of some ad hoc logic in current sample test infra. For example, we do not need to decide whether to inject experiment_name or not based on run_pipeline flag, instead we just set the env var when executing the pipeline. |
I'm all up for supporting the env-var. My point is for the experiment_name to be explicit in the samples. In terms of the ad hoc logic, isn't injecting the environment variable no different from adding the parameter to the papermill? |
One difference, for example, is that we can set the env var no matter what, but we can only inject experiment_name to notebook when it's indeed needed. |
I don't think papermill would fail if there is no such parameters. What it does is to inject a cell below the cell with the 'parameters' tag. Therefore, we can inject the experiment_name no matter what. |
You're right... Somewhat I got the wrong impression that it would raise errors. Now that it does not, I think I can further simplify the code a little bit. |
Let's brainstorm on the pros and cons of having
|
I think it is fine to remove the experiment_name and use the default experiment in the samples. And, #2292 is also merged. |
@numerology, could you resolve the comments and we can merge this PR? |
…ix-sample-test-injection-imparity � Conflicts: � test/sample-test/run_sample_test.py � test/sample-test/sample_test_launcher.py
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
After merging #2292 it seems like there is not too much to do in this PR. WDYT? |
SGTM |
Feel free to close this. |
/close |
@numerology: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Dan Sun <dsun20@bloomberg.net>
Fix #2148
This change is