From a1614e8348a88edef666a36e28688216dc1b42d7 Mon Sep 17 00:00:00 2001 From: Dustin Kaiser <8209087+mrnicegyu11@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:32:21 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Minor:=20ooil=20prints=20warning?= =?UTF-8?q?=20when=20one=20subfolder=20(of=20potentially=20many)=20doesn't?= =?UTF-8?q?=20contain=20`metadata.yml`=20(#7128)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/service-integration/README.md | 8 ++++++++ .../src/service_integration/cli/_compose_spec.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/service-integration/README.md b/packages/service-integration/README.md index b04e6b97d8d..b92b68b31c1 100644 --- a/packages/service-integration/README.md +++ b/packages/service-integration/README.md @@ -5,3 +5,11 @@ This is the o2sparc's service integration library or ``ooil`` in short SEE how is it used in Makefiles in https://github.com/ITISFoundation/cookiecutter-osparc-service + + +#### What is the .osparc folder and its content? +'osparc config' is a set of stardard file forms (yaml) that the user fills provides in order to describe how her service works and integrates with osparc. It may contain: + - config files are stored under '.osparc/' folder in the root repo folder (analogous to other configs like .github, .vscode, etc) + - configs are parsed and validated into pydantic models + - models can be serialized/deserialized into label annotations on images. This way, the config is attached to the service during it's entire lifetime. + - config should provide enough information about that context to allow building an image and running a container on a single command call. diff --git a/packages/service-integration/src/service_integration/cli/_compose_spec.py b/packages/service-integration/src/service_integration/cli/_compose_spec.py index 806b9013fa4..448375d25cd 100644 --- a/packages/service-integration/src/service_integration/cli/_compose_spec.py +++ b/packages/service-integration/src/service_integration/cli/_compose_spec.py @@ -192,6 +192,14 @@ def create_compose( if file_path.exists(): configs_kwargs_map[config_name][arg_name] = file_path + # warn about subfolders without metadata.yml + for subdir in filter(lambda p: p.is_dir(), basedir.rglob("*")): + if not (subdir / "metadata.yml").exists(): + relative_subdir = subdir.relative_to(basedir) + rich.print( + f"[warning] Subfolder '{relative_subdir}' does not contain a 'metadata.yml' file. Skipping." + ) + if not configs_kwargs_map: rich.print(f"[warning] No config files were found in '{config_path}'")