Skip to content
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
02a1a8c
catalog exposes service labels
Jan 8, 2025
77a2143
reroute getting labels
Jan 8, 2025
0119221
Merge remote-tracking branch 'upstream/master' into pr-osparc-move-se…
Jan 8, 2025
60346ff
updated specs
Jan 8, 2025
29f2298
pylint
Jan 8, 2025
e94c139
fixed issue
Jan 8, 2025
7b2512e
fixed warning
Jan 8, 2025
a612804
Merge remote-tracking branch 'upstream/master' into pr-osparc-move-se…
Jan 8, 2025
da1ef55
fixed failing tests
Jan 8, 2025
d3701d2
Merge remote-tracking branch 'upstream/master' into pr-osparc-move-se…
Jan 8, 2025
8233029
pylint
Jan 8, 2025
731baa0
remove envelope
Jan 8, 2025
0b94380
update specs
Jan 8, 2025
86aa7d7
fixed unused
Jan 8, 2025
3dc7bc6
fixed test
Jan 8, 2025
bdd4560
refactor
Jan 8, 2025
1922224
refactor
Jan 8, 2025
40963ef
rename
Jan 10, 2025
5b4fb17
Merge remote-tracking branch 'upstream/master' into pr-osparc-move-se…
Jan 10, 2025
751efdf
services/catalog version: 0.6.0 → 0.7.0
Jan 10, 2025
d798336
update specs
Jan 10, 2025
6fc086b
refactor
Jan 10, 2025
0fbfe6d
Merge remote-tracking branch 'upstream/master' into pr-osparc-move-se…
Jan 10, 2025
b3a961f
redirecting extras via catalog
Jan 10, 2025
1bf1d05
update openapi specs
Jan 10, 2025
c8256d6
refactor
Jan 10, 2025
54f5c6e
fixed mocks
Jan 13, 2025
f2f9eea
moved service_extras to catalog service
Jan 13, 2025
55c4d14
Merge remote-tracking branch 'upstream/master' into pr-osparc-move-se…
Jan 13, 2025
9ad480f
removed unused
Jan 13, 2025
890ce93
remove unrequired tests
Jan 13, 2025
fa6f6f4
refactor
Jan 13, 2025
2eba747
removed
Jan 13, 2025
7c2f690
dropped enveloped response
Jan 13, 2025
47e0095
fixed parsing
Jan 14, 2025
324d7c6
Merge remote-tracking branch 'upstream/master' into pr-osparc-move-se…
Jan 15, 2025
5fe7472
refactor using model
Jan 16, 2025
9eaf14c
unified models
Jan 16, 2025
4b25ca5
Merge remote-tracking branch 'upstream/master' into pr-osparc-move-se…
Jan 16, 2025
c8cc103
updated specs
Jan 16, 2025
d3a27d1
fixed issue
Jan 16, 2025
3ad04ce
mypy
Jan 16, 2025
da32d4e
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
GitHK Jan 17, 2025
cbd09d3
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
GitHK Jan 17, 2025
5a492e8
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
GitHK Jan 21, 2025
a9455c3
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
GitHK Jan 21, 2025
9f3bcd7
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
GitHK Jan 21, 2025
29fb222
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
GitHK Jan 21, 2025
4e0f2f8
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
GitHK Jan 21, 2025
83d7b5f
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
GitHK Jan 22, 2025
a5383fd
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
GitHK Jan 22, 2025
d5171ae
Merge remote-tracking branch 'upstream/master' into pr-osparc-move-se…
Jan 22, 2025
826b2ad
no longer requires permission change
Jan 22, 2025
527de76
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
GitHK Jan 22, 2025
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
54 changes: 54 additions & 0 deletions services/catalog/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,60 @@
}
}
},
"/v0/services/{service_key}/{service_version}/extras": {
"get": {
"tags": [
"services"
],
"summary": "Get Service Extras",
"operationId": "get_service_extras_v0_services__service_key___service_version__extras_get",
"parameters": [
{
"name": "service_key",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$",
"title": "Service Key"
}
},
{
"name": "service_version",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$",
"title": "Service Version"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"title": "Response Get Service Extras V0 Services Service Key Service Version Extras Get"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/v0/services/{service_key}/{service_version}/specifications": {
"get": {
"tags": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from typing import Annotated, Any

from fastapi import APIRouter, Depends
from models_library.services import ServiceKey, ServiceVersion

from ...services.director import DirectorApi
from ..dependencies.director import get_director_api

router = APIRouter()


@router.get("/{service_key:path}/{service_version}/extras")
async def get_service_extras(
service_key: ServiceKey,
service_version: ServiceVersion,
director_client: Annotated[DirectorApi, Depends(get_director_api)],
) -> dict[str, Any]:
return await director_client.get_service_extras(service_key, service_version)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
_meta,
_services,
_services_access_rights,
_services_extras,
_services_labels,
_services_ports,
_services_resources,
Expand Down Expand Up @@ -44,6 +45,11 @@
tags=_SERVICE_TAGS,
prefix=_SERVICE_PREFIX,
)
v0_router.include_router(
_services_extras.router,
tags=_SERVICE_TAGS,
prefix=_SERVICE_PREFIX,
)
v0_router.include_router(
_services_specifications.router,
tags=_SERVICE_TAGS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def create_app(settings: ApplicationSettings | None = None) -> FastAPI:
setup_tracing(app, settings.CATALOG_TRACING, APP_NAME)

# STARTUP-EVENT
app.add_event_handler(
"startup", create_on_startup(app, tracing_settings=settings.CATALOG_TRACING)
)
app.add_event_handler("startup", create_on_startup(app))

# PLUGIN SETUP
setup_function_services(app)
Expand Down
7 changes: 2 additions & 5 deletions services/catalog/src/simcore_service_catalog/core/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from fastapi import FastAPI
from servicelib.fastapi.db_asyncpg_engine import close_db_connection, connect_to_db
from servicelib.logging_utils import log_context
from settings_library.tracing import TracingSettings

from .._meta import APP_FINISHED_BANNER_MSG, APP_STARTED_BANNER_MSG
from ..db.events import setup_default_product
Expand All @@ -27,9 +26,7 @@ def _flush_finished_banner() -> None:
print(APP_FINISHED_BANNER_MSG, flush=True) # noqa: T201


def create_on_startup(
app: FastAPI, tracing_settings: TracingSettings | None
) -> EventCallable:
def create_on_startup(app: FastAPI) -> EventCallable:
async def _() -> None:
_flush_started_banner()

Expand All @@ -40,7 +37,7 @@ async def _() -> None:

if app.state.settings.CATALOG_DIRECTOR:
# setup connection to director
await setup_director(app, tracing_settings=tracing_settings)
await setup_director(app)

# FIXME: check director service is in place and ready. Hand-shake??
# SEE https://github.com/ITISFoundation/osparc-simcore/issues/1728
Expand Down
12 changes: 11 additions & 1 deletion services/catalog/src/simcore_service_catalog/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
)
from models_library.basic_types import LogLevel
from models_library.services_resources import ResourcesDict, ResourceValue
from pydantic import AliasChoices, ByteSize, Field, PositiveInt, TypeAdapter
from pydantic import (
AliasChoices,
ByteSize,
Field,
NonNegativeInt,
PositiveInt,
TypeAdapter,
)
from servicelib.logging_utils_filtering import LoggerName, MessageSubstring
from settings_library.application import BaseApplicationSettings
from settings_library.base import BaseCustomSettings
Expand Down Expand Up @@ -103,3 +110,6 @@ class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
json_schema_extra={"auto_default_from_env": True},
description="settings for opentelemetry tracing",
)

DIRECTOR_DEFAULT_MAX_MEMORY: NonNegativeInt = Field(default=0)
DIRECTOR_DEFAULT_MAX_NANO_CPUS: NonNegativeInt = Field(default=0)
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import operator
from collections.abc import Callable
from datetime import UTC, datetime
from typing import Any, cast
from urllib.parse import quote_plus
from typing import cast

import arrow
from fastapi import FastAPI
Expand Down Expand Up @@ -36,12 +35,8 @@ async def _is_old_service(app: FastAPI, service: ServiceMetaDataPublished) -> bo
# NOTE: https://github.com/ITISFoundation/osparc-simcore/pull/6003#discussion_r1658200909
# get service build date
client = get_director_api(app)
data = cast(
dict[str, Any],
await client.get(
f"/service_extras/{quote_plus(service.key)}/{service.version}"
),
)

data = await client.get_service_extras(service.key, service.version)
if not data or "build_date" not in data:
return True
service_build_data = arrow.get(data["build_date"]).datetime
Expand Down
Loading
Loading