Skip to content

Commit f9e757f

Browse files
author
Andrei Neagu
committed
Merge remote-tracking branch 'upstream/master' into pr-osparc-dy-sidecar-ports-migrate
2 parents 10f15d0 + 1f37607 commit f9e757f

File tree

529 files changed

+16459
-4846
lines changed

Some content is hidden

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

529 files changed

+16459
-4846
lines changed

.env-devel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,14 @@ DYNAMIC_SCHEDULER_UI_STORAGE_SECRET=adminadmin
141141
FUNCTION_SERVICES_AUTHORS='{"UN": {"name": "Unknown", "email": "[email protected]", "affiliation": "unknown"}}'
142142

143143
WEBSERVER_LICENSES={}
144+
WEBSERVER_FOGBUGZ={}
144145
LICENSES_ITIS_VIP_SYNCER_ENABLED=false
145146
LICENSES_ITIS_VIP_SYNCER_PERIODICITY=1D00:00:00
146147
LICENSES_ITIS_VIP_API_URL=https://replace-with-itis-api/{category}
147148
LICENSES_ITIS_VIP_CATEGORIES='{"HumanWholeBody": "Humans", "HumanBodyRegion": "Humans (Region)", "AnimalWholeBody": "Animal"}'
148149
LICENSES_SPEAG_PHANTOMS_API_URL=https://replace-with-speag-api/{category}
149150
LICENSES_SPEAG_PHANTOMS_CATEGORIES='{"ComputationalPhantom": "Phantom of the Opera"}'
151+
LONG_RUNNING_TASKS_NAMESPACE_SUFFIX=development
150152

151153
# Can use 'docker run -it itisfoundation/invitations:latest simcore-service-invitations generate-dotenv --auto-password'
152154
INVITATIONS_DEFAULT_PRODUCT=osparc

.github/actions/setup-simcore-env/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ inputs:
1010
uv-version:
1111
description: 'UV version to use'
1212
required: false
13-
default: '0.7.x'
13+
default: '0.8.x'
1414

1515
cache-dependency-glob:
1616
description: 'Glob pattern for cache dependency files'

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ jobs:
10571057
unit-test-dynamic-sidecar:
10581058
needs: changes
10591059
if: ${{ needs.changes.outputs.dynamic-sidecar == 'true' || github.event_name == 'push' || github.event.inputs.force_all_builds == 'true' }}
1060-
timeout-minutes: 18 # if this timeout gets too small, then split the tests
1060+
timeout-minutes: 19 # if this timeout gets too small, then split the tests
10611061
name: "[unit] dynamic-sidecar"
10621062
runs-on: ${{ matrix.os }}
10631063
strategy:
@@ -1252,7 +1252,7 @@ jobs:
12521252
unit-test-service-library:
12531253
needs: changes
12541254
if: ${{ needs.changes.outputs.service-library == 'true' || github.event_name == 'push' || github.event.inputs.force_all_builds == 'true' }}
1255-
timeout-minutes: 18 # if this timeout gets too small, then split the tests
1255+
timeout-minutes: 20 # if this timeout gets too small, then split the tests
12561256
name: "[unit] service-library"
12571257
runs-on: ${{ matrix.os }}
12581258
strategy:

Makefile

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,31 @@ export DOCKER_REGISTRY ?= itisfoundation
8989

9090
MAKEFILES_WITH_OPENAPI_SPECS := $(shell find . -mindepth 2 -type f -name 'Makefile' -not -path '*/.*' -exec grep -l '^openapi-specs:' {} \; | xargs realpath)
9191

92+
# WSL 2 tricks
93+
define _check_wsl_mirroring
94+
$(shell \
95+
if [ "$(IS_WSL2)" = "WSL2" ]; then \
96+
win_user=$$(powershell.exe '$$env:UserName' | tr -d '\r' | tail -n 1 | xargs); \
97+
config_path="/mnt/c/Users/$$win_user/.wslconfig"; \
98+
if [ -f "$$config_path" ] && grep -q "networkingMode.*=.*mirrored" "$$config_path" 2>/dev/null; then \
99+
echo "true"; \
100+
else \
101+
echo "false"; \
102+
fi; \
103+
else \
104+
echo "false"; \
105+
fi \
106+
)
107+
endef
108+
109+
WSL_MIRRORED := $(_check_wsl_mirroring)
110+
111+
112+
ifeq ($(WSL_MIRRORED),true)
113+
get_my_ip := 127.0.0.1
114+
else
92115
get_my_ip := $(shell (hostname --all-ip-addresses || hostname -i) 2>/dev/null | cut --delimiter=" " --fields=1)
116+
endif
93117

94118
# NOTE: this is only for WSL2 as the WSL2 subsystem IP is changing on each reboot
95119
ifeq ($(IS_WSL2),WSL2)
@@ -683,7 +707,7 @@ local-registry: .env ## creates a local docker registry and configure simcore to
683707
--publish 5000:5000 \
684708
--volume $(LOCAL_REGISTRY_VOLUME):/var/lib/registry \
685709
--name $(LOCAL_REGISTRY_HOSTNAME) \
686-
registry:2)
710+
registry:3)
687711

688712
# WARNING: environment file .env is now setup to use local registry on port 5000 without any security (take care!)...
689713
@echo REGISTRY_AUTH=False >> .env
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
"""Helper script to automatically generate OAS
2+
3+
This OAS are the source of truth
4+
"""
5+
6+
# pylint: disable=redefined-outer-name
7+
# pylint: disable=unused-argument
8+
# pylint: disable=unused-variable
9+
# pylint: disable=too-many-arguments
10+
11+
12+
from typing import Annotated
13+
14+
from _common import as_query
15+
from fastapi import APIRouter, Depends, status
16+
from models_library.api_schemas_webserver.conversations import (
17+
ConversationMessagePatch,
18+
ConversationMessageRestGet,
19+
ConversationPatch,
20+
ConversationRestGet,
21+
)
22+
from models_library.generics import Envelope
23+
from models_library.rest_pagination import Page
24+
from simcore_service_webserver._meta import API_VTAG
25+
from simcore_service_webserver.conversations._controller._common import (
26+
ConversationPathParams,
27+
)
28+
from simcore_service_webserver.conversations._controller._conversations_messages_rest import (
29+
_ConversationMessageCreateBodyParams,
30+
_ConversationMessagePathParams,
31+
_ListConversationMessageQueryParams,
32+
)
33+
from simcore_service_webserver.conversations._controller._conversations_rest import (
34+
_ConversationsCreateBodyParams,
35+
_ListConversationsQueryParams,
36+
)
37+
38+
router = APIRouter(
39+
prefix=f"/{API_VTAG}",
40+
tags=[
41+
"conversations",
42+
],
43+
)
44+
45+
46+
#
47+
# API entrypoints CONVERSATIONS
48+
#
49+
50+
51+
@router.post(
52+
"/conversations",
53+
response_model=Envelope[ConversationRestGet],
54+
status_code=status.HTTP_201_CREATED,
55+
)
56+
async def create_conversation(
57+
_body: _ConversationsCreateBodyParams,
58+
): ...
59+
60+
61+
@router.get(
62+
"/conversations",
63+
response_model=Page[ConversationRestGet],
64+
)
65+
async def list_conversations(
66+
_query: Annotated[_ListConversationsQueryParams, Depends()],
67+
): ...
68+
69+
70+
@router.patch(
71+
"/conversations/{conversation_id}",
72+
response_model=Envelope[ConversationRestGet],
73+
)
74+
async def update_conversation(
75+
_params: Annotated[ConversationPathParams, Depends()],
76+
_body: ConversationPatch,
77+
): ...
78+
79+
80+
@router.delete(
81+
"/conversations/{conversation_id}",
82+
status_code=status.HTTP_204_NO_CONTENT,
83+
)
84+
async def delete_conversation(
85+
_params: Annotated[ConversationPathParams, Depends()],
86+
): ...
87+
88+
89+
@router.get(
90+
"/conversations/{conversation_id}",
91+
response_model=Envelope[ConversationRestGet],
92+
)
93+
async def get_conversation(
94+
_params: Annotated[ConversationPathParams, Depends()],
95+
): ...
96+
97+
98+
#
99+
# API entrypoints CONVERSATION MESSAGES
100+
#
101+
102+
103+
@router.post(
104+
"/conversations/{conversation_id}/messages",
105+
response_model=Envelope[ConversationMessageRestGet],
106+
status_code=status.HTTP_201_CREATED,
107+
)
108+
async def create_conversation_message(
109+
_params: Annotated[ConversationPathParams, Depends()],
110+
_body: _ConversationMessageCreateBodyParams,
111+
): ...
112+
113+
114+
@router.get(
115+
"/conversations/{conversation_id}/messages",
116+
response_model=Page[ConversationMessageRestGet],
117+
)
118+
async def list_conversation_messages(
119+
_params: Annotated[ConversationPathParams, Depends()],
120+
_query: Annotated[as_query(_ListConversationMessageQueryParams), Depends()],
121+
): ...
122+
123+
124+
@router.put(
125+
"/conversations/{conversation_id}/messages/{message_id}",
126+
response_model=Envelope[ConversationMessageRestGet],
127+
)
128+
async def update_conversation_message(
129+
_params: Annotated[_ConversationMessagePathParams, Depends()],
130+
_body: ConversationMessagePatch,
131+
): ...
132+
133+
134+
@router.delete(
135+
"/conversations/{conversation_id}/messages/{message_id}",
136+
status_code=status.HTTP_204_NO_CONTENT,
137+
)
138+
async def delete_conversation_message(
139+
_params: Annotated[_ConversationMessagePathParams, Depends()],
140+
): ...
141+
142+
143+
@router.get(
144+
"/conversations/{conversation_id}/messages/{message_id}",
145+
response_model=Envelope[ConversationMessageRestGet],
146+
)
147+
async def get_conversation_message(
148+
_params: Annotated[_ConversationMessagePathParams, Depends()],
149+
): ...

