-
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.
Merge remote-tracking branch 'upstream/master' into pr-osparc-reroute…
…-update-projects-networks
- Loading branch information
Showing
110 changed files
with
3,189 additions
and
1,333 deletions.
There are no files selected for viewing
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
13 changes: 13 additions & 0 deletions
13
packages/common-library/src/common_library/groups_enums.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,13 @@ | ||
import enum | ||
|
||
|
||
class GroupType(enum.Enum): | ||
""" | ||
standard: standard group, e.g. any group that is not a primary group or special group such as the everyone group | ||
primary: primary group, e.g. the primary group is the user own defined group that typically only contain the user (same as in linux) | ||
everyone: the only group for all users | ||
""" | ||
|
||
STANDARD = "standard" | ||
PRIMARY = "primary" | ||
EVERYONE = "everyone" |
2 changes: 1 addition & 1 deletion
2
packages/models-library/src/models_library/api_schemas_catalog/service_access_rights.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
3 changes: 2 additions & 1 deletion
3
packages/models-library/src/models_library/api_schemas_webserver/socketio.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
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
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
73 changes: 73 additions & 0 deletions
73
packages/pytest-simcore/src/pytest_simcore/helpers/autoscaling.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,73 @@ | ||
from collections.abc import Callable | ||
|
||
import arrow | ||
from aws_library.ec2 import EC2InstanceData | ||
from models_library.generated_models.docker_rest_api import ( | ||
Availability, | ||
Node, | ||
NodeState, | ||
) | ||
from pytest_mock import MockType | ||
from simcore_service_autoscaling.models import AssociatedInstance, Cluster | ||
from simcore_service_autoscaling.utils.utils_docker import ( | ||
_OSPARC_NODE_TERMINATION_PROCESS_LABEL_KEY, | ||
_OSPARC_SERVICE_READY_LABEL_KEY, | ||
_OSPARC_SERVICES_READY_DATETIME_LABEL_KEY, | ||
) | ||
|
||
|
||
def assert_cluster_state( | ||
spied_cluster_analysis: MockType, *, expected_calls: int, expected_num_machines: int | ||
) -> Cluster: | ||
assert spied_cluster_analysis.call_count == expected_calls | ||
|
||
assert isinstance(spied_cluster_analysis.spy_return, Cluster) | ||
assert ( | ||
spied_cluster_analysis.spy_return.total_number_of_machines() | ||
== expected_num_machines | ||
) | ||
print("current cluster state:", spied_cluster_analysis.spy_return) | ||
cluster = spied_cluster_analysis.spy_return | ||
spied_cluster_analysis.reset_mock() | ||
return cluster | ||
|
||
|
||
def create_fake_association( | ||
create_fake_node: Callable[..., Node], | ||
drained_machine_id: str | None, | ||
terminating_machine_id: str | None, | ||
): | ||
fake_node_to_instance_map = {} | ||
|
||
async def _fake_node_creator( | ||
_nodes: list[Node], ec2_instances: list[EC2InstanceData] | ||
) -> tuple[list[AssociatedInstance], list[EC2InstanceData]]: | ||
def _create_fake_node_with_labels(instance: EC2InstanceData) -> Node: | ||
if instance not in fake_node_to_instance_map: | ||
fake_node = create_fake_node() | ||
assert fake_node.spec | ||
fake_node.spec.availability = Availability.active | ||
assert fake_node.status | ||
fake_node.status.state = NodeState.ready | ||
assert fake_node.spec.labels | ||
fake_node.spec.labels |= { | ||
_OSPARC_SERVICES_READY_DATETIME_LABEL_KEY: arrow.utcnow().isoformat(), | ||
_OSPARC_SERVICE_READY_LABEL_KEY: ( | ||
"true" if instance.id != drained_machine_id else "false" | ||
), | ||
} | ||
if instance.id == terminating_machine_id: | ||
fake_node.spec.labels |= { | ||
_OSPARC_NODE_TERMINATION_PROCESS_LABEL_KEY: arrow.utcnow().isoformat() | ||
} | ||
fake_node_to_instance_map[instance] = fake_node | ||
return fake_node_to_instance_map[instance] | ||
|
||
associated_instances = [ | ||
AssociatedInstance(node=_create_fake_node_with_labels(i), ec2_instance=i) | ||
for i in ec2_instances | ||
] | ||
|
||
return associated_instances, [] | ||
|
||
return _fake_node_creator |
2 changes: 1 addition & 1 deletion
2
packages/pytest-simcore/src/pytest_simcore/helpers/webserver_workspaces.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
Empty file.
Oops, something went wrong.