-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Clusters keeper: add rpc methods to get EC2 instance capabilities (#…
- Loading branch information
Showing
18 changed files
with
173 additions
and
69 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/models-library/src/models_library/api_schemas_clusters_keeper/__init__.py
This file contains 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,9 @@ | ||
from typing import Final | ||
|
||
from pydantic import parse_obj_as | ||
|
||
from ..rabbitmq_basic_types import RPCNamespace | ||
|
||
CLUSTERS_KEEPER_RPC_NAMESPACE: Final[RPCNamespace] = parse_obj_as( | ||
RPCNamespace, "clusters-keeper" | ||
) |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
packages/models-library/src/models_library/api_schemas_clusters_keeper/ec2_instances.py
This file contains 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,10 @@ | ||
from dataclasses import dataclass | ||
|
||
from pydantic import ByteSize, PositiveInt | ||
|
||
|
||
@dataclass(frozen=True) | ||
class EC2InstanceType: | ||
name: str | ||
cpus: PositiveInt | ||
ram: ByteSize |
Empty file removed
0
packages/models-library/src/models_library/rpc_schemas_clusters_keeper/__init__.py
Empty file.
This file contains 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 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 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 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
2 changes: 1 addition & 1 deletion
2
services/clusters-keeper/src/simcore_service_clusters_keeper/rpc/clusters.py
This file contains 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
14 changes: 14 additions & 0 deletions
14
services/clusters-keeper/src/simcore_service_clusters_keeper/rpc/ec2_instances.py
This file contains 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,14 @@ | ||
from fastapi import FastAPI | ||
from models_library.api_schemas_clusters_keeper.ec2_instances import EC2InstanceType | ||
from servicelib.rabbitmq import RPCRouter | ||
|
||
from ..modules.ec2 import get_ec2_client | ||
|
||
router = RPCRouter() | ||
|
||
|
||
@router.expose() | ||
async def get_instance_type_details( | ||
app: FastAPI, *, instance_type_names: set[str] | ||
) -> list[EC2InstanceType]: | ||
return await get_ec2_client(app).get_ec2_instance_capabilities(instance_type_names) |
15 changes: 7 additions & 8 deletions
15
services/clusters-keeper/src/simcore_service_clusters_keeper/rpc/rpc_routes.py
This file contains 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 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 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 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 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.