Replies: 1 comment 6 replies
-
I never run bundles like that so do you mind if I ask some questions to better understand what you are doing in the bundle?
Side note: We have a feature on our roadmap called mixins as bundles that will break up bundles and how they execute so that there won't be a single container that exists for the duration of the bundle's execution. Think each mixin will run with a shared mounted volume for data but do not run in the same container. So what you are relying on now, won't work without modification after that change is implemented. It would be great to better understand what you are doing so that we can plan for that in the feature! |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The Problem
There are many times when it is useful to be able to keep a process running in the background. Currently the options for doing so are:
&
terminatornohup
orscreen
Each of these has some significant draw backs.
Option 1 doesn't work well with the
exec
schema. Specifying&
as a suffix argument doesn't work because the underlyingexec
functionality doesn't recognize it as a terminator and passes it as an argument instead.Option 2 requires 3rd party tools be installed either by modifying the docker file or creating a custom mixin. Screen also requires an interactive tty session to work correctly which isn't a flag set by the porter runtime.
Option 3 works but requires knowledge about the linux distro and how to write a service configuration file correctly. It's also a lot of work for something that could be very simple.
The Solution
Currently the porter runtime always waits for a response before executing the next step. Just in the same way that the
Suppressible
option works today, aRunAsync
option could be implemented indicating that porter doesn't expect a response from this command. I already have a small code change implemented on my local clone that does this.Other considerations
Allowing Porter to manage a process running in the background, while possible, opens a whole can of worms. Instead the runtime could return the PID of the process as an output so that other mixins can interact with it if necessary. From Porter's perspective, it has effectively disowned the process and transferred management of it to the author.
Modifying this behavior at the runtime level has the effect of enabling this functionality for any mixin that wants to make use of it, not just the exec mixin. Most mixins hook into the exec functionality anyways.
Beta Was this translation helpful? Give feedback.
All reactions