Skip to content

Use model with libraries #175

@redeexpressos

Description

@redeexpressos

Hello.

The current implementation does not support models with libraries. When launching the docker container, I get the following errors:

at=INFO logger=capella_model_explorer.app msg="Loading model from: /model"
at=ERROR logger=uvicorn.error msg="Traceback (most recent call last):\n  File \"/app/lib/python3.12/site-packages/starlette/routing.py\", line 694, in lifespan\n    async with self.lifespan_context(app) as maybe_state:\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/contextlib.py\", line 210, in __aenter__\n    return await anext(self.gen)\n           ^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/lib/python3.12/site-packages/capella_model_explorer/app.py\", line 40, in lifespan\n    state.model = capellambse.MelodyModel(**model_spec)\n                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/lib/python3.12/site-packages/capellambse/model/_model.py\", line 289, in __init__\n    self._loader = loader.MelodyLoader(path, **kwargs)\n                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/lib/python3.12/site-packages/capellambse/loader/core.py\", line 561, in __init__\n    self.__load_referenced_files(\n  File \"/app/lib/python3.12/site-packages/capellambse/loader/core.py\", line 621, in __load_referenced_files\n    self.__load_referenced_files(ref_name)\n  File \"/app/lib/python3.12/site-packages/capellambse/loader/core.py\", line 611, in __load_referenced_files\n    handler = self.resources[resource_path.parts[0]]\n              ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/lib/python3.12/site-packages/capellambse/loader/core.py\", line 186, in __missing__\n    raise MissingResourceLocationError(key)\ncapellambse.loader.core.MissingResourceLocationError: 'My Library'\n"
at=ERROR logger=uvicorn.error msg="Application startup failed. Exiting."
^Cat=INFO logger=uvicorn.error msg="Stopping reloader process [1]"

When working with py-capellambse, I fix this by loading a "resources" path when creating the MelodyModel. However, in capella-model-explorer, the settings don't support it.

Is there a solution for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions