-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Allow docker-options to be scoped to specific Procfile processes #2441
Comments
Generally speaking a web process doesn't communicate directly with a worker. Usually the work "producer" will place the unit of work on a queue (backed by something like rabbitMQ or redis) and the worker looks for items on that queue. Most recent frameworks (in Python, Ruby, Node, etc.) give you this ability fairly easily and dokku even has an official redis plugin. To your question about docker-options per process type, we don't currently support that. However if you want to take a stab at a PR, feel free. |
@alexquick I mentioned you in the OP, no rush on an answer :) |
@josegonzalez I ended up using the Before (or as part of) tackling this you might want to come up with an acceptable dependency to take and make the chosen parser for the golang core plugins. https://github.com/teris-io/cli looks pretty nice but I haven't spent a lot of time with it. Do you have any suggestions? Another "issue" with the golang core plugins is that each subcommand is implemented as a separate binary. If they used a flag/argument parsing library that supported subcommands they could be each implemented as a single binary instead. I know having separate binaries for each subcommand is somewhat a feature, but it also makes for a some duplicate code and complicates the build process. Do you have any strong feelings either way? |
I recently used argparse, but it doesn't have support for positional arguments, nargs, or repeatable flags. Ideally we use something that is as powerful as argparse from python. I don't have experience with many other CLI parsers unfortunately. I'm fine with combining all binaries into one. The Does anyone have a cli parser they enjoy using? |
Note: we use urfave/cli at work. |
High Level Plan
dokku --global -flags docker-options:subcommand --subcommand flag-values --go-here regular arguments
seems like what we're standardizing on.--process PROC_TYPE
and--global
flags, with global being default.properties
functions in both golang and bash.properties
functions for handling configuration. We'll need to figure out how to handle namespacing as - at the moment - the current namespacing for properties isPLUGIN/APP/KEY
, and our keys should represent both the step (build/deploy/run) and the process type (specific one vs global).The ui will end up being something like:
Open questions:
:set
subcommand? My gut says yes, and we should make the semantics - outside of flag handling - similar to the existing:set
subcommands.@alexquick since you handled the config plugin refactor, thoughts on the feasibility of the above? I don't know how much work the flag handling was.
Original Comment
Scenario
A simple job queue application called
jobs-worker
with two process defined inProcfile
:The
web
process is an http service who register the tasks to be executed by theworker
process.The machine running the container is accessible only from the internal network and communicate only with other servers inside the network through private ip addresses.
For this reason the reverse proxy has to be disabled, and the container should expose a port.
Commands
Issue
The container fails to start the
worker
process because the port is already allocated for theweb
process.Actually the
worker
process does not need to be exposed.Is possible to define different docker-options for each process defined in the Procfile?
Is there an alternative way to have the same result?
The text was updated successfully, but these errors were encountered: