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

Hab Supervisor: add a "run a task and then shut down" mode #4676

Open
tashimi opened this issue Feb 26, 2018 · 11 comments
Open

Hab Supervisor: add a "run a task and then shut down" mode #4676

tashimi opened this issue Feb 26, 2018 · 11 comments
Labels
Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Stale Type: Feature Issues that describe a new desired feature

Comments

@tashimi
Copy link
Contributor

tashimi commented Feb 26, 2018

We should add the ability for the Habitat Supervisor to start up, run a job, and then exit and shut down.

This has come up in a couple different scenarios, including build jobs in a Jenkins/Concourse pipeline and running as a test scenario in a High Performance Computing (HPC) cluster with Singularity.

@elliott-davis
Copy link
Contributor

Additionally, when the Supervisor shuts down, it should pass the exit code from its child as it's own exit code.

@mwrock
Copy link
Contributor

mwrock commented Feb 26, 2018

Just to clarify, do we mean running a "supervisor service" that has an intentionally terminating run hook? Or would this specifically start its own supervisor to run a new "job" primitive?

@christophermaier
Copy link
Contributor

@mwrock This would probably be a "run this package until it exits successfully, and then stop".

Right now, the Supervisor will continually restart a service if it exits successfully.

This also would mean that the things the Supervisor can run now are not necessarily "services" (i.e., long running daemon-like processes), but also "jobs".

@mwrock
Copy link
Contributor

mwrock commented Feb 26, 2018

ok that makes sense. I love the idea. I have had a couple times where I thought a hab pkg exec could get a job done and then I remember "oh no handlebars or binds." Foe example a one off DB migration job.

@dm4r
Copy link

dm4r commented Feb 26, 2018

👍

@bdangit
Copy link
Contributor

bdangit commented Feb 27, 2018

Perhaps there should be a flag that user can sethab start —run_once some/pkg? Or allow the the pkg owner to set a flag that tells the supervisor that the process is finished doing work.

@christophermaier
Copy link
Contributor

@bdangit Agreed; we can probably take some inspiration from Erlang supervisor restart strategies:

restart defines when a terminated child process is to be restarted.

A permanent child process is always restarted.
A temporary child process is never restarted (not even when the supervisor restart strategy is rest_for_one or one_for_all and a sibling death causes the temporary process to be terminated).
A transient child process is restarted only if it terminates abnormally, that is, with an exit reason other than normal, shutdown, or {shutdown,Term}.

The restart key is optional. If it is not given, the default value permanent will be used.

@baumanj
Copy link
Contributor

baumanj commented Jun 26, 2018

Confirmed valid in v0.57

@baumanj baumanj removed their assignment Jun 26, 2018
@christophermaier christophermaier added this to the Supervisor Usability milestone Jun 29, 2018
@stale
Copy link

stale bot commented Apr 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

@stale stale bot added the Stale label Apr 3, 2020
@christophermaier christophermaier added Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component and removed A-supervisor labels Jul 24, 2020
@stale stale bot removed the Stale label Jul 24, 2020
@christophermaier christophermaier added Type: Feature Issues that describe a new desired feature and removed C-feature labels Jul 24, 2020
@stale
Copy link

stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

1 similar comment
@stale
Copy link

stale bot commented Oct 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

@stale stale bot added the Stale label Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Stale Type: Feature Issues that describe a new desired feature
Projects
None yet
Development

No branches or pull requests

8 participants