-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The settings strategy functions very slightly different due to the new way session objects are handled in a pipeline. The way it works now is when a pipeline is executed, the configuration key in a configuration is updated with all fields that exist currently in the session object. The session object only exists on the side of the OTEAPI service (or locally as a dict when using the "python" OTEClient). So, to make this work as intended, the settings strategy still has a settings field, but it will result in a dlite_settings field in the session, and thereby a dlite_settings field in other strategies that rely on these settings. This new dlite_settings fields has been added to the new DliteConfiguration model, which all strategy-specific configurations that relied on this feature are now based on (except the settings configuration, naturally). Otherwise, the strategy-specific configurations are based on DliteResult, which is a small model that just includes the collection_id field.
- Loading branch information
Showing
37 changed files
with
976 additions
and
857 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
services: | ||
oteapi: | ||
image: ghcr.io/emmc-asbl/oteapi:${DOCKER_OTEAPI_VERSION:-latest} | ||
ports: | ||
- "5000:8080" | ||
environment: | ||
OTEAPI_REDIS_TYPE: redis | ||
OTEAPI_REDIS_HOST: redis | ||
OTEAPI_REDIS_PORT: 6379 | ||
OTEAPI_PREFIX: "${OTEAPI_PREFIX:-/api/v1}" | ||
PATH_TO_OTEAPI_CORE: | ||
OTEAPI_PLUGIN_PACKAGES: "-v git+https://github.com/EMMC-ASBL/oteapi-dlite@cwa/close-303-update-to-dev-core-versions" | ||
# OTEAPI_PLUGIN_PACKAGES: "-v -e /oteapi-dlite" | ||
depends_on: | ||
- redis | ||
volumes: | ||
- "${PATH_TO_OTEAPI_CORE:-/dev/null}:/oteapi-core" | ||
# - "${PWD}:/oteapi-dlite" | ||
entrypoint: | | ||
/bin/bash -c "if [ \"${PATH_TO_OTEAPI_CORE}\" != \"/dev/null\" ] && [ -n \"${PATH_TO_OTEAPI_CORE}\" ]; then \ | ||
pip install -U --force-reinstall -e /oteapi-core; fi && ./entrypoint.sh --reload --debug --log-level debug" | ||
stop_grace_period: 1s | ||
|
||
redis: | ||
image: redis:latest | ||
volumes: | ||
- redis-oteapi:/data | ||
|
||
volumes: | ||
redis-oteapi: | ||
|
||
networks: | ||
default: | ||
name: otenet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# models | ||
|
||
::: oteapi_dlite.models |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""DLite-specific data models.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import Annotated, Optional | ||
|
||
from oteapi.models import AttrDict | ||
from pydantic import Field, JsonValue | ||
|
||
|
||
class DLiteResult(AttrDict): | ||
"""Class for returning values from DLite strategies.""" | ||
|
||
collection_id: Annotated[ | ||
Optional[str], Field(description="A reference to a DLite collection.") | ||
] = None | ||
|
||
|
||
class DLiteConfiguration(DLiteResult): | ||
"""Data model representing recurring fields necessary in strategy-specific | ||
configurations for DLite strategies. | ||
Note, this data model already includes the `collection_id` field from the | ||
`DLiteResult` data model. | ||
""" | ||
|
||
dlite_settings: Annotated[ | ||
dict[str, JsonValue], | ||
Field( | ||
description=( | ||
"Settings used by DLite strategies within a single pipeline " | ||
"run." | ||
) | ||
), | ||
] = {} # noqa: RUF012 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.