-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
New feature to allow the program environment to be loaded from an ext… #1431
base: main
Are you sure you want to change the base?
Conversation
…ernal file or program. - This allows supervisord to be used in conjunction with any secrets pattern using a root-only file or a program that can provide environment variables that a program should have. It can be set globally in the supervisord section, or per program in a program section. The new options are environment_file or environment_loader. They are optional, and errors in one of them will prevent startup. They can be set in the [supervisord] section and then will be passed down to the programs, or in the program definitions. The file/loader is checked right before the calls to spawn() in order to avoid problems with calling a subprocess after the child fork, and to allow restarts to reload those environment values. - Updated the docs for these new options - Updated the tests to add a new test to check these new options.
22c7919
to
f204ba1
Compare
…with python 3.{4,5,6}
f204ba1
to
8f1675a
Compare
- Remove the blocking call to subprocess.check_output in the main supervisord process. Instead make that call in the child process immediately after the initial fork, before doing any changes to the process config and state. This keeps the blocking call out of the danger zone, while still keeping the simple design.
63bed00
to
a95213f
Compare
This has been sitting around for a while - I believe I've implemented all the changes you required. Is there anything else you'd like to see with this? |
Hi, there has not been a lot of activity in this repository lately at all. The comments above were things that jumped out at me after a very brief look at the code. This PR is still pending review and consideration, and there are others ahead of it. I have a few others that I need to look at first, but there are other committers in this repository who could also look. |
Removing myself so others may review as well
I'm still eager to see this merged and released in a 4.2.3 supervisord release. If this project is dying, I understand - no one has much time for projects like this. If there are other changes that need to be made, I'm happy to do them. I'll keep running my fork for now. |
…patibility - Handle env files formatted like dotenv files where values can be quoted. We'll unquote those, preserving embedded whitespace, and also expand newline literals into actual newlines for double quoted strings. This allows supervisors to reuse the dotenv files created nodejs projects.
- Handle env files with empty and malformed lines. Just skip those and ignore them.
…ernal file or program.
pattern using a root-only file or a program that can provide environment
variables that a program should have. It can be set globally in the
supervisord section, or per program in a program section. The new
options are environment_file or environment_loader. They are optional,
and errors in one of them will prevent startup. They can be set in the
[supervisord] section and then will be passed down to the programs, or
in the program definitions. The file/loader is checked right before the
calls to spawn() in order to avoid problems with calling a subprocess
after the child fork, and to allow restarts to reload those environment
values.
From researching the history of things similar to this feature, I'm pretty sure the supervisor team will reject this and doesn't want it. But, it's a critical feature I need to move forward with supervisor. I've been a happy user for years now, but in needing to modernize some old stacks I need functionality like this. Lots of others agree, so hopefully this will be useful to them as well. I'll be running this fork for the foreseeable future and others are welcome to grab it and use it. Supervisor is pretty much feature complete for me so I'll only update it as necessary. The changes are pretty simple and easy to maintain, so hopefully this will be accepted. I did figure out how to add tests and run them with tox and they are all passing on both python 2.7 and 3.8.