Skip to content

Commit fc36a49

Browse files
committed
Merge branch 'enh/second-app-for-s4l-lite' of github.com:odeimaiz/osparc-simcore into enh/second-app-for-s4l-lite
2 parents 5378874 + c445bb8 commit fc36a49

File tree

29 files changed

+1043
-832
lines changed

29 files changed

+1043
-832
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import datetime
12
from collections.abc import Mapping
23
from enum import Enum
34
from typing import Annotated, Any, Literal, TypeAlias
@@ -75,7 +76,10 @@ class FunctionClass(str, Enum):
7576
# see here https://github.com/ITISFoundation/osparc-simcore/issues/7659
7677
FunctionInputs: TypeAlias = dict[str, Any] | None
7778

78-
FunctionInputsList: TypeAlias = list[FunctionInputs]
79+
FunctionInputsList: TypeAlias = Annotated[
80+
list[FunctionInputs],
81+
Field(max_length=50),
82+
]
7983

8084
FunctionOutputs: TypeAlias = dict[str, Any] | None
8185

@@ -93,6 +97,7 @@ class FunctionBase(BaseModel):
9397

9498
class RegisteredFunctionBase(FunctionBase):
9599
uid: FunctionID
100+
created_at: datetime.datetime
96101

97102

98103
class ProjectFunction(FunctionBase):
@@ -149,6 +154,7 @@ class FunctionJobBase(BaseModel):
149154

150155
class RegisteredFunctionJobBase(FunctionJobBase):
151156
uid: FunctionJobID
157+
created_at: datetime.datetime
152158

153159

154160
class ProjectFunctionJob(FunctionJobBase):
@@ -204,6 +210,7 @@ class FunctionJobCollection(BaseModel):
204210

205211
class RegisteredFunctionJobCollection(FunctionJobCollection):
206212
uid: FunctionJobCollectionID
213+
created_at: datetime.datetime
207214

208215

209216
class FunctionJobCollectionStatus(BaseModel):
@@ -222,6 +229,7 @@ class FunctionJobDB(BaseModel):
222229

223230
class RegisteredFunctionJobDB(FunctionJobDB):
224231
uuid: FunctionJobID
232+
created: datetime.datetime
225233

226234

227235
class FunctionDB(BaseModel):
@@ -236,6 +244,7 @@ class FunctionDB(BaseModel):
236244

237245
class RegisteredFunctionDB(FunctionDB):
238246
uuid: FunctionID
247+
created: datetime.datetime
239248

240249

241250
class FunctionJobCollectionDB(BaseModel):
@@ -245,6 +254,7 @@ class FunctionJobCollectionDB(BaseModel):
245254

246255
class RegisteredFunctionJobCollectionDB(FunctionJobCollectionDB):
247256
uuid: FunctionJobCollectionID
257+
created: datetime.datetime
248258

249259

250260
class FunctionIDString(ConstrainedStr):

services/api-server/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8.0
1+
0.9.0