api/specs/web-server/_functions.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@
1010
from _common import as_query
1111
from fastapi import APIRouter, Depends, status
1212
from models_library.api_schemas_webserver.functions import (
13+
FunctionGroupAccessRightsGet,
14+
FunctionGroupAccessRightsUpdate,
1315
FunctionToRegister,
1416
RegisteredFunctionGet,
1517
RegisteredFunctionUpdate,
1618
)
1719
from models_library.generics import Envelope
20+
from models_library.groups import GroupID
1821
from simcore_service_webserver._meta import API_VTAG
22+
from simcore_service_webserver.functions._controller._functions_rest import (
23+
FunctionGroupPathParams,
24+
)
1925
from simcore_service_webserver.functions._controller._functions_rest_schemas import (
2026
FunctionGetQueryParams,
2127
FunctionPathParams,
@@ -75,3 +81,33 @@ async def update_function(
7581
async def delete_function(
7682
_path: Annotated[FunctionPathParams, Depends()],
7783
): ...
84+
85+
86+
@router.get(
87+
"/functions/{function_id}/groups",
88+
response_model=Envelope[dict[GroupID, FunctionGroupAccessRightsGet]],
89+
)
90+
async def get_function_groups(
91+
_path: Annotated[FunctionPathParams, Depends()],
92+
): ...
93+
94+
95+
@router.put(
96+
"/functions/{function_id}/groups/{group_id}",
97+
summary="Create or update a Function Group",
98+
response_model=Envelope[FunctionGroupAccessRightsGet],
99+
)
100+
async def create_or_update_function_group(
101+
_path: Annotated[FunctionGroupPathParams, Depends()],
102+
_body: FunctionGroupAccessRightsUpdate,
103+
): ...
104+
105+
106+
@router.delete(
107+
"/functions/{function_id}/groups/{group_id}",
108+
summary="Delete a Function Group",
109+
status_code=status.HTTP_204_NO_CONTENT,
110+
)
111+
async def delete_function_group(
112+
_path: Annotated[FunctionGroupPathParams, Depends()],
113+
): ...

api/specs/web-server/_long_running_tasks.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,44 +32,40 @@
3232
@router.get(
3333
"/tasks",
3434
response_model=Envelope[list[TaskGet]],
35-
name="list_tasks",
36-
description="Lists all long running tasks",
3735
responses=_export_data_responses,
3836
)
39-
def get_async_jobs(): ...
37+
def get_async_jobs():
38+
"""Lists all long running tasks"""
4039

4140

4241
@router.get(
4342
"/tasks/{task_id}",
4443
response_model=Envelope[TaskStatus],
45-
name="get_task_status",
46-
description="Retrieves the status of a task",
4744
responses=_export_data_responses,
4845
)
4946
def get_async_job_status(
5047
_path_params: Annotated[_PathParam, Depends()],
51-
): ...
48+
):
49+
"""Retrieves the status of a task"""
5250

5351

5452
@router.delete(
5553
"/tasks/{task_id}",
56-
name="cancel_and_delete_task",
57-
description="Cancels and deletes a task",
5854
responses=_export_data_responses,
5955
status_code=status.HTTP_204_NO_CONTENT,
6056
)
6157
def cancel_async_job(
6258
_path_params: Annotated[_PathParam, Depends()],
63-
): ...
59+
):
60+
"""Cancels and removes a task"""
6461

6562

6663
@router.get(
6764
"/tasks/{task_id}/result",
6865
response_model=Any,
69-
name="get_task_result",
70-
description="Retrieves the result of a task",
7166
responses=_export_data_responses,
7267
)
7368
def get_async_job_result(
7469
_path_params: Annotated[_PathParam, Depends()],
75-
): ...
70+
):
71+
"""Retrieves the result of a task"""

api/specs/web-server/_long_running_tasks_legacy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ async def get_task_status(
4242

4343
@router.delete(
4444
"/{task_id}",
45-
name="cancel_and_delete_task",
46-
description="Cancels and deletes a task",
45+
name="remove_task",
46+
description="Cancels and removes a task",
4747
status_code=status.HTTP_204_NO_CONTENT,
4848
)
49-
async def cancel_and_delete_task(
49+
async def remove_task(
5050
_path_params: Annotated[_PathParam, Depends()],
5151
): ...
5252

api/specs/web-server/_projects_conversations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from typing import Annotated
1313

1414
from fastapi import APIRouter, Depends, status
15-
from models_library.api_schemas_webserver.projects_conversations import (
15+
from models_library.api_schemas_webserver.conversations import (
1616
ConversationMessageRestGet,
1717
ConversationRestGet,
1818
)

api/specs/web-server/openapi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# core ---
2222
"_auth",
2323
"_auth_api_keys",
24+
"_conversations",
2425
"_groups",
2526
"_tags",
2627
"_tags_groups", # after _tags

0 commit comments

Comments
 (0)