This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 302
Rough implementation of an event-based job control model #28
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This new event consumer listens for new jobs or machines and ensures two things: 1) new cluster-level jobs are scheduled to all machines in the cluster 2) new machines receive each of the cluster-level jobs when they boot This code needs a lot of work, but hey, it's functional.
registry.EventMachineCreated: self.handleEventMachineCreated, | ||
registry.EventMachineDeleted: self.handleEventMachineDeleted, | ||
registry.EventRequestCreated: self.handleEventRequestCreated, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be in the event loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it does not. Working on more refactoring locally now into which I will incorporate this change.
@polvi I got impatient with myself. There you go ^ |
just make everything recursive for now.
Fixup to use etcd master
* JobRequest objects yield JobWatch objects * A JobWatch object tracks a single JobPayload and a Count. A Count value of -1 represents the need to run a Job with the contained JobPayload on every host. A value other than -1 represents the need to run a specific number of the contained JobPayload across the cluster. * A user of corectl may pass a --count flag to set Count to something larger than 1 * EventMachineUpdated events are now emitted when an Agent heartbeats. This is used by the Dispatcher to track an up-to-date list of machines.
bcwaldon
added a commit
that referenced
this pull request
Dec 3, 2013
Rough implementation of an event-based job control model
} | ||
|
||
func (self *Dispatcher) claimRequest(request *job.JobRequest) bool { | ||
return self.registry.AcquireLock(request.ID.String(), self.machine.BootId, self.claimTTL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aside: can you try out the lock mod once it is merged? etcd-io/etcd#347
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.