-
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,11 +18,9 @@ | |
| from ray_release.buildkite.output import buildkite_group, buildkite_open_last | ||
| from ray_release.cloud_util import archive_directory | ||
| from ray_release.cluster_manager.cluster_manager import ClusterManager | ||
| from ray_release.cluster_manager.full import FullClusterManager | ||
| from ray_release.cluster_manager.minimal import MinimalClusterManager | ||
| from ray_release.command_runner.anyscale_job_runner import AnyscaleJobRunner | ||
| from ray_release.command_runner.command_runner import CommandRunner | ||
| from ray_release.command_runner.job_runner import JobRunner | ||
| from ray_release.config import ( | ||
| DEFAULT_AUTOSUSPEND_MINS, | ||
| DEFAULT_BUILD_TIMEOUT, | ||
|
|
@@ -48,20 +46,17 @@ | |
| from ray_release.reporter.reporter import Reporter | ||
| from ray_release.result import Result, ResultStatus, handle_exception | ||
| from ray_release.signal_handling import ( | ||
| register_handler, | ||
| reset_signal_handling, | ||
| setup_signal_handling, | ||
| ) | ||
| from ray_release.template import get_working_dir, load_test_cluster_compute | ||
| from ray_release.test import Test | ||
|
|
||
| type_str_to_command_runner = { | ||
| "job": JobRunner, | ||
| "anyscale_job": AnyscaleJobRunner, | ||
| } | ||
|
|
||
| command_runner_to_cluster_manager = { | ||
| JobRunner: FullClusterManager, | ||
| AnyscaleJobRunner: MinimalClusterManager, | ||
| } | ||
|
|
||
|
|
@@ -238,12 +233,6 @@ def _local_environment_information( | |
| cluster_id: Optional[str], | ||
| cluster_env_id: Optional[str], | ||
| ) -> None: | ||
| if isinstance(cluster_manager, FullClusterManager): | ||
| if not no_terminate: | ||
| register_handler( | ||
| lambda sig, frame: cluster_manager.terminate_cluster(wait=True) | ||
| ) | ||
|
|
||
| # Start cluster | ||
| if cluster_id: | ||
| buildkite_group(":rocket: Using existing cluster") | ||
|
|
@@ -258,10 +247,7 @@ def _local_environment_information( | |
|
|
||
| cluster_manager.build_configs(timeout=build_timeout) | ||
|
|
||
| if isinstance(cluster_manager, FullClusterManager): | ||
| buildkite_group(":rocket: Starting up cluster") | ||
| cluster_manager.start_cluster(timeout=cluster_timeout) | ||
| elif isinstance(command_runner, AnyscaleJobRunner): | ||
| if isinstance(command_runner, AnyscaleJobRunner): | ||
| command_runner.job_manager.cluster_startup_timeout = cluster_timeout | ||
|
Comment on lines
+250
to
251
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| result.cluster_url = cluster_manager.get_cluster_url() | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,10 +14,7 @@ | |
| from ray_release.cluster_manager.full import FullClusterManager | ||
| from ray_release.command_runner.command_runner import CommandRunner | ||
| from ray_release.exception import ( | ||
| ClusterCreationError, | ||
| ClusterNodesWaitTimeout, | ||
| ClusterStartupError, | ||
| ClusterStartupTimeout, | ||
| CommandError, | ||
| CommandTimeout, | ||
| ExitCode, | ||
|
|
@@ -321,40 +318,6 @@ def testInvalidClusterCompute(self): | |
| self._run(result, True) | ||
| self.assertEqual(result.return_code, ExitCode.CONFIG_ERROR.value) | ||
|
|
||
| def testStartClusterFails(self): | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cluster lifecycle management is on anyscale now. |
||
| result = Result() | ||
|
|
||
| self._succeed_until("cluster_env") | ||
|
|
||
| # Fails because API response faulty | ||
| with self.assertRaises(ClusterCreationError): | ||
| self._run(result) | ||
| self.assertEqual(result.return_code, ExitCode.CLUSTER_RESOURCE_ERROR.value) | ||
|
|
||
| self.cluster_manager_return["cluster_id"] = "valid" | ||
|
|
||
| # Fail for random cluster startup reason | ||
| self.cluster_manager_return["start_cluster"] = _fail_on_call( | ||
| ClusterStartupError | ||
| ) | ||
| with self.assertRaises(ClusterStartupError): | ||
| self._run(result) | ||
| self.assertEqual(result.return_code, ExitCode.CLUSTER_STARTUP_ERROR.value) | ||
|
|
||
| # Ensure cluster was terminated | ||
| self.assertGreaterEqual(self.sdk.call_counter["terminate_cluster"], 1) | ||
|
|
||
| # Fail for cluster startup timeout | ||
| self.cluster_manager_return["start_cluster"] = _fail_on_call( | ||
| ClusterStartupTimeout | ||
| ) | ||
| with self.assertRaises(ClusterStartupTimeout): | ||
| self._run(result) | ||
| self.assertEqual(result.return_code, ExitCode.CLUSTER_STARTUP_TIMEOUT.value) | ||
|
|
||
| # Ensure cluster was terminated | ||
| self.assertGreaterEqual(self.sdk.call_counter["terminate_cluster"], 1) | ||
|
|
||
| def testPrepareRemoteEnvFails(self): | ||
| result = Result() | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
JobRunnerhas 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 usingAnyscaleJobRunnerandMinimalClusterManagerin_load_test_configuration. This would make the control flow more straightforward.For example, you could refactor the logic in
_load_test_configurationto something like this: