Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give more flexibility to launch the asphalt application #448

Open
KenKi0 opened this issue Oct 26, 2024 · 0 comments
Open

Give more flexibility to launch the asphalt application #448

KenKi0 opened this issue Oct 26, 2024 · 0 comments

Comments

@KenKi0
Copy link

KenKi0 commented Oct 26, 2024

I encountered a problem that with my plugins, asphalt start timeouts, but I didn’t find functionality to control this parameter for starting the asphalt application.

I propose to give the ability to specify the path to config.yaml, and if it is specified, then load it. I also propose to rework the get_config function to compile config using the pyyaml ​​tool, instead of doing it manually.

How i see it in code:

def get_config(disable: Tuple[str, ...], config_path: Path | None = None) -> str:
    jupyverse_components = [
        ep.name
        for ep in entry_points(group="jupyverse.components")
        if ep.name not in disable
    ]
    if config_path:
        config = yaml.safe_load(config_path)
    else:
        config = {}
    component = {
        "type": "jupyverse",
        "components": {
            component: {"type": component}
            for component in jupyverse_components
        },
    },
    logging_conf = {'disable_existing_loggers': False,
         'formatters': {'default': {'format': '[%(asctime)s %(levelname)s] '
                                              '%(message)s'}},
         'handlers': {'console': {'class': 'logging.StreamHandler',
                                  'formatter': 'default'}},
         'loggers': {'webnotifier': {'level': 'DEBUG'}},
         'root': {'handlers': ['console'], 'level': 'INFO'},
         'version': 1}
    config["component"] = component
    if not config.get("logging"):
        config["logging"] = logging_conf
    

    config_str = yaml.dump(config)
    return config_str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant