-
Notifications
You must be signed in to change notification settings - Fork 7k
[release test] remove legacy job runner dict in glue.py #58718
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
Conversation
| self._run(result, True) | ||
| self.assertEqual(result.return_code, ExitCode.CONFIG_ERROR.value) | ||
|
|
||
| def testStartClusterFails(self): |
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.
cluster lifecycle management is on anyscale now.
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.
Code Review
This pull request removes the legacy JobRunner and FullClusterManager, simplifying the codebase to only use AnyscaleJobRunner for release tests. The changes are clean and correctly remove the associated logic and tests. I've added a couple of suggestions for further simplification now that the legacy path is gone. Specifically, I've pointed out a redundant conditional check and an opportunity to remove single-entry dictionaries to make the code more direct.
| type_str_to_command_runner = { | ||
| "job": JobRunner, | ||
| "anyscale_job": AnyscaleJobRunner, | ||
| } | ||
|
|
||
| command_runner_to_cluster_manager = { | ||
| JobRunner: FullClusterManager, | ||
| AnyscaleJobRunner: MinimalClusterManager, | ||
| } |
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.
Now that JobRunner has been removed, these dictionaries only contain a single entry. This adds a layer of indirection that is no longer necessary. Consider removing these dictionaries and directly using AnyscaleJobRunner and MinimalClusterManager in _load_test_configuration. This would make the control flow more straightforward.
For example, you could refactor the logic in _load_test_configuration to something like this:
run_type = test["run"].get("type", DEFAULT_RUN_TYPE)
if run_type == "anyscale_job":
command_runner_cls = AnyscaleJobRunner
cluster_manager_cls = MinimalClusterManager
else:
raise ReleaseTestConfigError(
f"Unknown command runner type: {run_type}. Must be one of "
f"['anyscale_job']"
)| if isinstance(command_runner, AnyscaleJobRunner): | ||
| command_runner.job_manager.cluster_startup_timeout = cluster_timeout |
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.
Signed-off-by: Lonnie Liu <[email protected]>
2ed965d to
1f61281
Compare
Signed-off-by: Lonnie Liu <[email protected]>
…58718) not being used any more since a loong time ago. Signed-off-by: Lonnie Liu <[email protected]> Signed-off-by: Aydin Abiar <[email protected]>
…58718) not being used any more since a loong time ago. Signed-off-by: Lonnie Liu <[email protected]> Signed-off-by: YK <[email protected]>
…58718) not being used any more since a loong time ago. Signed-off-by: Lonnie Liu <[email protected]>
not being used any more since a loong time ago.