Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/models-library/src/models_library/functions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
from collections.abc import Mapping
from enum import Enum
from typing import Annotated, Any, Literal, TypeAlias
Expand Down Expand Up @@ -96,6 +97,7 @@ class FunctionBase(BaseModel):

class RegisteredFunctionBase(FunctionBase):
uid: FunctionID
created_at: datetime.datetime


class ProjectFunction(FunctionBase):
Expand Down Expand Up @@ -152,6 +154,7 @@ class FunctionJobBase(BaseModel):

class RegisteredFunctionJobBase(FunctionJobBase):
uid: FunctionJobID
created_at: datetime.datetime


class ProjectFunctionJob(FunctionJobBase):
Expand Down Expand Up @@ -207,6 +210,7 @@ class FunctionJobCollection(BaseModel):

class RegisteredFunctionJobCollection(FunctionJobCollection):
uid: FunctionJobCollectionID
created_at: datetime.datetime


class FunctionJobCollectionStatus(BaseModel):
Expand All @@ -225,6 +229,7 @@ class FunctionJobDB(BaseModel):

class RegisteredFunctionJobDB(FunctionJobDB):
uuid: FunctionJobID
created: datetime.datetime


class FunctionDB(BaseModel):
Expand All @@ -239,6 +244,7 @@ class FunctionDB(BaseModel):

class RegisteredFunctionDB(FunctionDB):
uuid: FunctionID
created: datetime.datetime


class FunctionJobCollectionDB(BaseModel):
Expand All @@ -248,6 +254,7 @@ class FunctionJobCollectionDB(BaseModel):

class RegisteredFunctionJobCollectionDB(FunctionJobCollectionDB):
uuid: FunctionJobCollectionID
created: datetime.datetime


class FunctionIDString(ConstrainedStr):
Expand Down
2 changes: 1 addition & 1 deletion services/api-server/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.0
0.9.0
70 changes: 56 additions & 14 deletions services/api-server/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "osparc.io public API",
"description": "osparc-simcore public API specifications",
"version": "0.8.0"
"version": "0.9.0"
},
"paths": {
"/v0/meta": {
Expand Down Expand Up @@ -5286,7 +5286,7 @@
"function_jobs"
],
"summary": "List Function Jobs",
"description": "List function jobs\n\nNew in *version 0.8.0*",
"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",
"operationId": "list_function_jobs",
"security": [
{
Expand Down Expand Up @@ -5346,7 +5346,7 @@
"function_jobs"
],
"summary": "Register Function Job",
"description": "Create function job\n\nNew in *version 0.8.0*",
"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",
"operationId": "register_function_job",
"security": [
{
Expand Down Expand Up @@ -5431,7 +5431,7 @@
"function_jobs"
],
"summary": "Get Function Job",
"description": "Get function job\n\nNew in *version 0.8.0*",
"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",
"operationId": "get_function_job",
"security": [
{
Expand Down Expand Up @@ -6810,7 +6810,7 @@
"functions"
],
"summary": "Register Function",
"description": "Create function\n\nNew in *version 0.8.0*",
"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",
"operationId": "register_function",
"security": [
{
Expand Down Expand Up @@ -6903,7 +6903,7 @@
"functions"
],
"summary": "List Functions",
"description": "List functions\n\nNew in *version 0.8.0*",
"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",
"operationId": "list_functions",
"security": [
{
Expand Down Expand Up @@ -6965,7 +6965,7 @@
"functions"
],
"summary": "Get Function",
"description": "Get function\n\nNew in *version 0.8.0*",
"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",
"operationId": "get_function",
"security": [
{
Expand Down Expand Up @@ -7098,7 +7098,7 @@
"functions"
],
"summary": "List Function Jobs For Functionid",
"description": "List function jobs for a function\n\nNew in *version 0.8.0*",
"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",
"operationId": "list_function_jobs_for_functionid",
"security": [
{
Expand Down Expand Up @@ -7170,7 +7170,7 @@
"functions"
],
"summary": "Update Function Title",
"description": "Update function\n\nNew in *version 0.8.0*",
"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",
"operationId": "update_function_title",
"security": [
{
Expand Down Expand Up @@ -7257,7 +7257,7 @@
"functions"
],
"summary": "Update Function Description",
"description": "Update function\n\nNew in *version 0.8.0*",
"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",
"operationId": "update_function_description",
"security": [
{
Expand Down Expand Up @@ -7568,7 +7568,7 @@
"functions"
],
"summary": "Run Function",
"description": "Run function\n\nNew in *version 0.8.0*",
"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",
"operationId": "run_function",
"security": [
{
Expand Down Expand Up @@ -7664,7 +7664,7 @@
"functions"
],
"summary": "Map Function",
"description": "Map function over input parameters\n\nNew in *version 0.8.0*",
"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",
"operationId": "map_function",
"security": [
{
Expand Down Expand Up @@ -10094,11 +10094,17 @@
"type": "string",
"format": "uuid",
"title": "Uid"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
}
},
"type": "object",
"required": [
"uid"
"uid",
"created_at"
],
"title": "RegisteredFunctionJobCollection"
},
Expand Down Expand Up @@ -10164,6 +10170,11 @@
"format": "uuid",
"title": "Uid"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"project_id": {
"type": "string",
"format": "uuid",
Expand All @@ -10176,6 +10187,7 @@
"output_schema",
"default_inputs",
"uid",
"created_at",
"project_id"
],
"title": "RegisteredProjectFunction"
Expand Down Expand Up @@ -10230,6 +10242,11 @@
"format": "uuid",
"title": "Uid"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"project_job_id": {
"type": "string",
"format": "uuid",
Expand All @@ -10242,6 +10259,7 @@
"inputs",
"outputs",
"uid",
"created_at",
"project_job_id"
],
"title": "RegisteredProjectFunctionJob"
Expand Down Expand Up @@ -10308,6 +10326,11 @@
"format": "uuid",
"title": "Uid"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"code_url": {
"type": "string",
"title": "Code Url"
Expand All @@ -10319,6 +10342,7 @@
"output_schema",
"default_inputs",
"uid",
"created_at",
"code_url"
],
"title": "RegisteredPythonCodeFunction"
Expand Down Expand Up @@ -10372,14 +10396,20 @@
"type": "string",
"format": "uuid",
"title": "Uid"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
}
},
"type": "object",
"required": [
"function_uid",
"inputs",
"outputs",
"uid"
"uid",
"created_at"
],
"title": "RegisteredPythonCodeFunctionJob"
},
Expand Down Expand Up @@ -10445,6 +10475,11 @@
"format": "uuid",
"title": "Uid"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"solver_key": {
"type": "string",
"pattern": "^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$",
Expand All @@ -10462,6 +10497,7 @@
"output_schema",
"default_inputs",
"uid",
"created_at",
"solver_key",
"solver_version"
],
Expand Down Expand Up @@ -10517,6 +10553,11 @@
"format": "uuid",
"title": "Uid"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"solver_job_id": {
"type": "string",
"format": "uuid",
Expand All @@ -10529,6 +10570,7 @@
"inputs",
"outputs",
"uid",
"created_at",
"solver_job_id"
],
"title": "RegisteredSolverFunctionJob"
Expand Down
6 changes: 3 additions & 3 deletions services/api-server/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.8.0
current_version = 0.9.0
commit = True
message = services/api-server version: {current_version} → {new_version}
tag = False
Expand All @@ -11,12 +11,12 @@ commit_args = --no-verify
asyncio_mode = auto
asyncio_default_fixture_loop_scope = function
addopts = --strict-markers
markers =
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
acceptance_test: "marks tests as 'acceptance tests' i.e. does the system do what the user expects? Typically those are workflows."
testit: "marks test to run during development"

[mypy]
plugins =
plugins =
pydantic.mypy
sqlalchemy.ext.mypy.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
)
from ..dependencies.services import get_api_client
from ..dependencies.webserver_rpc import get_wb_api_rpc_client
from ._constants import FMSG_CHANGELOG_NEW_IN_VERSION, create_route_description
from ._constants import (
FMSG_CHANGELOG_ADDED_IN_VERSION,
FMSG_CHANGELOG_NEW_IN_VERSION,
create_route_description,
)
from .function_jobs_routes import function_job_status, get_function_job

# pylint: disable=too-many-arguments
Expand All @@ -41,6 +45,30 @@
},
}

ENDPOINTS = [
"list_function_job_collections",
"register_function_job_collection",
"get_function_job_collection",
"delete_function_job_collection",
]
CHANGE_LOGS = {}
for endpoint in ENDPOINTS:
CHANGE_LOGS[endpoint] = [
FMSG_CHANGELOG_NEW_IN_VERSION.format("0.8.0"),
]
if endpoint in [
"list_function_job_collections",
"register_function_job_collection",
"get_function_job_collection",
"function_job_collection_list_function_jobs",
]:
CHANGE_LOGS[endpoint].append(
FMSG_CHANGELOG_ADDED_IN_VERSION.format(
"0.9.0",
"add `created_at` field in the registered function-related objects",
)
)


@function_job_collections_router.get(
"",
Expand Down
Loading
Loading