diff --git a/README.md b/README.md index 7705ab59..6ae69211 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Collection of some open-source services for the osparc simcore platform: [Continuous integration](ci/README.md) - + ## Available services [27] | name | description | type | latest version | build status | | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | @@ -22,9 +22,9 @@ Collection of some open-source services for the osparc simcore platform: | [1D cardiac model viewer](services/dy-dash/cc-rabbit-1d/src/Dockerfile) | Graph viewer for data generated by Rabbit SS and Human GB 1D cardiac models | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/cc-1d-viewer:3.0.4.svg)](https://microbadger.com/images/itisfoundation/cc-1d-viewer:3.0.4 'See Image Version') | ![1D cardiac model viewer](https://github.com/ITISFoundation/osparc-services/workflows/cc-1d-viewer/badge.svg?branch=master) | | [2D cardiac model viewer](services/dy-dash/cc-rabbit-2d/src/Dockerfile) | Graph viewer for data generated by Rabbit SS and Human GB 2D cardiac models | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/cc-2d-viewer:3.0.5.svg)](https://microbadger.com/images/itisfoundation/cc-2d-viewer:3.0.5 'See Image Version') | ![2D cardiac model viewer](https://github.com/ITISFoundation/osparc-services/workflows/cc-2d-viewer/badge.svg?branch=master) | | [CSV Table viewer](services/dy-csv-table/Dockerfile) | CSV Table viewer powered by [csv-to-html-table](https://github.com/derekeder/csv-to-html-table) | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/csv-table:1.0.0.svg)](https://microbadger.com/images/itisfoundation/csv-table:1.0.0 'See Image Version') | ![CSV Table viewer](https://github.com/ITISFoundation/osparc-services/workflows/dy-csv-table/badge.svg?branch=master) | -| [dy-static-file-server](services/dy-static-file-server/docker/custom/Dockerfile) | Legacy test dynamic service (starts using original director-v0). The /workdir/generated-data directory is populated if no content is present. | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/dy-static-file-server:2.0.5.svg)](https://microbadger.com/images/itisfoundation/dy-static-file-server:2.0.5 'See Image Version') | ![dy-static-file-server](https://github.com/ITISFoundation/osparc-services/workflows/dy-static-file-server/badge.svg?branch=master) | -| [dy-static-file-server-dynamic-sidecar](services/dy-static-file-server/docker/custom/Dockerfile) | Modern test dynamic service (with dynamic sidecar). Changes to the inputs will be forwarded to the outputs. The /workdir/generated-data directory is populated if no content is present. | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/dy-static-file-server-dynamic-sidecar:2.0.5.svg)](https://microbadger.com/images/itisfoundation/dy-static-file-server-dynamic-sidecar:2.0.5 'See Image Version') | | -| [dy-static-file-server-dynamic-sidecar-compose-spec](services/dy-static-file-server/docker/custom/Dockerfile) | Modern test dynamic service providing a docker-compose specification file (with dynamic sidecar and compose-spec). Changes to the inputs will be forwarded to the outputs. The /workdir/generated-data directory is populated if no content is present. | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/dy-static-file-server-dynamic-sidecar-compose-spec:2.0.5.svg)](https://microbadger.com/images/itisfoundation/dy-static-file-server-dynamic-sidecar-compose-spec:2.0.5 'See Image Version') | | +| [dy-static-file-server](services/dy-static-file-server/docker/custom/Dockerfile) | Legacy test dynamic service (starts using original director-v0). The /workdir/generated-data directory is populated if no content is present. | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/dy-static-file-server:2.0.6.svg)](https://microbadger.com/images/itisfoundation/dy-static-file-server:2.0.6 'See Image Version') | ![dy-static-file-server](https://github.com/ITISFoundation/osparc-services/workflows/dy-static-file-server/badge.svg?branch=master) | +| [dy-static-file-server-dynamic-sidecar](services/dy-static-file-server/docker/custom/Dockerfile) | Modern test dynamic service (with dynamic sidecar). Changes to the inputs will be forwarded to the outputs. The /workdir/generated-data directory is populated if no content is present. | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/dy-static-file-server-dynamic-sidecar:2.0.6.svg)](https://microbadger.com/images/itisfoundation/dy-static-file-server-dynamic-sidecar:2.0.6 'See Image Version') | | +| [dy-static-file-server-dynamic-sidecar-compose-spec](services/dy-static-file-server/docker/custom/Dockerfile) | Modern test dynamic service providing a docker-compose specification file (with dynamic sidecar and compose-spec). Changes to the inputs will be forwarded to the outputs. The /workdir/generated-data directory is populated if no content is present. | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/dy-static-file-server-dynamic-sidecar-compose-spec:2.0.6.svg)](https://microbadger.com/images/itisfoundation/dy-static-file-server-dynamic-sidecar-compose-spec:2.0.6 'See Image Version') | | | [jupyter-base-notebook](services/dy-jupyter/Dockerfile) | Jupyter notebook | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/jupyter-base-notebook:2.14.0.svg)](https://microbadger.com/images/itisfoundation/jupyter-base-notebook:2.14.0 'See Image Version') | | | [jupyter-neuron](services/dy-jupyter-extensions/neuron/Dockerfile) | Jupyter notebook with preinstalled neuron modules | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/jupyter-neuron:1.1.0.svg)](https://microbadger.com/images/itisfoundation/jupyter-neuron:1.1.0 'See Image Version') | | | [jupyter-r-notebook](services/dy-jupyter/Dockerfile) | Jupyter R notebook | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/jupyter-r-notebook:2.14.0.svg)](https://microbadger.com/images/itisfoundation/jupyter-r-notebook:2.14.0 'See Image Version') | | @@ -42,7 +42,7 @@ Collection of some open-source services for the osparc simcore platform: | [sleeper-gpu](services/sleeper/docker/custom/Dockerfile) | A service which awaits for time to pass, two times. | computational | [![](https://images.microbadger.com/badges/version/itisfoundation/sleeper-gpu:2.2.1.svg)](https://microbadger.com/images/itisfoundation/sleeper-gpu:2.2.1 'See Image Version') | | | [sleeper-mpi](services/sleeper/docker/custom/Dockerfile) | A service which awaits for time to pass, two times. | computational | [![](https://images.microbadger.com/badges/version/itisfoundation/sleeper-mpi:2.2.1.svg)](https://microbadger.com/images/itisfoundation/sleeper-mpi:2.2.1 'See Image Version') | | | [Tissue properties](services/dy-tissue-properties/Dockerfile) | Tissue properties compiled in an extensive, critical literature review by the ITIS Foundation. Visit [itis.swiss/database](https://itis.swiss/database) for additional information, e.g., on tissue parameter variability/uncertainty, quality assurance, and the explored sources. Please use the following citation when referring to the database: Hasgall PA, Di Gennaro F, Baumgartner C, Neufeld E, Lloyd B, Gosselin MC, Payne D, Klingenböck A, Kuster N, ITIS Database for thermal and electromagnetic parameters of biological tissues, Version 4.0, May 15, 2018, DOI: 10.13099/VIP21000-04-0. [itis.swiss/database](https://itis.swiss/database). Powered by [csv-to-html-table](https://github.com/derekeder/csv-to-html-table) | dynamic | [![](https://images.microbadger.com/badges/version/itisfoundation/tissue-properties:1.0.1.svg)](https://microbadger.com/images/itisfoundation/tissue-properties:1.0.1 'See Image Version') | ![Tissue properties](https://github.com/ITISFoundation/osparc-services/workflows/dy-tissue-properties/badge.svg?branch=master) | -*Updated on 2024-11-15T06:11:33Z* +*Updated on 2024-11-15T09:02:13Z* diff --git a/services/dy-static-file-server/.cookiecutterrc b/services/dy-static-file-server/.cookiecutterrc index 98ce6559..d6132016 100644 --- a/services/dy-static-file-server/.cookiecutterrc +++ b/services/dy-static-file-server/.cookiecutterrc @@ -35,4 +35,4 @@ default_context: project_slug: 'dy-static-file-server' project_type: 'computational' release_date: '2021' - version: '2.0.5' + version: '2.0.6' diff --git a/services/dy-static-file-server/VERSION b/services/dy-static-file-server/VERSION index e0102586..157e54f3 100644 --- a/services/dy-static-file-server/VERSION +++ b/services/dy-static-file-server/VERSION @@ -1 +1 @@ -2.0.5 +2.0.6 diff --git a/services/dy-static-file-server/docker-compose-meta.yml b/services/dy-static-file-server/docker-compose-meta.yml index 38a59b35..4dd960d9 100644 --- a/services/dy-static-file-server/docker-compose-meta.yml +++ b/services/dy-static-file-server/docker-compose-meta.yml @@ -11,7 +11,7 @@ services: io.simcore.name: '{"name": "dy-static-file-server"}' io.simcore.outputs: '{"outputs": {}}' io.simcore.type: '{"type": "dynamic"}' - io.simcore.version: '{"version": "2.0.5"}' + io.simcore.version: '{"version": "2.0.6"}' org.label-schema.build-date: ${BUILD_DATE} org.label-schema.schema-version: '1.0' org.label-schema.vcs-ref: ${VCS_REF} @@ -29,7 +29,7 @@ services: io.simcore.name: '{"name": "dy-static-file-server-dynamic-sidecar"}' io.simcore.outputs: '{"outputs": {"string_output": {"displayOrder": 1, "label": "String output", "description": "String value from input", "type": "string"}, "integer_output": {"displayOrder": 2, "label": "Integer output", "description": "Integer value from input", "type": "integer"}, "boolean_output": {"displayOrder": 3, "label": "Boolean output", "description": "Boolean value from input", "type": "boolean"}, "number_output": {"displayOrder": 4, "label": "Number output", "description": "Number value from input", "type": "number"}, "file_output": {"displayOrder": 5, "label": "File output", "description": "File from input", "type": "data:*/*", "fileToKeyMap": {"test_file": "file_output"}}}}' io.simcore.type: '{"type": "dynamic"}' - io.simcore.version: '{"version": "2.0.5"}' + io.simcore.version: '{"version": "2.0.6"}' org.label-schema.build-date: ${BUILD_DATE} org.label-schema.schema-version: '1.0' org.label-schema.vcs-ref: ${VCS_REF} @@ -48,7 +48,7 @@ services: io.simcore.name: '{"name": "dy-static-file-server-dynamic-sidecar-compose-spec"}' io.simcore.outputs: '{"outputs": {"string_output": {"displayOrder": 1, "label": "String output", "description": "String value from input", "type": "string"}, "integer_output": {"displayOrder": 2, "label": "Integer output", "description": "Integer value from input", "type": "integer"}, "boolean_output": {"displayOrder": 3, "label": "Boolean output", "description": "Boolean value from input", "type": "boolean"}, "number_output": {"displayOrder": 4, "label": "Number output", "description": "Number value from input", "type": "number"}, "file_output": {"displayOrder": 5, "label": "File output", "description": "File from input", "type": "data:*/*", "fileToKeyMap": {"test_file": "file_output"}}}}' io.simcore.type: '{"type": "dynamic"}' - io.simcore.version: '{"version": "2.0.5"}' + io.simcore.version: '{"version": "2.0.6"}' org.label-schema.build-date: ${BUILD_DATE} org.label-schema.schema-version: '1.0' org.label-schema.vcs-ref: ${VCS_REF} diff --git a/services/dy-static-file-server/metadata/metadata-dynamic-sidecar-compose-spec.yml b/services/dy-static-file-server/metadata/metadata-dynamic-sidecar-compose-spec.yml index db1acdcf..5de91d09 100644 --- a/services/dy-static-file-server/metadata/metadata-dynamic-sidecar-compose-spec.yml +++ b/services/dy-static-file-server/metadata/metadata-dynamic-sidecar-compose-spec.yml @@ -2,7 +2,7 @@ name: dy-static-file-server-dynamic-sidecar-compose-spec key: simcore/services/dynamic/dy-static-file-server-dynamic-sidecar-compose-spec type: dynamic integration-version: 1.0.0 -version: 2.0.5 +version: 2.0.6 description: Modern test dynamic service providing a docker-compose specification file (with dynamic sidecar and compose-spec). Changes to the inputs will be forwarded to the outputs. The /workdir/generated-data directory is populated if no content is present. contact: anderegg@itis.swiss authors: diff --git a/services/dy-static-file-server/metadata/metadata-dynamic-sidecar.yml b/services/dy-static-file-server/metadata/metadata-dynamic-sidecar.yml index 02181e53..9c90eb70 100644 --- a/services/dy-static-file-server/metadata/metadata-dynamic-sidecar.yml +++ b/services/dy-static-file-server/metadata/metadata-dynamic-sidecar.yml @@ -2,7 +2,7 @@ name: dy-static-file-server-dynamic-sidecar key: simcore/services/dynamic/dy-static-file-server-dynamic-sidecar type: dynamic integration-version: 1.0.0 -version: 2.0.5 +version: 2.0.6 description: Modern test dynamic service (with dynamic sidecar). Changes to the inputs will be forwarded to the outputs. The /workdir/generated-data directory is populated if no content is present. contact: anderegg@itis.swiss authors: diff --git a/services/dy-static-file-server/metadata/metadata.yml b/services/dy-static-file-server/metadata/metadata.yml index f67a2029..3eea7a96 100644 --- a/services/dy-static-file-server/metadata/metadata.yml +++ b/services/dy-static-file-server/metadata/metadata.yml @@ -2,7 +2,7 @@ name: dy-static-file-server key: simcore/services/dynamic/dy-static-file-server type: dynamic integration-version: 1.0.0 -version: 2.0.5 +version: 2.0.6 description: Legacy test dynamic service (starts using original director-v0). The /workdir/generated-data directory is populated if no content is present. contact: anderegg@itis.swiss authors: diff --git a/services/dy-static-file-server/src/dy_static_file_server/inputs_to_outputs.py b/services/dy-static-file-server/src/dy_static_file_server/inputs_to_outputs.py index b2e3948d..e6b59934 100644 --- a/services/dy-static-file-server/src/dy_static_file_server/inputs_to_outputs.py +++ b/services/dy-static-file-server/src/dy_static_file_server/inputs_to_outputs.py @@ -77,30 +77,34 @@ def remap_input_to_output(input_dir: Path, output_dir: Path) -> None: class PortsMonitor: def __init__( - self, input_dir: Path, output_dir: Path, *, monitor_interval: float = DEFAULT_MONITOR_WAIT_INTERVAL + self, + input_dir: Path, + output_dir: Path, + *, + monitor_interval: float = DEFAULT_MONITOR_WAIT_INTERVAL, ) -> None: self.input_dir: Path = input_dir self.output_dir: Path = output_dir - self.paths: set[Path] = {input_dir, output_dir} + self.to_observe: set[Path] = {input_dir} self.monitor_interval: float = monitor_interval self._monitor_task: asyncio.Task | None = None self._keep_running: bool = False - def _get_state(self) -> Dict[Path, Dict[Path, Tuple[str, float]]]: - """return aggravated state for all monitored paths""" - return {p: _get_directory_state(p) for p in self.paths} + def _get_observed_state(self) -> Dict[Path, Dict[Path, Tuple[str, float]]]: + """return aggravated state for all observed paths""" + return {p: _get_directory_state(p) for p in self.to_observe} async def _monitor(self) -> None: _logger.info("Started monitor") - previous_state = self._get_state() + previous_state = self._get_observed_state() while self._keep_running: await asyncio.sleep(self.monitor_interval) _logger.info("Checking") - current_state = self._get_state() + current_state = self._get_observed_state() if previous_state != current_state: _logger.info("Change detected!") diff --git a/services/dy-static-file-server/tests/unit/test_dy_static_file_server_inputs_to_outputs.py b/services/dy-static-file-server/tests/unit/test_dy_static_file_server_inputs_to_outputs.py index 81ea6e24..2318e00b 100644 --- a/services/dy-static-file-server/tests/unit/test_dy_static_file_server_inputs_to_outputs.py +++ b/services/dy-static-file-server/tests/unit/test_dy_static_file_server_inputs_to_outputs.py @@ -209,6 +209,19 @@ async def test_folder_mirror( await ports_monitor.stop() +async def _assert_on_change_completed( + caplog: pytest.LogCaptureFixture, *, expected_count: int +): + async for attempt in AsyncRetrying( + wait=wait_fixed(0.1), + stop=stop_after_delay(2), + reraise=True, + retry=retry_if_exception_type(AssertionError), + ): + with attempt: + assert caplog.text.count("on_change completed") == 1 + + @pytest.mark.asyncio async def test_folder_mirror_main( caplog: pytest.LogCaptureFixture, @@ -233,13 +246,12 @@ async def test_folder_mirror_main( create_files_in_input(input_dir) - async for attempt in AsyncRetrying( - wait=wait_fixed(0.1), - stop=stop_after_delay(10), - reraise=True, - retry=retry_if_exception_type(AssertionError), - ): - with attempt: - assert "on_change completed" in caplog.text + # wait a bit to trigger the check a few times + await asyncio.sleep(1) + await _assert_on_change_completed(caplog, expected_count=1) + + # touch file in inputs await for another event + (input_dir / "file_input" / "test_file").touch() + await _assert_on_change_completed(caplog, expected_count=2) await ports_monitor.stop() diff --git a/services/dy-static-file-server/versioning/service.cfg b/services/dy-static-file-server/versioning/service.cfg index d18f144b..bbca06a1 100644 --- a/services/dy-static-file-server/versioning/service.cfg +++ b/services/dy-static-file-server/versioning/service.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.0.5 +current_version = 2.0.6 commit = False message = service/kernel version: {current_version} → {new_version} tag = False diff --git a/toc.json b/toc.json index 040a09c1..85e8adb1 100644 --- a/toc.json +++ b/toc.json @@ -76,7 +76,7 @@ "name": "dy-static-file-server", "simcore.service.settings": "[{\"name\": \"resources\", \"type\": \"Resources\", \"value\": {\"mem_limit\":268435456, \"cpu_limit\": 10000000}}, {\"name\": \"ports\", \"type\": \"int\", \"value\": 8080}, {\"name\": \"constraints\", \"type\": \"string\", \"value\": [\"node.platform.os == linux\"]}]", "type": "dynamic", - "version": "2.0.5" + "version": "2.0.6" }, "dy-static-file-server-dynamic-sidecar": { "description": "Modern test dynamic service (with dynamic sidecar). Changes to the inputs will be forwarded to the outputs. The /workdir/generated-data directory is populated if no content is present.", @@ -86,7 +86,7 @@ "name": "dy-static-file-server-dynamic-sidecar", "simcore.service.settings": "[{\"name\": \"resources\", \"type\": \"Resources\", \"value\": {\"mem_limit\":268435456, \"cpu_limit\": 10000000}}, {\"name\": \"ports\", \"type\": \"int\", \"value\": 8080}, {\"name\": \"constraints\", \"type\": \"string\", \"value\": [\"node.platform.os == linux\"]}]", "type": "dynamic", - "version": "2.0.5" + "version": "2.0.6" }, "dy-static-file-server-dynamic-sidecar-compose-spec": { "description": "Modern test dynamic service providing a docker-compose specification file (with dynamic sidecar and compose-spec). Changes to the inputs will be forwarded to the outputs. The /workdir/generated-data directory is populated if no content is present.", @@ -96,7 +96,7 @@ "name": "dy-static-file-server-dynamic-sidecar-compose-spec", "simcore.service.settings": "[{\"name\": \"resources\", \"type\": \"Resources\", \"value\": {\"mem_limit\":268435456, \"cpu_limit\": 10000000}}, {\"name\": \"ports\", \"type\": \"int\", \"value\": 8080}, {\"name\": \"constraints\", \"type\": \"string\", \"value\": [\"node.platform.os == linux\"]}]", "type": "dynamic", - "version": "2.0.5" + "version": "2.0.6" }, "jupyter-base-notebook": { "description": "Jupyter notebook",