Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Rough implementation of an event-based job control model #28

Merged
merged 13 commits into from
Dec 3, 2013

Conversation

bcwaldon
Copy link
Contributor

@bcwaldon bcwaldon commented Dec 2, 2013

No description provided.

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,
}
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@bcwaldon
Copy link
Contributor Author

bcwaldon commented Dec 2, 2013

@polvi I got impatient with myself. There you go ^

bcwaldon and others added 5 commits December 2, 2013 11:30
just make everything recursive for now.
* 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
@bcwaldon bcwaldon merged commit 4d6fc25 into coreos:master Dec 3, 2013
@bcwaldon bcwaldon deleted the schedule-all branch December 3, 2013 00:08
}

func (self *Dispatcher) claimRequest(request *job.JobRequest) bool {
return self.registry.AcquireLock(request.ID.String(), self.machine.BootId, self.claimTTL)
Copy link
Contributor

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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants