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 one-shot mode #66

Open
alexellis opened this issue Jul 8, 2019 · 6 comments
Open

Add one-shot mode #66

alexellis opened this issue Jul 8, 2019 · 6 comments

Comments

@alexellis
Copy link
Member

Expected Behaviour

To enable the "batch job" use-case, users should be able to specify a "one shot" mode or parameter. This would allow unlimited requests to /healthz and /metrics, but only a single request to /, after which it would shutdown the binary process.

This is partially to work around limitations in Kubernetes jobs with daemons, web-servers and side-cars which keep the job in a "running" status.

kubernetes/kubernetes#25908
kubernetes/enhancements#753

Argo workflows does appear to work in "sidecar" mode without any additional changes to the watchdog, but I suspect building on Kubernetes Jobs would be cleaner from a dependencies point of view.

Example with figlet container:

https://twitter.com/alexellisuk/status/1148239010034311169

Example in Argo docs on sidecars:

https://github.com/argoproj/argo/blob/master/examples/README.md#sidecars

@alexellis
Copy link
Member Author

@LucasRoesler @stefanprodan WDYT?

@alexellis
Copy link
Member Author

Related to: openfaas/faas#657

@LucasRoesler
Copy link
Member

@alexellis without a sidecar, how would the request to / be sent?

@alexellis
Copy link
Member Author

Sorry I don't understand the question.

@alexellis
Copy link
Member Author

The batch job use-case would be like I shared in my tweet in the original post above.

Container 1 - curl or similar process - calls 127.0.0.1:8080 with payload
Container 2 - OF container built with of-watchdog or classic watchdog in "one shot" mode

Result of invocation is available via STDIO, or with Container 3 which would save away the result.

@alexellis
Copy link
Member Author

The overall workflow would be out of scope for this flag / feature addition. The suggested feature is simply a graceful shutdown after processing a single HTTP invoke request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants