Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,8 @@ auto-doc: .stack-simcore-version.yml ## Auto generates diagrams for README.md
# Updating docs/img
@mv --verbose $<.png docs/img/

.PHONY: services.ignore.md
services.ignore.md: ## Auto generates service.md
.PHONY: SERVICES.md
SERVICES.md: ## Auto generates service.md
# Making $@
scripts/echo_services_markdown.py > $@

Expand Down
67 changes: 67 additions & 0 deletions SERVICES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# services
>
> Auto generated on `2025-05-26 09:50:15` using
```cmd
cd osparc-simcore
python ./scripts/echo_services_markdown.py
```
| Name|Files| |
| ----------|----------|---------- |
| **AGENT**|| |
| |[services/agent/Dockerfile](./services/agent/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/agent)](https://hub.docker.com/r/itisfoundation/agent/tags) |
| **API-SERVER**|| |
| |[services/api-server/openapi.json](./services/api-server/openapi.json)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/api-server/openapi.json) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/api-server/openapi.json) |
| |[services/api-server/Dockerfile](./services/api-server/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/api-server)](https://hub.docker.com/r/itisfoundation/api-server/tags) |
| **AUTOSCALING**|| |
| |[services/autoscaling/Dockerfile](./services/autoscaling/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/autoscaling)](https://hub.docker.com/r/itisfoundation/autoscaling/tags) |
| **CATALOG**|| |
| |[services/catalog/openapi.json](./services/catalog/openapi.json)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/catalog/openapi.json) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/catalog/openapi.json) |
| |[services/catalog/Dockerfile](./services/catalog/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/catalog)](https://hub.docker.com/r/itisfoundation/catalog/tags) |
| **CLUSTERS-KEEPER**|| |
| |[services/clusters-keeper/Dockerfile](./services/clusters-keeper/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/clusters-keeper)](https://hub.docker.com/r/itisfoundation/clusters-keeper/tags) |
| **DASK-SIDECAR**|| |
| |[services/dask-sidecar/Dockerfile](./services/dask-sidecar/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/dask-sidecar)](https://hub.docker.com/r/itisfoundation/dask-sidecar/tags) |
| **DATCORE-ADAPTER**|| |
| |[services/datcore-adapter/Dockerfile](./services/datcore-adapter/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/datcore-adapter)](https://hub.docker.com/r/itisfoundation/datcore-adapter/tags) |
| **DIRECTOR**|| |
| |[services/director/src/simcore_service_director/api/v0/openapi.yaml](./services/director/src/simcore_service_director/api/v0/openapi.yaml)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/director/src/simcore_service_director/api/v0/openapi.yaml) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/director/src/simcore_service_director/api/v0/openapi.yaml) |
| |[services/director/Dockerfile](./services/director/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/director)](https://hub.docker.com/r/itisfoundation/director/tags) |
| **DIRECTOR-V2**|| |
| |[services/director-v2/openapi.json](./services/director-v2/openapi.json)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/director-v2/openapi.json) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/director-v2/openapi.json) |
| |[services/director-v2/Dockerfile](./services/director-v2/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/director-v2)](https://hub.docker.com/r/itisfoundation/director-v2/tags) |
| **DOCKER-API-PROXY**|| |
| |[services/docker-api-proxy/Dockerfile](./services/docker-api-proxy/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/docker-api-proxy)](https://hub.docker.com/r/itisfoundation/docker-api-proxy/tags) |
| **DYNAMIC-SCHEDULER**|| |
| |[services/dynamic-scheduler/openapi.json](./services/dynamic-scheduler/openapi.json)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/dynamic-scheduler/openapi.json) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/dynamic-scheduler/openapi.json) |
| |[services/dynamic-scheduler/Dockerfile](./services/dynamic-scheduler/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/dynamic-scheduler)](https://hub.docker.com/r/itisfoundation/dynamic-scheduler/tags) |
| **DYNAMIC-SIDECAR**|| |
| |[services/dynamic-sidecar/openapi.json](./services/dynamic-sidecar/openapi.json)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/dynamic-sidecar/openapi.json) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/dynamic-sidecar/openapi.json) |
| |[services/dynamic-sidecar/Dockerfile](./services/dynamic-sidecar/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/dynamic-sidecar)](https://hub.docker.com/r/itisfoundation/dynamic-sidecar/tags) |
| **EFS-GUARDIAN**|| |
| |[services/efs-guardian/Dockerfile](./services/efs-guardian/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/efs-guardian)](https://hub.docker.com/r/itisfoundation/efs-guardian/tags) |
| **INVITATIONS**|| |
| |[services/invitations/openapi.json](./services/invitations/openapi.json)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/invitations/openapi.json) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/invitations/openapi.json) |
| |[services/invitations/Dockerfile](./services/invitations/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/invitations)](https://hub.docker.com/r/itisfoundation/invitations/tags) |
| **MIGRATION**|| |
| |[services/migration/Dockerfile](./services/migration/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/migration)](https://hub.docker.com/r/itisfoundation/migration/tags) |
| **NOTIFICATIONS**|| |
| |[services/notifications/openapi.json](./services/notifications/openapi.json)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/notifications/openapi.json) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/notifications/openapi.json) |
| |[services/notifications/Dockerfile](./services/notifications/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/notifications)](https://hub.docker.com/r/itisfoundation/notifications/tags) |
| **PAYMENTS**|| |
| |[services/payments/openapi.json](./services/payments/openapi.json)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/payments/openapi.json) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/payments/openapi.json) |
| |[services/payments/Dockerfile](./services/payments/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/payments)](https://hub.docker.com/r/itisfoundation/payments/tags) |
| **RESOURCE-USAGE-TRACKER**|| |
| |[services/resource-usage-tracker/openapi.json](./services/resource-usage-tracker/openapi.json)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/resource-usage-tracker/openapi.json) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/resource-usage-tracker/openapi.json) |
| |[services/resource-usage-tracker/Dockerfile](./services/resource-usage-tracker/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/resource-usage-tracker)](https://hub.docker.com/r/itisfoundation/resource-usage-tracker/tags) |
| **STATIC-WEBSERVER**|| |
| |[services/static-webserver/client/tools/qooxdoo-kit/builder/Dockerfile](./services/static-webserver/client/tools/qooxdoo-kit/builder/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/static-webserver)](https://hub.docker.com/r/itisfoundation/static-webserver/tags) |
| |[services/static-webserver/client/qx_packages/ITISFoundation_qx-iconfont-material_v0_1_7/Dockerfile](./services/static-webserver/client/qx_packages/ITISFoundation_qx-iconfont-material_v0_1_7/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/static-webserver)](https://hub.docker.com/r/itisfoundation/static-webserver/tags) |
| |[services/static-webserver/client/qx_packages/ITISFoundation_qx-iconfont-fontawesome5_v0_2_2/Dockerfile](./services/static-webserver/client/qx_packages/ITISFoundation_qx-iconfont-fontawesome5_v0_2_2/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/static-webserver)](https://hub.docker.com/r/itisfoundation/static-webserver/tags) |
| |[services/static-webserver/client/qx_packages/ITISFoundation_qx-osparc-theme_v0_5_6/Dockerfile](./services/static-webserver/client/qx_packages/ITISFoundation_qx-osparc-theme_v0_5_6/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/static-webserver)](https://hub.docker.com/r/itisfoundation/static-webserver/tags) |
| **STORAGE**|| |
| |[services/storage/openapi.json](./services/storage/openapi.json)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/storage/openapi.json) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/storage/openapi.json) |
| |[services/storage/Dockerfile](./services/storage/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/storage)](https://hub.docker.com/r/itisfoundation/storage/tags) |
| **WEB**|| |
| |[services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml](./services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml)|[![ReDoc](https://img.shields.io/badge/OpenAPI-ReDoc-85ea2d?logo=openapiinitiative)](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml) [![Swagger UI](https://img.shields.io/badge/OpenAPI-Swagger_UI-85ea2d?logo=swagger)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/ITISFoundation/osparc-simcore/refs/heads/master/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml) |
| |[services/web/Dockerfile](./services/web/Dockerfile)|[![Docker Image Size](https://img.shields.io/docker/image-size/itisfoundation/webserver)](https://hub.docker.com/r/itisfoundation/webserver/tags) |
| || |
22 changes: 15 additions & 7 deletions packages/common-library/src/common_library/exclude.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
from typing import Any
from typing import Any, Final


class UnSet:
VALUE: "UnSet"
class Unset:
"""Sentinel value to indicate that a parameter is not set."""

VALUE: "Unset"

UnSet.VALUE = UnSet()

unuset: Final = Unset()
Unset.VALUE = Unset()


def is_unset(v: Any) -> bool:
return isinstance(v, UnSet)
return isinstance(v, Unset)


def is_set(v: Any) -> bool:
return not isinstance(v, UnSet)
return not isinstance(v, Unset)


def as_dict_exclude_unset(**params) -> dict[str, Any]:
return {k: v for k, v in params.items() if not isinstance(v, UnSet)}
"""Excludes parameters that are instances of UnSet."""
return {k: v for k, v in params.items() if not isinstance(v, Unset)}


def as_dict_exclude_none(**params) -> dict[str, Any]:
"""Analogous to `as_dict_exclude_unset` but with None.

Sometimes None is used as a sentinel value, use this function to exclude it.
"""
return {k: v for k, v in params.items() if v is not None}
19 changes: 17 additions & 2 deletions packages/common-library/src/common_library/pagination_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,25 @@ def total_number_of_pages(self) -> NonNegativeInt:


def iter_pagination_params(
offset: NonNegativeInt = 0,
limit: PositiveInt = 100,
*,
limit: PositiveInt,
offset: NonNegativeInt,
total_number_of_items: NonNegativeInt | None = None,
) -> Iterable[PageParams]:
"""Iterates through pages of a collection by yielding PageParams for each page.

Args:
limit: The maximum number of items to return in a single page.
offset: The number of items to skip before starting to collect the items for the current page.
total_number_of_items: The total count of items in the collection being paginated.
Must be set during the first iteration if not provided initially.

Yields:
PageParams for each page in the collection.

Raises:
RuntimeError: If total_number_of_items is not set before first iteration or if it changes between iterations.
"""

kwargs = {}
if total_number_of_items:
Expand Down
4 changes: 2 additions & 2 deletions packages/common-library/tests/test_exclude.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any

from common_library.exclude import UnSet, as_dict_exclude_none, as_dict_exclude_unset
from common_library.exclude import Unset, as_dict_exclude_none, as_dict_exclude_unset


def test_as_dict_exclude_unset():
def f(
par1: str | UnSet = UnSet.VALUE, par2: int | UnSet = UnSet.VALUE
par1: str | Unset = Unset.VALUE, par2: int | Unset = Unset.VALUE
) -> dict[str, Any]:
return as_dict_exclude_unset(par1=par1, par2=par2)

Expand Down
10 changes: 7 additions & 3 deletions packages/common-library/tests/test_pagination_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ async def test_iter_pages_args(

num_pages = 0
page_args = None
for page_index, page_args in enumerate(iter_pagination_params(offset, limit)):
for page_index, page_args in enumerate(
iter_pagination_params(offset=offset, limit=limit)
):

page_items, page_args.total_number_of_items = await get_page(
page_args.offset_current, page_args.limit
Expand Down Expand Up @@ -74,7 +76,7 @@ def test_fails_if_total_number_of_items_not_set():
RuntimeError,
match="page_args.total_number_of_items = total_count",
):
for _ in iter_pagination_params(limit=2):
for _ in iter_pagination_params(offset=0, limit=2):
pass


Expand All @@ -83,6 +85,8 @@ def test_fails_if_total_number_of_items_changes():
RuntimeError,
match="total_number_of_items cannot change on every iteration",
):
for page_params in iter_pagination_params(limit=2, total_number_of_items=4):
for page_params in iter_pagination_params(
offset=0, limit=2, total_number_of_items=4
):
assert page_params.total_number_of_items == 4
page_params.total_number_of_items += 1
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ class ServiceSummary(CatalogOutputSchema):
version: ServiceVersion
name: str
description: str

version_display: str | None = None

contact: LowerCaseEmailStr | None

@staticmethod
Expand All @@ -195,6 +193,14 @@ def _update_json_schema_extra(schema: JsonDict) -> None:
"version_display": _EXAMPLE_SLEEPER["version_display"],
"contact": _EXAMPLE_SLEEPER["contact"],
},
{
"key": _EXAMPLE_SLEEPER["key"],
"version": "100.0.0",
"name": "sleeper",
"description": "short description",
"version_display": "HUGE Release",
"contact": "[email protected]",
},
{
"key": _EXAMPLE_FILEPICKER["key"],
"version": _EXAMPLE_FILEPICKER["version"],
Expand Down
Loading
Loading