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

feat(controller): add container state via FSM #716

Closed
wants to merge 60 commits into from

Conversation

bacongobbler
Copy link
Member

This makes a container's state directly managed via a Finite State Machine (see http://en.wikipedia.org/wiki/Finite-state_machine).

With this new behaviour, containers can be in one of 5 different states:

  1. up
  2. down
  3. initialized
  4. created
  5. destroyed

A diagram that shows the container's transitions as it goes from state to state would be nice, but is not necessary for this commit. I've noted this as a TODO feature in the documentation.

I have also set the container's FSM to protected, so that nobody can directly change the FSM's state. Only a call to the model's functions that have a @transition decorator will be able to change the state.

fixes #699

Note: this is a PR for the scheduler branch, not master. There's a lot of churn here, so I wanted to have a discussion/audit before merging this.

Gabriel Monroy added 30 commits April 9, 2014 15:41
 - add concept of cluster for external job scheduling
 - first pass at new container api with mock scheduler
 - simplify build + config = release
 - deprecate configuration management and provider packages
 - deprecate node management features (formation/layer/node/provider/flavor)
Note an SSH wrapper is used to get around fleetctl ssh-agent requirement.  We will ultimately want to transition to an HTTP API for talking to fleet.  Until then, we should explore modifying fleetctl to remove the ssh-agent requirement for tunneling.

add cluster setup and teardown

announce to /deis/services/{container_name} with a sidekick container

 - add pull before start
 - add stop and remove in ExecStop
 - use hardcoded expose port 5000 for deis/slugrunner

parallelize scheduler tasks, add appropriate blocking

exclude scheduler from max-line-length

add sidekick container for logging, unit cleanup

add unit name regex, use it when templating units

add domain and options to SchedulerClient
fix destroy bug

update readme to reflect new scheduler workflow, with placeholders for not-yet-implemented features

first pass at systemd units for components

coreos contrib scripts, units and user-data helpers
- add release version as header on build and config creation
- provide dynamic output on build/config CLI, including resulting release
- add `deis push` CLI shortcut for builds:create
…entations

 - mock docker registry used for unit testing
 - private module used for adding layers to private registry
 - add registry.image field that includes build+config as a tagged image
 - added confd settings for a required private registry_url
chore(makefile): stop on uninstall

chore(makefile): separate clean and full-clean

chore(makefile): separate clean and full-clean

perf(makefile): batch ssh calls in root makefile

fix(Makefile): run make cmds on vagrant

in order to be consistent, all commands should be run under vagrant.
Gabriel Monroy and others added 26 commits April 9, 2014 15:46
If no container structure has been specified for a release, we
can safely assume that a web process exists. The application
should be scaled by 1.
When using aufs in docker on coreos, obscure errors show up, such
as python's gevent not building for autoconf errors. Specifying
btrfs as the filesystem fixes it.
See moby/moby#2056
deis does not use chef for convergence any more, so it is no longer
needed inside the container.
sqlite3 does not support database transactions, which Deis uses
heavily in both the scheduler as well as in other components.
Regardless, our dev and test environments should be running the
tests on the same environment, so that we can ensure that the tests
should run the same in both environments.
Before, anyone was able to add clusters into Deis, which is a management
nightmare. Administrators of Deis should be the only ones capable
of adding new clusters to Deis.

fixes #696
This makes a container's state directly managed via a Finite State
Machine (see http://en.wikipedia.org/wiki/Finite-state_machine).

With this new behaviour, containers can be in one of 5 different
states:

1) up
2) down
3) initialized
4) created
5) destroyed

A diagram that shows the container's transitions as it goes from
state to state would be nice, but is not necessary for this commit.
I've noted this as a TODO feature in the documentation.

I have also set the container's FSM to protected, so that nobody can
directly change the FSM's state. Only a call to the model's functions
that have a @transition decorator will be able to change the state.

fixes #699
We need git at the moment as a hack to run pip install for
bacongobbler's fork of django-fsm. Once that feature branch
has been merged into upstream, we can remove this hack.
@bacongobbler
Copy link
Member Author

Branch is broken, so I'll open up a new PR for this.

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.

None yet

2 participants