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

config format for programs is very fragile #23

Open
mjpieters opened this issue Sep 29, 2020 · 0 comments
Open

config format for programs is very fragile #23

mjpieters opened this issue Sep 29, 2020 · 0 comments

Comments

@mjpieters
Copy link
Member

mjpieters commented Sep 29, 2020

The current format requires that we specify each program on a single line with additional supervisord options in between (...) parenthesis in the 'right' location. The recipe parses these lines using a regex.

There are, however, several supervisord options for program sections that accept %(...)s variable substitutions, and those substitutions have ( and ) characters in them. The regex is not sophisticated enough to handle these, so any use of variables in supervisord options breaks the format.

Rather than cram everything into a single line, the format should really accept buildout section names; e.g.

[supervisor]
recipe = collective.recipe.supervisor
# ....
programs = program-foo program-bar

[shared-config]
stdout_logfile=%(here)s/log/%(program)s/stdout.log
stderr_logfile=%(here)s/log/%(program)s/stderr.log

[program-foo]
<=shared-config
priority=10
name=foo

[program-bar]
<=shared-config
priority=20
name=bar

The parser would split the programs section by whitespace to then load each program configuration from buildout[sectionname] (validating that certain required keys are present).

This would make it much more flexible and powerful, the above example uses a shared section that is pulled into each program section to avoid repetition.

A short-term solution would be to at least fix the regex pattern to allow for %(\w+)s values inside the (... opts ...) section.

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