Skip to content
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 missing use_exec to serve the API #203

Open
lsorber opened this issue Oct 31, 2023 · 2 comments
Open

Add missing use_exec to serve the API #203

lsorber opened this issue Oct 31, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@lsorber
Copy link
Member

lsorber commented Oct 31, 2023

We should be exec'ing that process, but it seems that Poe the Poet does not support this for shell tasks: https://poethepoet.natn.io/tasks/task_types/shell.html#available-task-options

Looks like this can be solved with https://poethepoet.natn.io/tasks/task_types/switch.html.

@lsorber lsorber self-assigned this Oct 31, 2023
@SiPaRadix
Copy link
Contributor

From the documentation in the link above:

switch tasks support all of the standard task options with the exception of use_exec.

Does that not mean a subprocess is spawned regardless?

Alternatively, could we consider adding exec in front of uvicorn ... and gunicorn ... and avoid spawning a subprocess that way or is it already too late since a subprocess of the poe cli is already spawned at that point?
From the PyPI project description:

Normally tasks are executed as subprocesses of the poe cli.

@lsorber
Copy link
Member Author

lsorber commented Feb 26, 2024

Yes, Poe will spawn a subprocess. Poe added the ability to exec a command at our request a while back. And we want to exec the process because of the reasons explained in this comment.

Unfortunately, I don't think adding exec will help because that will just replace the process that Poe starts to run the shell script (and not the Poe process itself).

One solution is to replace the current shell switch to a Poe switch task, in which case we can exec the switched commands.

@lsorber lsorber added the enhancement New feature or request label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants