Skip to content

Commit 9ec86fb

Browse files
authored
Merge branch 'master' into retire-clusters
2 parents 4b6da3c + f9f2148 commit 9ec86fb

File tree

49 files changed

+1085
-322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1085
-322
lines changed

.env-devel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ EFS_GROUP_NAME=efs-group
9090
EFS_DNS_NAME=fs-xxx.efs.us-east-1.amazonaws.com
9191
EFS_MOUNTED_PATH=/tmp/efs
9292
EFS_PROJECT_SPECIFIC_DATA_DIRECTORY=project-specific-data
93-
EFS_ONLY_ENABLED_FOR_USERIDS=[]
9493
EFS_GUARDIAN_TRACING={}
94+
EFS_DEFAULT_USER_SERVICE_SIZE_BYTES=10000
9595

9696
# DATCORE_ADAPTER
9797
DATCORE_ADAPTER_TRACING={}

.github/workflows/ci-testing-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,7 +2460,7 @@ jobs:
24602460

24612461
integration-tests:
24622462
# NOTE: this is a github required status check!
2463-
if: ${{ !cancelled() }}
2463+
if: ${{ always() }}
24642464
needs:
24652465
[
24662466
integration-test-director-v2-01,
@@ -2792,7 +2792,7 @@ jobs:
27922792

27932793
system-tests:
27942794
# NOTE: this is a github required status check!
2795-
if: ${{ !cancelled() }}
2795+
if: ${{ always() }}
27962796
needs:
27972797
[
27982798
system-test-e2e,

api/specs/web-server/_folders.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
FoldersListQueryParams,
2626
FoldersPathParams,
2727
)
28+
from simcore_service_webserver.folders._workspaces_handlers import (
29+
_FolderWorkspacesPathParams,
30+
)
2831

2932
router = APIRouter(
3033
prefix=f"/{API_VTAG}",
@@ -97,3 +100,15 @@ async def delete_folder(
97100
_path: Annotated[FoldersPathParams, Depends()],
98101
):
99102
...
103+
104+
105+
@router.post(
106+
"/folders/{folder_id}/workspaces/{workspace_id}:move",
107+
status_code=status.HTTP_204_NO_CONTENT,
108+
summary="Move folder to the workspace",
109+
tags=["workspaces"],
110+
)
111+
async def move_folder_to_workspace(
112+
_path: Annotated[_FolderWorkspacesPathParams, Depends()],
113+
):
114+
...

api/specs/web-server/_projects_workspaces.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
)
2424

2525

26-
@router.put(
27-
"/projects/{project_id}/workspaces/{workspace_id}",
26+
@router.post(
27+
"/projects/{project_id}/workspaces/{workspace_id}:move",
2828
status_code=status.HTTP_204_NO_CONTENT,
2929
summary="Move project to the workspace",
3030
)
31-
async def replace_project_workspace(
31+
async def move_project_to_workspace(
3232
_path: Annotated[_ProjectWorkspacesPathParams, Depends()],
3333
):
3434
...

packages/models-library/src/models_library/api_schemas_webserver/projects.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@
99
from typing import Annotated, Any, Literal, TypeAlias
1010

1111
from models_library.folders import FolderID
12+
from models_library.utils._original_fastapi_encoders import jsonable_encoder
1213
from models_library.workspaces import WorkspaceID
13-
from pydantic import BeforeValidator, ConfigDict, Field, HttpUrl, field_validator
14+
from pydantic import (
15+
BeforeValidator,
16+
ConfigDict,
17+
Field,
18+
HttpUrl,
19+
PlainSerializer,
20+
field_validator,
21+
)
1422

1523
from ..api_schemas_long_running_tasks.tasks import TaskGet
1624
from ..basic_types import LongTruncatedStr, ShortTruncatedStr
@@ -130,12 +138,22 @@ class ProjectPatch(InputSchema):
130138
name: ShortTruncatedStr | None = Field(default=None)
131139
description: LongTruncatedStr | None = Field(default=None)
132140
thumbnail: Annotated[
133-
HttpUrl | None, BeforeValidator(empty_str_to_none_pre_validator)
141+
HttpUrl | None,
142+
BeforeValidator(empty_str_to_none_pre_validator),
143+
PlainSerializer(lambda x: str(x) if x is not None else None),
134144
] = Field(default=None)
135145
access_rights: dict[GroupIDStr, AccessRights] | None = Field(default=None)
136146
classifiers: list[ClassifierID] | None = Field(default=None)
137147
dev: dict | None = Field(default=None)
138-
ui: StudyUI | None = Field(default=None)
148+
ui: Annotated[
149+
StudyUI | None,
150+
BeforeValidator(empty_str_to_none_pre_validator),
151+
PlainSerializer(
152+
lambda obj: jsonable_encoder(
153+
obj, exclude_unset=True, by_alias=False
154+
) # For the sake of backward compatibility
155+
),
156+
] = Field(default=None)
139157
quality: dict[str, Any] | None = Field(default=None)
140158

141159

packages/pytest-simcore/src/pytest_simcore/helpers/webserver_projects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async def create_project(
9595
for group_id, permissions in _access_rights.items():
9696
await update_or_insert_project_group(
9797
app,
98-
new_project["uuid"],
98+
project_id=new_project["uuid"],
9999
group_id=int(group_id),
100100
read=permissions["read"],
101101
write=permissions["write"],

packages/settings-library/src/settings_library/efs.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ class AwsEfsSettings(BaseCustomSettings):
1414
EFS_MOUNTED_PATH: Path = Field(
1515
description="This is the path where EFS is mounted to the EC2 machine",
1616
)
17-
EFS_ONLY_ENABLED_FOR_USERIDS: list[int] = Field(
18-
description="This is temporary solution so we can enable it for specific users for testing purpose",
19-
examples=[[1]],
20-
)
2117

2218

2319
NFS_PROTOCOL = "4.1"

services/clusters-keeper/src/simcore_service_clusters_keeper/core/settings.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,6 @@ def LOG_LEVEL(self) -> LogLevel: # noqa: N802
381381
def _valid_log_level(cls, value: str) -> str:
382382
return cls.validate_log_level(value)
383383

384-
@field_validator("SERVICE_TRACKING_HEARTBEAT", mode="before")
385-
@classmethod
386-
def _validate_interval(
387-
cls, value: str | datetime.timedelta
388-
) -> int | datetime.timedelta:
389-
if isinstance(value, str):
390-
return int(value)
391-
return value
392-
393384

394385
def get_application_settings(app: FastAPI) -> ApplicationSettings:
395386
return cast(ApplicationSettings, app.state.settings)

services/clusters-keeper/tests/unit/test_modules_clusters_management_core.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import asyncio
66
import dataclasses
7+
import datetime
78
from collections.abc import Awaitable, Callable
89
from typing import Final
910
from unittest.mock import MagicMock
@@ -36,7 +37,9 @@ def wallet_id(faker: Faker, request: pytest.FixtureRequest) -> WalletID | None:
3637
return faker.pyint(min_value=1) if request.param == "with_wallet" else None
3738

3839

39-
_FAST_TIME_BEFORE_TERMINATION_SECONDS: Final[int] = 10
40+
_FAST_TIME_BEFORE_TERMINATION_SECONDS: Final[datetime.timedelta] = datetime.timedelta(
41+
seconds=10
42+
)
4043

4144

4245
@pytest.fixture
@@ -149,7 +152,7 @@ async def test_cluster_management_core_properly_removes_unused_instances(
149152
mocked_dask_ping_scheduler.is_scheduler_busy.reset_mock()
150153

151154
# running the cluster management task after the heartbeat came in shall not remove anything
152-
await asyncio.sleep(_FAST_TIME_BEFORE_TERMINATION_SECONDS + 1)
155+
await asyncio.sleep(_FAST_TIME_BEFORE_TERMINATION_SECONDS.total_seconds() + 1)
153156
await cluster_heartbeat(initialized_app, user_id=user_id, wallet_id=wallet_id)
154157
await check_clusters(initialized_app)
155158
await _assert_cluster_exist_and_state(
@@ -161,7 +164,7 @@ async def test_cluster_management_core_properly_removes_unused_instances(
161164
mocked_dask_ping_scheduler.is_scheduler_busy.reset_mock()
162165

163166
# after waiting the termination time, running the task shall remove the cluster
164-
await asyncio.sleep(_FAST_TIME_BEFORE_TERMINATION_SECONDS + 1)
167+
await asyncio.sleep(_FAST_TIME_BEFORE_TERMINATION_SECONDS.total_seconds() + 1)
165168
await check_clusters(initialized_app)
166169
await _assert_cluster_exist_and_state(
167170
ec2_client, instances=created_clusters, state="terminated"
@@ -201,7 +204,7 @@ async def test_cluster_management_core_properly_removes_workers_on_shutdown(
201204
ec2_client, instance_ids=worker_instance_ids, state="running"
202205
)
203206
# after waiting the termination time, running the task shall remove the cluster
204-
await asyncio.sleep(_FAST_TIME_BEFORE_TERMINATION_SECONDS + 1)
207+
await asyncio.sleep(_FAST_TIME_BEFORE_TERMINATION_SECONDS.total_seconds() + 1)
205208
await check_clusters(initialized_app)
206209
await _assert_cluster_exist_and_state(
207210
ec2_client, instances=created_clusters, state="terminated"
@@ -314,7 +317,7 @@ async def test_cluster_management_core_removes_broken_clusters_after_some_delay(
314317
mocked_dask_ping_scheduler.is_scheduler_busy.reset_mock()
315318

316319
# waiting for the termination time will now terminate the cluster
317-
await asyncio.sleep(_FAST_TIME_BEFORE_TERMINATION_SECONDS + 1)
320+
await asyncio.sleep(_FAST_TIME_BEFORE_TERMINATION_SECONDS.total_seconds() + 1)
318321
await check_clusters(initialized_app)
319322
await _assert_cluster_exist_and_state(
320323
ec2_client, instances=created_clusters, state="terminated"

services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/_scheduler_base.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,7 @@ async def apply(
540540
project_id: ProjectID,
541541
iteration: Iteration,
542542
) -> None:
543-
"""schedules a pipeline for a given user, project and iteration.
544-
545-
Arguments:
546-
wake_up_callback -- a callback function that is called in a separate thread everytime a pipeline node is completed
547-
"""
543+
"""apply the scheduling of a pipeline for a given user, project and iteration."""
548544
with log_context(
549545
_logger,
550546
level=logging.INFO,

0 commit comments

Comments
 (0)