services/api-server/openapi.json

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"info": {
44
"title": "osparc.io public API",
55
"description": "osparc-simcore public API specifications",
6-
"version": "0.8.0"
6+
"version": "0.9.0"
77
},
88
"paths": {
99
"/v0/meta": {
@@ -5286,7 +5286,7 @@
52865286
"function_jobs"
52875287
],
52885288
"summary": "List Function Jobs",
5289-
"description": "List function jobs\n\nNew in *version 0.8.0*",
5289+
"description": "List function jobs\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
52905290
"operationId": "list_function_jobs",
52915291
"security": [
52925292
{
@@ -5346,7 +5346,7 @@
53465346
"function_jobs"
53475347
],
53485348
"summary": "Register Function Job",
5349-
"description": "Create function job\n\nNew in *version 0.8.0*",
5349+
"description": "Create function job\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
53505350
"operationId": "register_function_job",
53515351
"security": [
53525352
{
@@ -5431,7 +5431,7 @@
54315431
"function_jobs"
54325432
],
54335433
"summary": "Get Function Job",
5434-
"description": "Get function job\n\nNew in *version 0.8.0*",
5434+
"description": "Get function job\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
54355435
"operationId": "get_function_job",
54365436
"security": [
54375437
{
@@ -6810,7 +6810,7 @@
68106810
"functions"
68116811
],
68126812
"summary": "Register Function",
6813-
"description": "Create function\n\nNew in *version 0.8.0*",
6813+
"description": "Create function\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
68146814
"operationId": "register_function",
68156815
"security": [
68166816
{
@@ -6903,7 +6903,7 @@
69036903
"functions"
69046904
],
69056905
"summary": "List Functions",
6906-
"description": "List functions\n\nNew in *version 0.8.0*",
6906+
"description": "List functions\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
69076907
"operationId": "list_functions",
69086908
"security": [
69096909
{
@@ -6965,7 +6965,7 @@
69656965
"functions"
69666966
],
69676967
"summary": "Get Function",
6968-
"description": "Get function\n\nNew in *version 0.8.0*",
6968+
"description": "Get function\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
69696969
"operationId": "get_function",
69706970
"security": [
69716971
{
@@ -7098,7 +7098,7 @@
70987098
"functions"
70997099
],
71007100
"summary": "List Function Jobs For Functionid",
7101-
"description": "List function jobs for a function\n\nNew in *version 0.8.0*",
7101+
"description": "List function jobs for a function\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
71027102
"operationId": "list_function_jobs_for_functionid",
71037103
"security": [
71047104
{
@@ -7170,7 +7170,7 @@
71707170
"functions"
71717171
],
71727172
"summary": "Update Function Title",
7173-
"description": "Update function\n\nNew in *version 0.8.0*",
7173+
"description": "Update function\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
71747174
"operationId": "update_function_title",
71757175
"security": [
71767176
{
@@ -7257,7 +7257,7 @@
72577257
"functions"
72587258
],
72597259
"summary": "Update Function Description",
7260-
"description": "Update function\n\nNew in *version 0.8.0*",
7260+
"description": "Update function\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
72617261
"operationId": "update_function_description",
72627262
"security": [
72637263
{
@@ -7568,7 +7568,7 @@
75687568
"functions"
75697569
],
75707570
"summary": "Run Function",
7571-
"description": "Run function\n\nNew in *version 0.8.0*",
7571+
"description": "Run function\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
75727572
"operationId": "run_function",
75737573
"security": [
75747574
{
@@ -7664,7 +7664,7 @@
76647664
"functions"
76657665
],
76667666
"summary": "Map Function",
7667-
"description": "Map function over input parameters\n\nNew in *version 0.8.0*",
7667+
"description": "Map function over input parameters\n\nNew in *version 0.8.0*\n\nAdded in *version 0.9.0*: add `created_at` field in the registered function-related objects",
76687668
"operationId": "map_function",
76697669
"security": [
76707670
{
@@ -7699,6 +7699,7 @@
76997699
}
77007700
]
77017701
},
7702+
"maxItems": 50,
77027703
"title": "Function Inputs List"
77037704
}
77047705
}
@@ -10093,11 +10094,17 @@
1009310094
"type": "string",
1009410095
"format": "uuid",
1009510096
"title": "Uid"
10097+
},
10098+
"created_at": {
10099+
"type": "string",
10100+
"format": "date-time",
10101+
"title": "Created At"
1009610102
}
1009710103
},
1009810104
"type": "object",
1009910105
"required": [
10100-
"uid"
10106+
"uid",
10107+
"created_at"
1010110108
],
1010210109
"title": "RegisteredFunctionJobCollection"
1010310110
},
@@ -10163,6 +10170,11 @@
1016310170
"format": "uuid",
1016410171
"title": "Uid"
1016510172
},
10173+
"created_at": {
10174+
"type": "string",
10175+
"format": "date-time",
10176+
"title": "Created At"
10177+
},
1016610178
"project_id": {
1016710179
"type": "string",
1016810180
"format": "uuid",
@@ -10175,6 +10187,7 @@
1017510187
"output_schema",
1017610188
"default_inputs",
1017710189
"uid",
10190+
"created_at",
1017810191
"project_id"
1017910192
],
1018010193
"title": "RegisteredProjectFunction"
@@ -10229,6 +10242,11 @@
1022910242
"format": "uuid",
1023010243
"title": "Uid"
1023110244
},
10245+
"created_at": {
10246+
"type": "string",
10247+
"format": "date-time",
10248+
"title": "Created At"
10249+
},
1023210250
"project_job_id": {
1023310251
"type": "string",
1023410252
"format": "uuid",
@@ -10241,6 +10259,7 @@
1024110259
"inputs",
1024210260
"outputs",
1024310261
"uid",
10262+
"created_at",
1024410263
"project_job_id"
1024510264
],
1024610265
"title": "RegisteredProjectFunctionJob"
@@ -10307,6 +10326,11 @@
1030710326
"format": "uuid",
1030810327
"title": "Uid"
1030910328
},
10329+
"created_at": {
10330+
"type": "string",
10331+
"format": "date-time",
10332+
"title": "Created At"
10333+
},
1031010334
"code_url": {
1031110335
"type": "string",
1031210336
"title": "Code Url"
@@ -10318,6 +10342,7 @@
1031810342
"output_schema",
1031910343
"default_inputs",
1032010344
"uid",
10345+
"created_at",
1032110346
"code_url"
1032210347
],
1032310348
"title": "RegisteredPythonCodeFunction"
@@ -10371,14 +10396,20 @@
1037110396
"type": "string",
1037210397
"format": "uuid",
1037310398
"title": "Uid"
10399+
},
10400+
"created_at": {
10401+
"type": "string",
10402+
"format": "date-time",
10403+
"title": "Created At"
1037410404
}
1037510405
},
1037610406
"type": "object",
1037710407
"required": [
1037810408
"function_uid",
1037910409
"inputs",
1038010410
"outputs",
10381-
"uid"
10411+
"uid",
10412+
"created_at"
1038210413
],
1038310414
"title": "RegisteredPythonCodeFunctionJob"
1038410415
},
@@ -10444,6 +10475,11 @@
1044410475
"format": "uuid",
1044510476
"title": "Uid"
1044610477
},
10478+
"created_at": {
10479+
"type": "string",
10480+
"format": "date-time",
10481+
"title": "Created At"
10482+
},
1044710483
"solver_key": {
1044810484
"type": "string",
1044910485
"pattern": "^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$",
@@ -10461,6 +10497,7 @@
1046110497
"output_schema",
1046210498
"default_inputs",
1046310499
"uid",
10500+
"created_at",
1046410501
"solver_key",
1046510502
"solver_version"
1046610503
],
@@ -10516,6 +10553,11 @@
1051610553
"format": "uuid",
1051710554
"title": "Uid"
1051810555
},
10556+
"created_at": {
10557+
"type": "string",
10558+
"format": "date-time",
10559+
"title": "Created At"
10560+
},
1051910561
"solver_job_id": {
1052010562
"type": "string",
1052110563
"format": "uuid",
@@ -10528,6 +10570,7 @@
1052810570
"inputs",
1052910571
"outputs",
1053010572
"uid",
10573+
"created_at",
1053110574
"solver_job_id"
1053210575
],
1053310576
"title": "RegisteredSolverFunctionJob"

