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

[ENH] Allow commands to be classified into terminating/non-terminating categories #346

Open
mcg1969 opened this issue Nov 28, 2021 · 4 comments
Labels
TRIAGE Uncategorized issue

Comments

@mcg1969
Copy link
Collaborator

mcg1969 commented Nov 28, 2021

Someone who is using anaconda-project now extensively for jobs has encountered an issue where they have a project with multiple commands—one intended to run as a persistent deployment, and another is intended to run as a scheduled job.

If you launch the deployment accidentally as a Kubernetes scheduled job, and you also don't know to set your concurrencyPolicy for such jobs to Replace or Forbid, then you have the unfortunate situation that jobs pile up until you exhaust your cluster.

It occurs to me that, in the spirit of capturing as much knowledge about a project as possible in anaconda-project.yml, that we could have an optional field that can be added to each command that specifies whether or not it is expected to terminate. For example, we could have a boolean field terminates, or a field type with categories api, application, job, etc.

@mcg1969 mcg1969 added the TRIAGE Uncategorized issue label Nov 28, 2021
@jlstevens
Copy link
Collaborator

jlstevens commented Nov 29, 2021

I like this proposal but I would suggest that terminates: false is the implicit default as deployments are typically (in my experience) flask, notebook, bokeh/panel or other server processes that keep running.

There are some existing examples of terminating process that I've encountered in the wild, namely testing and linting.

One last thought (though I am not yet convinced this is a good idea!): if supports_http_options: true is set, that does strongly suggest a server process...

The type (maybe process_class is a clearer name?) suggestion is also nice as it is more general though it is hard to know the possible enumeration options when looking at the yaml whereas as a boolean predicate value is trivial to specify.

@jbednar
Copy link
Collaborator

jbednar commented Nov 29, 2021

terminating_job=True?

@jlstevens
Copy link
Collaborator

I do quite like that as it makes the most important use case clear...

@jbednar
Copy link
Collaborator

jbednar commented Nov 29, 2021

anaconda-project cron doesn't exist, but presumably some external service that launches such a scheduled job could give a warning if it finds one without terminating_job=True declared, asking the user if they really do want to schedule a recurring run for something that might not ever terminate.

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

No branches or pull requests

3 participants