-
Notifications
You must be signed in to change notification settings - Fork 11
Autoscaling support in alchemiscale #424
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 39 commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
c6bf42d
Add unimplemented classes and functions for compute manager implement…
ianmkenney 8ae35b3
Add unimplemented statestore methods for the compute manager
ianmkenney 0720596
Validate ComputeManagerID
ianmkenney 6836edf
First implementation of update status
ianmkenney d87d848
Improved handling of compute manager ids, migration of code from api …
ianmkenney b3742d8
Merge remote-tracking branch 'origin/main' into autoscaling
ianmkenney a898fdf
Implement instruction and fix naming issues
ianmkenney b63c63d
Reorganize compute manager related models
ianmkenney febf7a6
Moved ComputeManager specific models to storage models
ianmkenney c71a133
Use manager_id instead of name
ianmkenney ebe1111
Simplify deregistration and handle everything in cypher
ianmkenney 273accf
Remove "force" from compute manager deregistration
ianmkenney eccf567
Implement tests for compute manager client
ianmkenney 11471a8
Correct name for compute manager in test
ianmkenney 3108d97
Implement instruction testing for compute manager client
ianmkenney a780135
Begin implementing tests for statestore methods
ianmkenney 83df0d3
Change manager_id to manager_name, remove STALLED, implement status test
ianmkenney 80572cc
Allow manager registration to reattach to compute services and test e…
ianmkenney 9375a90
Rework structure of returned ComputeManagerInstruction and its data
ianmkenney 0235436
Docstrings for statestore and minor refactoring
ianmkenney 2de6a76
Implement a bulk version of compute_service_can_claim
ianmkenney 30456f7
Revert "Rework structure of returned ComputeManagerInstruction and it…
ianmkenney 00df011
Implement tests for manager base class
ianmkenney 89998bf
Remove use of value from StrEnum instances
ianmkenney 3ba652d
Count available tasks
ianmkenney 96f3726
Collect unique sets of tasks
ianmkenney 8b7ebb9
Fix FastAPI parameters
ianmkenney 4157219
Corrected checking for number of tasks
ianmkenney 2eb45b6
Add saturation to compute manager update status protocol
ianmkenney aff6bf1
Test saturation is correctly set from status update
ianmkenney 47720a3
Add compute manager ID to compute service settings
ianmkenney ec07e6d
Add saturation to compute manager client status update method
ianmkenney 0aa3d78
Implement creation of compute services in compute manager tests
ianmkenney 896853f
Properly terminate compute service processes
ianmkenney cc702eb
Consider the number of unclaimed tasks when creating compute services
ianmkenney 8a8e610
Fix test with correct number of expected compute services started
ianmkenney 768ced6
Merge remote-tracking branch 'upstream/main' into autoscaling
ianmkenney ad6b235
Improve testing for ComputeManagerID
ianmkenney 0eb792b
Merge branch 'main' into autoscaling
dotsdl a5043b8
Include basic implementation for the compute manager base class
ianmkenney 784eec3
Attempt to remove expired compute managers on all status updates
ianmkenney fc6fe0a
Add minimal docs about compute managers to the compute docs
ianmkenney c0ace2f
Add more tests to ComputeManager implementation
ianmkenney 2ea4a37
Remove exception_to_raise parameter in _create_compute_service
ianmkenney aedd190
Improve logging and test coverage
ianmkenney 152b59f
Allow creating multiple compute services at once
ianmkenney aa6b192
Formatting adjustments.
dotsdl b2e952a
Black format and address quick fixes from review
ianmkenney 0cf6353
Rename compute manager API points
ianmkenney 4da3546
Rename ERRORED to ERROR
ianmkenney 71f1144
Merge remote-tracking branch 'origin/main' into autoscaling
ianmkenney 73faeb0
Managers now use `name` instead of `manager_name` when appropriate
ianmkenney 424a039
Make signs clear for time arithmetic, improve logging, simplify query
ianmkenney bcb2492
ERROR ComputeManager clearing
ianmkenney 7eb9e15
Registration failure flow control
ianmkenney c76f5ea
Removed unnecessary exception handling
ianmkenney 8d6a1a8
Pass scopes along to client get_instruction requests
ianmkenney 7edb01a
ComputeManager now uses service settings as input
ianmkenney 2a36107
Change logger.fatal to logger.error
ianmkenney 4d7edf8
Test providing a missing compute manager to a compute service
ianmkenney 5a708a0
Drop try-except on register for compute managers in client
dotsdl 6007bb4
Modifications from review
dotsdl 207ae1e
Add news entry for compute managers
ianmkenney 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
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
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 |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| """ | ||
| :mod:`alchemiscale.compute.manager` --- compute manager for creating compute services | ||
| ===================================================================================== | ||
|
|
||
| """ | ||
|
|
||
| from abc import abstractmethod | ||
|
|
||
| from ..storage.models import ComputeManagerID, ComputeManagerInstruction | ||
| from .client import AlchemiscaleComputeManagerClient | ||
| from .settings import ComputeManagerSettings | ||
|
|
||
|
|
||
| class ComputeManager: | ||
|
dotsdl marked this conversation as resolved.
|
||
|
|
||
| compute_manager_id: ComputeManagerID | ||
| sleep_interval: int | ||
| client: AlchemiscaleComputeManagerClient | ||
| service_settings_template: bytes | ||
| manager_settings: ComputeManagerSettings | ||
|
dotsdl marked this conversation as resolved.
Outdated
|
||
|
|
||
| def _register(self): | ||
| self.client.register(self.compute_manager_id) | ||
|
|
||
| def _deregister(self): | ||
| self.client.deregister(self.compute_manager_id) | ||
|
|
||
| def request_instruction(self) -> ComputeManagerInstruction: | ||
| instruction = self.client._post_resource( | ||
| f"/computemanager/{self.compute_manager_id}/update_status", {} | ||
|
dotsdl marked this conversation as resolved.
Outdated
|
||
| ) | ||
| return instruction | ||
|
|
||
| @abstractmethod | ||
| def start(self): | ||
| raise NotImplementedError | ||
|
|
||
| @abstractmethod | ||
| def stop(self): | ||
| raise NotImplementedError | ||
|
|
||
| @abstractmethod | ||
| def cycle(self): | ||
| raise NotImplementedError | ||
|
dotsdl marked this conversation as resolved.
Outdated
|
||
|
|
||
| @abstractmethod | ||
| def create_compute_service(self): | ||
| raise NotImplementedError | ||
|
ianmkenney marked this conversation as resolved.
Outdated
|
||
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.