services/api-server/setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.8.0
2+
current_version = 0.9.0
33
commit = True
44
message = services/api-server version: {current_version} → {new_version}
55
tag = False
@@ -11,12 +11,12 @@ commit_args = --no-verify
1111
asyncio_mode = auto
1212
asyncio_default_fixture_loop_scope = function
1313
addopts = --strict-markers
14-
markers =
14+
markers =
1515
slow: marks tests as slow (deselect with '-m "not slow"')
1616
acceptance_test: "marks tests as 'acceptance tests' i.e. does the system do what the user expects? Typically those are workflows."
1717
testit: "marks test to run during development"
1818

1919
[mypy]
20-
plugins =
20+
plugins =
2121
pydantic.mypy
2222
sqlalchemy.ext.mypy.plugin

services/api-server/src/simcore_service_api_server/api/routes/function_job_collections_routes.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
)
2525
from ..dependencies.services import get_api_client
2626
from ..dependencies.webserver_rpc import get_wb_api_rpc_client
27-
from ._constants import FMSG_CHANGELOG_NEW_IN_VERSION, create_route_description
27+
from ._constants import (
28+
FMSG_CHANGELOG_ADDED_IN_VERSION,
29+
FMSG_CHANGELOG_NEW_IN_VERSION,
30+
create_route_description,
31+
)
2832
from .function_jobs_routes import function_job_status, get_function_job
2933

3034
# pylint: disable=too-many-arguments
@@ -41,6 +45,30 @@
4145
},
4246
}
4347

48+
ENDPOINTS = [
49+
"list_function_job_collections",
50+
"register_function_job_collection",
51+
"get_function_job_collection",
52+
"delete_function_job_collection",
53+
]
54+
CHANGE_LOGS = {}
55+
for endpoint in ENDPOINTS:
56+
CHANGE_LOGS[endpoint] = [
57+
FMSG_CHANGELOG_NEW_IN_VERSION.format("0.8.0"),
58+
]
59+
if endpoint in [
60+
"list_function_job_collections",
61+
"register_function_job_collection",
62+
"get_function_job_collection",
63+
"function_job_collection_list_function_jobs",
64+
]:
65+
CHANGE_LOGS[endpoint].append(
66+
FMSG_CHANGELOG_ADDED_IN_VERSION.format(
67+
"0.9.0",
68+
"add `created_at` field in the registered function-related objects",
69+
)
70+
)
71+
4472

4573
@function_job_collections_router.get(
4674
"",

0 commit comments

Comments
 (0)