Coder Social home page Coder Social logo

dreamlab / vmshepherd Goto Github PK

View Code? Open in Web Editor NEW
10.0 14.0 2.0 595 KB

VmShepherd is a lightweight, scalable, standalone asynchronous app to manage clusters

Home Page: http://doc.dreamlab.pl/VmShepherd/user/index.html

License: Apache License 2.0

Makefile 0.99% Python 88.61% CSS 2.04% Shell 0.25% Dockerfile 0.58% Jinja 7.53%
orchestration asyncio openstack clusters cloud vmshepherd openstack-nova python3 virtual-machine

vmshepherd's Introduction

VmShepherd

image0_ image1_

Introduction

VmShepherd is an application that helps you maintain groups (clusters) of virtual machines. It keeps defined parameters (like count, image, etc.) by checking state in an IaaS layer, and tests underlying services with a specified health check.

Architecture

VmShepherd is designed to be easily extensible with plugins. Empowered by python3 and its asyncio module to facilitate scaling. The diagram below shows the base components of the app.

image

  • Preset Manager is responsible for fetching cluster spec/definition (preset). Built-in presets: DirectoryDriver and GitRepoDriver
  • Runtime Manger exposes functionality of locking preset, and holds intermediate states. Currently available: InMemoryDriver, PostgresDriver, ZookeeperDriver.
  • IaaS is a glue (api wrapper) to IaaS provider, OpenStackDriver is the first implemented.
  • Healthcheck allows to check service's state, not only for existence of a virtual machine. HttpHealthcheckDriver is built-in.

For more information, please take look at the documentation.

Installation

Application requires python 3.6 or later. The latest stable version is available on Pypi.

pip install vmshepherd

Another way of installation for a VmShepherd is a docker. You can easily download latest version of our application from a docker hub.

docker pull dreamlabcloud/vmshepherd

Before you run a application, you need to prepare configuration files according to this rules.

When you create a configuration file, you can deploy a VmShepherd like that:

docker run -v $PATH_TO_CONFIG_DIRECTORY/:/home/shepherd -p 8888:8888 -it vmshepherd -c config/settings.example.yaml
  • Where PATH_TO_CONFIG_DIRECTORY is a localisation of a configuration files on your host
  • -c config/settings.example.yaml is a list of arguments passed to a VmShepherd in container

Example:

➜  VmShepherd/docker ✗ sudo docker run -v $(realpath ../)/:/home/shepherd -p   8888:8888 -it vmshepherd -c config/settings.example.yaml
INFO:root:Starting server, listening on 8888.
INFO:root:VmShepherd start cycle...
INFO:root:VMs Status: 1 expected, 0 in iaas, 0 running, 0 nearby shutdown, 0 pending, 0   after time shutdown, 0 terminated, 0 error, 0 unknown, 1 missing
INFO:root:VMs Status update: 0 terminated, 0 terminated by healthcheck, 1 created, 0 failed healthcheck

We also provide a Dockerfile which can be used during a development:

docker build -t vmshepherd .
docker run -it  -p 8888:8888 -p 8000:8000 vmshepherd run

Usage

After installation you need to create a main configuration file (check examples in config/ directory in this repo).

Run:

vmshepherd -c CONFIGFILE

Contributing to VmShepherd

Thank you for your interest in contributing to VmShepherd. Like always there are many ways to contribute, and we appreciate all of them.

Pull requests and issues are the primary mechanism we use to change VmShepherd. Github itself has a great documentation about using Pull Requests. We use the "fork and pull" model, where contributors push changes to their personal fork and create pull requests to bring those changes into the source repository.

If you want to find something to work on, please check issues in our roadmap.

Check out the documetation http://doc.dreamlab.pl/VmShepherd/development/index.html.

TL;DR

Pull requests will need:

License

Apache License 2.0

vmshepherd's People

Contributors

evemorgen avatar jaceksocha avatar kwarunek avatar pkruk avatar rjastrzebski avatar tarfik avatar witoso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

frankfanslc

vmshepherd's Issues

Fix or get rid of pipenv

Currently we are not using pipenv as it should be. There are some problems (slows down test start, tox virtualenv vs pipenv's one) without any gain.

Use pipenv or poetry or ...

Currently usage of pipenv has been dropped (#10 ), but ultimately it would be great to revisit our needs and take advantages of such a solution (like ease of setting up env, pipfile, ...)

Keep preset state

Keep in memory presets' state from last cycle. UI/API should use that state. Currently we generate too much traffic to controllers.

Enhance UI

Current approach is not bad, but it would be good to ugrade bootstrap, reformat preset's parameters, add sort/colors to vms tree.

Auto scaling mechanism

Would be nice to implement auto-scaling abstraction (autoscaler driver?), that supports ec2 autoscaler groups and so on..

Current state - API and dashboard

Implement mechanism to refresh vms, runtime state per X time. #4 introduced some some drawbacks, basically it's possible to get out-of-date data

Policy abstraction

Logic that manage preset could be simplified, decoupled in policies like:

  • Maintain
  • TerminateUnhealthy
  • Timedshutdown

Requirements

It's necessary to add minimal requirements of the app in the documentation/README.

For example:

  • python version (i.e. documentation generation fails with Python 3.5.1)
  • OS (I guess it's debian based app)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.