-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add prefect server config
command to output a compose file
#4176
Conversation
Instead of starting the server, provide the configured files for a user - Removes the fname write from `make_env`, looks unsused
Aside from that, this all looks great. |
Yeah I could be convinced to do a sub-command instead. I just didn't want to replicate all the code in |
I think a separate command makes sense. I'd like to transition |
How about I recall some npm tool - I believe it was |
|
That could work if this didn't need writing content to two files to work, the generated docker-compose.yml file won't work without a dozen mandatory env variables plucked from Prefect's config.toml, which need to be saved to a separate file for docker-compose to load alongside it. Though I guess one could always tell people to do something like |
Oh, I hadn't realized that. Why not write the values directly in the generated compose file? I was viewing this as effectively "freezing" the config for later use. A single generated file feels simpler to work with to me than having to move around two files with the proper paths. |
I think it makes sense to inject the variables into the file as well. I'm honestly quite confused at the way the docker-compose is written right now where there are I've started on refactoring this a bit further to separate it into another command and it's kind of just a mess. I can just rehaul it. |
Yeah, I think that might just be historical and could all be removed/redone. Feel free to change the compose setup however you want to make things simpler. |
Refactors common options and simplifies env creation
It turns out there's a docker-compose command for this! This means that I do not have to touch the |
prefect server config
command to output a compose file
Still needs a test for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, otherwise this looks good to me.
Can you also add the config
command to the CLI docs here:
Line 74 in 6412878
commands = ["start", "create_tenant"] |
prefect server stop
needs to be added as well.
I think doing a test with no flags (things run fine by default) and one with lots of flags/env-vars (test args get forwarded properly) would be sufficient. By inspection the same helpers are used, so if the actual env/flag handling logic is tested elsewhere already we only need to ensure things are hooked together properly. |
Docs look good: https://deploy-preview-4176--prefect-docs.netlify.app/api/latest/cli/server.html#config Messed up a test... should be an easy fix. |
Summary
Instead of starting the server, provide the configured file for a user to spin it up themselves.
prefect server config
writes a configure docker-compose yaml to standard output usingdocker-compose config
to resolve environment variables. It takes all the same (non pull/start) options asprefect server start
Changes
config
toprefect server
CLIImportance
Closes #4151
Checklist
This PR:
changes/
directory (if appropriate)docs/outline.toml
for API reference docs (if appropriate)