ecs_composex icon indicating copy to clipboard operation
ecs_composex copied to clipboard

[DESIGN] Allow for external modules to have a mapping of resources and modules to load

Open JohnPreston opened this issue 3 years ago • 1 comments

As a developer for an external ecs compose-x module, I might have multiple x-<resource> and models to load from the same repository. Currently I'd have to create one ecs-compose-x extension module per resource and define dependencies with each other.

It'd be much better potentially to have in the init.py an attribute that would indicate

  • x-resource
  • relative path to module

for example

with a repository / package called ecs_composex_msk_cluster, which by default would manage x-msk_cluster, we could have in __init__.py something as follows

MODULES_MAPPINGS = {
  "x-msk_cluster": {"relpath": "./msk_cluster", "abspath": path.abspath("./msk_cluster")},
  "x-msk_configuration": {"rel_path": "./msk_config", "abspath": path.abspath("./msk_config")}
}

by extension, we could further expand the logic and add

  • path to schema
  • path to permissions file

and implement that in the core modules of compose-x.

JohnPreston avatar May 11 '22 00:05 JohnPreston

In progress - modules will maintain the inventory of resources, new or lookup. Settings maintains the list of modules. So the settings.compose_content does not need to have the resources updated anymore.

JohnPreston avatar Jul 04 '22 19:07 JohnPreston

Releasing with 0.23

JohnPreston avatar Jan 11 '23 08:01 JohnPreston

Released with v0.23.0 #650

JohnPreston avatar Jan 15 '23 21:01 JohnPreston