Skip to content

Commit 41eda48

Browse files
committed
Merge branch 'master' into store_function_outputs
2 parents dc39380 + acb9f05 commit 41eda48

File tree

255 files changed

+6443
-2167
lines changed

Some content is hidden

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

255 files changed

+6443
-2167
lines changed

.env-devel

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,15 @@ VENDOR_DEV_MANUAL_IMAGE=containous/whoami
269269
VENDOR_DEV_MANUAL_REPLICAS=1
270270
VENDOR_DEV_MANUAL_SUBDOMAIN=manual
271271

272-
## VENDOR DEVELOPMENT SERVICES ---
272+
## WEBSERVER SERVICES VARIANTS ---
273273

274274
WB_API_WEBSERVER_HOST=wb-api-server
275275
WB_API_WEBSERVER_PORT=8080
276276

277+
WB_AUTH_WEBSERVER_HOST=wb-auth
278+
WB_AUTH_WEBSERVER_PORT=8080
279+
WB_AUTH_LOGLEVEL=INFO
280+
277281
WB_GC_ACTIVITY=null
278282
WB_GC_ANNOUNCEMENTS=0
279283
WB_GC_CATALOG=null
@@ -395,6 +399,7 @@ WEBSERVER_PROJECTS={}
395399
WEBSERVER_PROMETHEUS_API_VERSION=v1
396400
WEBSERVER_PROMETHEUS_URL=http://prometheus:9090
397401
WEBSERVER_PUBLICATIONS=1
402+
WEBSERVER_REALTIME_COLLABORATION='{"RTC_MAX_NUMBER_OF_USERS":3}'
398403
WEBSERVER_SCICRUNCH={}
399404
WEBSERVER_SESSION_SECRET_KEY='REPLACE_ME_with_result__Fernet_generate_key='
400405
WEBSERVER_SOCKETIO=1

.github/workflows/ci-arm-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: show system environs
3939
run: ./ci/helpers/show_system_versions.bash
4040
- name: login to Dockerhub
41-
uses: docker/login-action@v2
41+
uses: docker/login-action@v3
4242
with:
4343
username: ${{ secrets.DOCKER_USERNAME }}
4444
password: ${{ secrets.DOCKER_PASSWORD }}

.github/workflows/ci-multi-architecture-fusing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: show system environs
4040
run: ./ci/helpers/show_system_versions.bash
4141
- name: login to Dockerhub
42-
uses: docker/login-action@v2
42+
uses: docker/login-action@v3
4343
with:
4444
username: ${{ secrets.DOCKER_USERNAME }}
4545
password: ${{ secrets.DOCKER_PASSWORD }}

api/specs/web-server/_functions.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@
77

88
from typing import Annotated
99

10+
from _common import as_query
1011
from fastapi import APIRouter, Depends, status
1112
from models_library.api_schemas_webserver.functions import (
1213
FunctionToRegister,
1314
RegisteredFunctionGet,
15+
RegisteredFunctionUpdate,
1416
)
1517
from models_library.generics import Envelope
1618
from simcore_service_webserver._meta import API_VTAG
1719
from simcore_service_webserver.functions._controller._functions_rest_schemas import (
20+
FunctionGetQueryParams,
1821
FunctionPathParams,
22+
FunctionsListQueryParams,
1923
)
2024

