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

fleetd: introduce Replaces option in unit files #1572

Merged
merged 4 commits into from
May 30, 2016

Conversation

dongsupark
Copy link
Contributor

Introduce a new option 'Replaces' in X-Fleet the section, to get an existing unit rescheduled to another machine. This option basically works like an existing option 'Conflicts', except that circular replaces in 2 units are not allowed. Also Conflicts cannot be used together with Replaces, Global cannot be used together with Replaces.

Fixes: #1394

/cc @onlyjob @kayrus @tixxdz

@dongsupark dongsupark force-pushed the dongsu/fleetd-replaces-unit branch 2 times, most recently from 6ba5104 to 0c52441 Compare May 3, 2016 14:29
@dongsupark
Copy link
Contributor Author

dongsupark commented May 3, 2016

Added more unit tests.

Note that I'm self-reviewing this PR more carefully than other minor PRs, as the original issue is marked as milestone 0.13. As it touches fleetd, we should be a little more careful. As I don't have an access to add github labels, I'm writing it as comments.

@dongsupark dongsupark force-pushed the dongsu/fleetd-replaces-unit branch from 0c52441 to 94b0d53 Compare May 6, 2016 09:11
@dongsupark
Copy link
Contributor Author

Updated documents and functional tests.

Dongsu Park added 3 commits May 30, 2016 14:37
Introduce a new option 'Replaces' in X-Fleet the section, to get an
existing unit rescheduled to another machine. This option basically
works like an existing option 'Conflicts', except that circular replaces
in 2 units are not allowed. Also Conflicts cannot be used together with
Replaces, global cannot be used together with Replaces.

Fixes: coreos#1394
Introduce necessary unit tests for testing a new unit option, Replaces.
Not only simple replaces, but also various combinations with Conflicts
or Global should be tested.
Add a short description about a new option Replaces.
@dongsupark dongsupark force-pushed the dongsu/fleetd-replaces-unit branch 2 times, most recently from 6e7a035 to b58c637 Compare May 30, 2016 13:10
TestScheduleReplace starts 1 unit, followed by starting another unit
that replaces the 1st unit. Then it verifies that the 2 units are
started on different machines.
Also check that circular replaces result in 1 launched unit.
@dongsupark dongsupark merged commit 1d6e74a into coreos:master May 30, 2016
@dongsupark dongsupark deleted the dongsu/fleetd-replaces-unit branch May 30, 2016 13:50
@onlyjob
Copy link
Contributor

onlyjob commented May 30, 2016

Thanks!

dongsupark pushed a commit to dongsupark/fleet that referenced this pull request Nov 1, 2016
While the 'Replaces' option has been supported since
coreos#1572, the engine didn't actually
unschedule units to be replaced. It was a bug.

So let's implement GetReplacedUnit() to expose the replaced unit from
AgentState to the engine reconciler. And make the engine reconciler
unschedule the replaced unit, and schedule the current unit.
The engine scheduler's decision structure needs to also track if the
unit needs to be rescheduled, to be used by the scheduling path.
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request Nov 3, 2016
While the 'Replaces' option has been supported since
coreos#1572, the engine didn't actually
unschedule units to be replaced. It was a bug.

So let's implement GetReplacedUnit() to expose the replaced unit from
AgentState to the engine reconciler. And make the engine reconciler
unschedule the replaced unit, and schedule the current unit.
The engine scheduler's decision structure needs to have a helper for
the rescheduling case, by simply scheduling the replaced unit to a
free machine.
dongsupark pushed a commit to dongsupark/fleet that referenced this pull request Nov 3, 2016
While the 'Replaces' option has been supported since
coreos#1572, the engine didn't actually
unschedule units to be replaced. It was a bug.

So let's implement GetReplacedUnit() to expose the replaced unit from
AgentState to the engine reconciler. And make the engine reconciler
unschedule the replaced unit, and schedule the current unit.
The engine scheduler's decision structure needs to have a helper for
the rescheduling case, by simply scheduling the replaced unit to a
free machine.
dongsupark pushed a commit to endocode/fleet that referenced this pull request Nov 4, 2016
While the 'Replaces' option has been supported since
coreos#1572, the engine didn't actually
unschedule units to be replaced. It was a bug.

So let's implement GetReplacedUnit() to expose the replaced unit from
AgentState to the engine reconciler. And make the engine reconciler
unschedule the replaced unit, and schedule the current unit.
The engine scheduler's decision structure needs to have a helper for
the rescheduling case, by simply scheduling the replaced unit to a
free machine.
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.

2 participants