Skip to content

Commit acb9f05

Browse files
GitHKAndrei Neagu
andauthored
✨new style dynamic services can now be marked as collaborative ⚠️🚨 (ITISFoundation#8136)
Co-authored-by: Andrei Neagu <[email protected]>
1 parent abfb431 commit acb9f05

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

packages/models-library/src/models_library/service_settings_labels.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,16 @@ class DynamicSidecarServiceLabels(BaseModel):
372372
),
373373
] = None
374374

375+
is_collaborative: Annotated[
376+
bool,
377+
Field(
378+
alias="simcore.service.is-collaborative",
379+
description=(
380+
"if True, the service is collaborative and will not be locked"
381+
),
382+
),
383+
] = False
384+
375385
compose_spec: Annotated[
376386
Json[ComposeSpecLabelDict | None] | None,
377387
Field(
@@ -663,6 +673,7 @@ def _update_json_schema_extra(schema: JsonDict) -> None:
663673
"simcore.service.user-preferences-path": json_dumps(
664674
"/tmp/path_to_preferences" # noqa: S108
665675
),
676+
"simcore.service.is_collaborative": "False",
666677
},
667678
# dynamic-service with compose spec
668679
{
@@ -702,6 +713,7 @@ def _update_json_schema_extra(schema: JsonDict) -> None:
702713
"simcore.service.callbacks-mapping": json_dumps(
703714
CallbacksMapping.model_json_schema()["examples"][3]
704715
),
716+
"simcore.service.is_collaborative": "True",
705717
},
706718
]
707719
},

packages/models-library/tests/test_service_settings_labels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ class _Parametrization(NamedTuple):
5252
),
5353
"dynamic-service": _Parametrization(
5454
example=SimcoreServiceLabels.model_json_schema()["examples"][1],
55-
items=5,
55+
items=6,
5656
uses_dynamic_sidecar=True,
5757
),
5858
"dynamic-service-with-compose-spec": _Parametrization(
5959
example=SimcoreServiceLabels.model_json_schema()["examples"][2],
60-
items=6,
60+
items=7,
6161
uses_dynamic_sidecar=True,
6262
),
6363
}

packages/service-integration/src/service_integration/osparc_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ class RuntimeConfig(BaseModel):
213213

214214
paths_mapping: PathMappingsLabel | None = None
215215

216+
is_collaborative: bool = False
217+
216218
user_preferences_path: Path | None = None
217219
boot_options: BootOptions | None = None
218220
min_visible_inputs: NonNegativeInt | None = None

services/director-v2/openapi.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,6 +2852,11 @@
28522852
"paths_mapping": {
28532853
"$ref": "#/components/schemas/PathMappingsLabel"
28542854
},
2855+
"is_collaborative": {
2856+
"type": "boolean",
2857+
"title": "Is Collaborative",
2858+
"default": false
2859+
},
28552860
"simcore.service.compose-spec": {
28562861
"anyOf": [
28572862
{

services/director-v2/src/simcore_service_director_v2/models/dynamic_services_scheduler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ def endpoint(self) -> AnyHttpUrl:
406406

407407
paths_mapping: PathMappingsLabel # overwrites in DynamicSidecarServiceLabels
408408

409+
is_collaborative: bool = False
410+
409411
user_preferences_path: Path | None = None
410412
callbacks_mapping: Annotated[CallbacksMapping, Field(default_factory=dict)]
411413

@@ -513,6 +515,7 @@ def from_http_request(
513515
"product_name": service.product_name,
514516
"product_api_base_url": service.product_api_base_url,
515517
"paths_mapping": simcore_service_labels.paths_mapping,
518+
"is_collaborative": simcore_service_labels.is_collaborative,
516519
"callbacks_mapping": simcore_service_labels.callbacks_mapping,
517520
"compose_spec": json_dumps(simcore_service_labels.compose_spec),
518521
"container_http_entry": simcore_service_labels.container_http_entry,

0 commit comments

Comments
 (0)