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
Update prefect server start
command to specify and disable port mappings
#2228
Conversation
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.
I think this makes sense
prefect server start
command to specify and disable port mappings
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.
👍 only thing I wonder is whether anything wonky could happen when serving a docker setup from a temporary docker compose script location (e.g., if someone leaves the server running for a long time and the temporary docker compose file gets cleaned up by the system, does that matter?)
@cicdw I just tested it by spinning it up using the no-port options which creates a tempdir to house the docker compose file. Then while it was running I manually went to the tempdir and deleted the file. Everything continued to run and when I shut it down it all shut down properly 👍 |
Thanks for contributing to Prefect!
Please describe your work and make sure your PR:
CHANGELOG.md
(if appropriate)docs/outline.toml
for API reference docs (if appropriate)Note that your PR will not be reviewed unless all three boxes are checked.
What does this PR change?
Open PR up for discussion if this is how we want optional port allocations to work when running
prefect server start
. This allows ports from the server services to be binded to different ports on the host machine. For this to work I had to add__HOST_PORT
options to some of the services inconfig.toml
. I'm guessing this is due to some hardcoded ports that these services use inside their containers. (e.g. overwritingconfig.server.hasura.port
broke communication inside the containers when they ran)This implementation allows us to set ports through CLI
--postgres-port
or environment variablesPREFECT__SERVER__DATABASE__HOST_PORT
however we can definitely go a different route.This PR also adds the options to disable port mappings on a per-service basis. (e.g.
--no-postgres-port
)Closes #2225
Why is this PR important?
Port customization for the start command is a nice convenience to have.