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

Periodic dispatcher #540

Merged
merged 30 commits into from
Dec 24, 2015
Merged

Periodic dispatcher #540

merged 30 commits into from
Dec 24, 2015

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Dec 8, 2015

This PR adds support for running periodic jobs. It provides an at-most once run guarantee even across leadership transitions.

A follow up PR is needed to force run a periodic job.

@c4milo
Copy link
Contributor

c4milo commented Dec 9, 2015

Awesome work @dadgar, I'm going to test this PR as soon as possible.

@dadgar dadgar force-pushed the f-periodic branch 3 times, most recently from 8eff2c4 to c01b8e7 Compare December 11, 2015 22:03
@ranjib
Copy link
Contributor

ranjib commented Dec 13, 2015

When periodic jobs are created (i.e. nomad run periodic.hcl), the CLI does not show evaluation details similar to batch or service jobs. Is it expected? Similarly status for jobs also show , i was expecting that to show either next trigger time or something else, and probably previous allocations etc.

@dadgar
Copy link
Contributor Author

dadgar commented Dec 14, 2015

@ranjib: It is expected that the CLI doesn't show eval details on periodic jobs. This is because periodic jobs never have an evaluation associated with them. They will spawn child jobs that will have evals but they themselves never do.

As for nomad status, that can be improved. This PR was just getting too big.

@ranjib
Copy link
Contributor

ranjib commented Dec 14, 2015

@dadgar 🎉 One more thing, system jobs cant be periodic? like we cant use nomad to run chef periodically on all hosts?
FYI i took this branch for a spin under the [systemd driver] and its working well.

@dadgar
Copy link
Contributor Author

dadgar commented Dec 14, 2015

@ranjib: Currently (and for the foreseeable future) there will not be periodic system jobs. You could probably create the behavior by registering a system job and on the interval you need to run chef, do an update to the job that would force Nomad to rerun the job (changing args would do it).

@c4milo
Copy link
Contributor

c4milo commented Dec 15, 2015

I started testing this branch using the exec driver, but I've been noticing something weird with the allocations. For some reason once the task finishes, the allocation doesn't seem to be released. And, after a while, I start getting messages about resources being exhausted. I'm running locally using Vagrant and the VM is pretty much available for any workload.

@dadgar
Copy link
Contributor Author

dadgar commented Dec 15, 2015

@c4milo: Yeah that isn't actually a problem with this PR. It is a bigger problem in general. We aren't freeing up the resources consumed by an alloc even when it is terminal in certain cases. This will be fixed by a PR I am working on now. Should be done soon.


// PeriodicSpecTest is only used by unit tests. It is a sorted, comma
// seperated list of unix timestamps at which to launch.
PeriodicSpecTest = "test"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this behavior, maybe it should just be called "fixed" since it runs at fixed times. Otherwise, maybe pick something less likely to be accidentally used, e.g. "_internal_test"

dadgar added a commit that referenced this pull request Dec 24, 2015
@dadgar dadgar merged commit 9643b04 into master Dec 24, 2015
@dadgar dadgar deleted the f-periodic branch December 24, 2015 03:09
@c4milo
Copy link
Contributor

c4milo commented Dec 24, 2015

👯

@c4milo
Copy link
Contributor

c4milo commented Dec 24, 2015

This is a beautiful christmas gift 🎄

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants