Closed chungers closed 6 years ago
Merging #853 into master will decrease coverage by
<.01%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #853 +/- ##
==========================================
- Coverage 48.46% 48.45% -0.01%
==========================================
Files 89 89
Lines 8125 8015 -110
==========================================
- Hits 3938 3884 -54
+ Misses 3817 3774 -43
+ Partials 370 357 -13
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update f780dd0...a88635c. Read the comment docs.
Please sign your commits following these rules: https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work The easiest way to do this is to amend the last commit:
$ git clone -b "gc-fsm" git@github.com:chungers/infrakit.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354013520
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f
Amending updates the existing PR. You DO NOT need to open a new one.
merging this because regardless of which implementation design we take, this PR adds at a minimum more tests to the fsm package.
This PR implements a simple POC for #846 using the pkg/fsm state machine models. The POC is implemented as more tests for the fsm package
usage_gc_test.go
.Some terminology:
Index
type is for defining possible states whileSignal
are signals that a fsm will react to. For the purpose of managing swarm nodes, we consider a swarm node to have two components that are joined via a link label. For linking a vm instance to a running Docker engine, there must be a tag of valueK
for the vm instance and a Docker engine label of valueK
. Once this association is established, we no longer need to query the actual Docker engine (via TLS or via SSH) for engine identity and our fsm models this using the states:with signals that we can implement:
Note that we can determine when a Docker Node or when an instance is
gone
by computing the difference of the sampled sets of nodes/instances. Please seeTestSwarmEntities
test for the four cases listed in #846Here is an example state definition:
In this example, the state
matched_docker_node
denotes the state a particular "node" is in when there's aDocker node ls
entry. In theTransitions
map, a signalinstance_ok
will transition the state toswarm_node
, whileinstance_gone
will transition toremoved_instance
. In this state we can define a TTL that says we can only be in this state forwait_describe_instances
* ticks, where ticks is a polling interval the fsm engine is initialized with. When the deadline is exceeded, the signalinstance_gone
is raised and an action calleddockerNodeRm.do
is performed, as specified in theActions
map.@kaufers
Signed-off-by: David Chung david.chung@docker.com