2125
router = APIRouter(
@@ -35,12 +39,32 @@ async def register_function(
3539
) -> Envelope[RegisteredFunctionGet]: ...
3640

3741

42+
@router.get(
43+
"/functions",
44+
response_model=Envelope[list[RegisteredFunctionGet]],
45+
)
46+
async def list_functions(
47+
_query: Annotated[as_query(FunctionsListQueryParams), Depends()],
48+
): ...
49+
50+
3851
@router.get(
3952
"/functions/{function_id}",
4053
response_model=Envelope[RegisteredFunctionGet],
4154
)
4255
async def get_function(
4356
_path: Annotated[FunctionPathParams, Depends()],
57+
_query: Annotated[as_query(FunctionGetQueryParams), Depends()],
58+
): ...
59+
60+
61+
@router.patch(
62+
"/functions/{function_id}",
63+
response_model=Envelope[RegisteredFunctionGet],
64+
)
65+
async def update_function(
66+
_body: RegisteredFunctionUpdate,
67+
_path: Annotated[FunctionPathParams, Depends()],
4468
): ...
4569

4670

api/specs/web-server/_users.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
from models_library.api_schemas_webserver.users import (
1111
MyFunctionPermissionsGet,
1212
MyPermissionGet,
13-
MyPhoneConfirm,
14-
MyPhoneRegister,
1513
MyProfileRestGet,
1614
MyProfileRestPatch,
1715
MyTokenCreate,
@@ -32,6 +30,10 @@
3230
UserNotificationCreate,
3331
UserNotificationPatch,
3432
)
33+
from simcore_service_webserver.users._controller.rest._rest_schemas import (
34+
MyPhoneConfirm,
35+
MyPhoneRegister,
36+
)
3537

3638
router = APIRouter(prefix=f"/{API_VTAG}", tags=["users"])
3739

api/specs/web-server/_users_admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from models_library.generics import Envelope
2020
from models_library.rest_pagination import Page
2121
from simcore_service_webserver._meta import API_VTAG
22-
from simcore_service_webserver.users.schemas import PreRegisteredUserGet
22+
from simcore_service_webserver.users.schemas import UserAccountRestPreRegister
2323

2424
router = APIRouter(prefix=f"/{API_VTAG}", tags=["users"])
2525

@@ -69,4 +69,4 @@ async def search_user_accounts(
6969
response_model=Envelope[UserAccountGet],
7070
tags=_extra_tags,
7171
)
72-
async def pre_register_user_account(_body: PreRegisteredUserGet): ...
72+
async def pre_register_user_account(_body: UserAccountRestPreRegister): ...

packages/models-library/src/models_library/api_schemas_directorv2/computations.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from ..basic_types import IDStr
1515
from ..projects import ProjectID
16-
from ..projects_nodes_io import NodeID
16+
from ..projects_nodes_io import NodeID, SimcoreS3FileID
1717
from ..projects_pipeline import ComputationTask
1818
from ..users import UserID
1919
from ..wallets import WalletInfo
@@ -126,6 +126,30 @@ class TaskLogFileGet(BaseModel):
126126
] = None
127127

128128

129+
class TaskLogFileIdGet(BaseModel):
130+
task_id: NodeID
131+
file_id: SimcoreS3FileID | None
132+
133+
model_config = ConfigDict(
134+
json_schema_extra={
135+
"examples": [
136+
{
137+
"task_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
138+
"file_id": "1c46752c-b096-11ea-a3c4-02420a00392e/3fa85f64-5717-4562-b3fc-2c963f66afa6/logs/task_logs.txt",
139+
},
140+
{
141+
"task_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
142+
"file_id": "1c46752c-b096-11ea-a3c4-02420a00392e/6ba7b810-9dad-11d1-80b4-00c04fd430c8/logs/debug.log",
143+
},
144+
{
145+
"task_id": "6ba7b811-9dad-11d1-80b4-00c04fd430c8",
146+
"file_id": None,
147+
},
148+
]
149+
}
150+
)
151+
152+
129153
class TasksSelection(BaseModel):
130154
nodes_ids: list[NodeID]
131155

packages/models-library/src/models_library/api_schemas_long_running_tasks/tasks.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
from datetime import datetime
33
from typing import Any
44

5-
from pydantic import BaseModel, field_validator
5+
from common_library.exclude import Unset
6+
from pydantic import BaseModel, ConfigDict, model_validator
67

78
from .base import TaskId, TaskProgress
89

@@ -20,15 +21,30 @@ class TaskResult(BaseModel):
2021

2122
class TaskBase(BaseModel):
2223
task_id: TaskId
23-
task_name: str
24+
task_name: str | Unset = Unset.VALUE
25+
26+
@model_validator(mode="after")
27+
def try_populate_task_name_from_task_id(self) -> "TaskBase":
28+
# NOTE: currently this model is used to validate tasks coming from
29+
# the celery backend and form long_running_tasks
30+
# 1. if a task comes from Celery, it will keep it's given name
31+
# 2. if a task comes from long_running_tasks, it will extract it form
32+
# the task_id, which looks like "{PREFIX}.{TASK_NAME}.UNIQUE|{UUID}"
33+
34+
if self.task_id and self.task_name == Unset.VALUE:
35+
parts = self.task_id.split(".")
36+
if len(parts) > 1:
37+
self.task_name = urllib.parse.unquote(parts[1])
38+
39+
if self.task_name == Unset.VALUE:
40+
self.task_name = self.task_id
41+
42+
return self
43+
44+
model_config = ConfigDict(arbitrary_types_allowed=True)
2445

2546

2647
class TaskGet(TaskBase):
2748
status_href: str
2849
result_href: str
2950
abort_href: str
30-
31-
@field_validator("task_name")
32-
@classmethod
33-
def unquote_str(cls, v) -> str:
34-
return urllib.parse.unquote(v)

packages/models-library/src/models_library/api_schemas_rpc_async_jobs/async_jobs.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ class AsyncJobResult(BaseModel):
3030

3131

3232
class AsyncJobGet(BaseModel):
33+
model_config = ConfigDict(
34+
json_schema_extra={
35+
"examples": [
36+
{
37+
"job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
38+
"job_name": "export_data_task",
39+
}
40+
]
41+
}
42+
)
43+
3344
job_id: AsyncJobId
3445
job_name: AsyncJobName
3546

@@ -42,6 +53,18 @@ class AsyncJobAbort(BaseModel):
4253
class AsyncJobFilter(AsyncJobFilterBase):
4354
"""Data for controlling access to an async job"""
4455

56+
model_config = ConfigDict(
57+
json_schema_extra={
58+
"examples": [
59+
{
60+
"product_name": "osparc",
61+
"user_id": 123,
62+
"client_name": "web_client",
63+
}
64+
]
65+
},
66+
)
67+
4568
product_name: ProductName
4669
user_id: UserID
4770
client_name: Annotated[

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

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from models_library.rest_base import RequestParameters
66
from pydantic import AliasGenerator, ConfigDict, Field, HttpUrl, SecretStr
77
from pydantic.alias_generators import to_camel
8+
from pydantic.config import JsonDict
89

910
from ..emails import LowerCaseEmailStr
1011
from ._base import InputSchema, OutputSchema
@@ -14,33 +15,39 @@ class AccountRequestInfo(InputSchema):
1415
form: dict[str, Any]
1516
captcha: str
1617

18+
@staticmethod
19+
def _update_json_schema_extra(schema: JsonDict) -> None:
20+
schema.update(
21+
{
22+
"example": {
23+
"form": {
24+
"firstName": "James",
25+
"lastName": "Maxwel",
26+
"email": "[email protected]",
27+
"phone": "+41 44 245 96 96",
28+
"company": "EM Com",
29+
"address": "Infinite Loop",
30+
"city": "Washington",
31+
"postalCode": "98001",
32+
"country": "Switzerland",
33+
"application": "Antenna_Design",
34+
"description": "Description of something",
35+
"hear": "Search_Engine",
36+
"privacyPolicy": True,
37+
"eula": True,
38+
},
39+
"captcha": "A12B34",
40+
}
41+
}
42+
)
43+
1744
model_config = ConfigDict(
1845
str_strip_whitespace=True,
1946
str_max_length=200,
2047
# NOTE: this is just informative. The format of the form is defined
2148
# currently in the front-end and it might change
2249
# SEE image in https://github.com/ITISFoundation/osparc-simcore/pull/5378
23-
json_schema_extra={
24-
"example": {
25-
"form": {
26-
"firstName": "James",
27-
"lastName": "Maxwel",
28-
"email": "[email protected]",
29-
"phone": "+1 123456789",
30-
"company": "EM Com",
31-
"address": "Infinite Loop",
32-
"city": "Washington",
33-
"postalCode": "98001",
34-
"country": "USA",
35-
"application": "Antenna_Design",
36-
"description": "Description of something",
37-
"hear": "Search_Engine",
38-
"privacyPolicy": True,
39-
"eula": True,
40-
},
41-
"captcha": "A12B34",
42-
}
43-
},
50+
json_schema_extra=_update_json_schema_extra,
4451
)
4552

4653

0 commit comments

Comments
 (0)