Package: vmshepherd
VmShepherdIntroductionVmShepherd 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.ArchitectureVmShepherd is designed to be easily extensible with plugins. Empowered bypython3and itsasynciomodule to facilitate scaling. The diagram below shows the base components of the app.Preset Manageris responsible for fetching cluster spec/definition (preset). Built-in presets:DirectoryDriverandGitRepoDriverRuntime Mangerexposes functionality of locking preset, and holds intermediate states. Currently available:InMemoryDriver,PostgresDriver,ZookeeperDriver.IaaSis a glue (api wrapper) to IaaS provider,OpenStackDriveris the first implemented.Healthcheckallows to check service’s state, not only for existence of a virtual machine.HttpHealthcheckDriveris built-in.For more information, please take look at thedocumentation.InstallationApplication requires python 3.6 or later. The latest stable version isavailable on Pypi.pip install vmshepherdAnother way of installation for a VmShepherd is a docker.
You can easily download latest version of our application from a dockerhub.docker pull dreamlabcloud/vmshepherdBefore you run a application, you need to prepare configuration files according to
thisrules.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.yamlWhere 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 containerExample:➜  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 healthcheckWe also provide aDockerfilewhich can be used during a development:docker build -t vmshepherd .
docker run -it  -p 8888:8888 -p 8000:8000 vmshepherd runUsageAfter installation you need to create a main configuration file (check examples inconfig/directory in this repo).Run:vmshepherd -c CONFIGFILEContributing to VmShepherdThank 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 usingPull 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 ourroadmap.Check out the documetationhttp://doc.dreamlab.pl/VmShepherd/development/index.html.TL;DRPull requests will need:TestsDocumentationA logical series ofwell written commitsLicenseApache License 2.0Changelog1.6.4 (2021-05-18)bugfix: preset logging1.6.3 (2021-05-15)bugfix: aiohttp lib version1.6.2 (2021-05-13)feature: log info how long virtual machine fails healthcheck1.6.1 (2020-08-13)feature: new vm object state - unhealthy1.6.0 (2019-12-18)feature: new rpc methods - list_presets_with_tags, get_preset_tags1.5.2 (2019-09-03)bugfix: terminate via iaas on healthcheck1.5.1 (2019-08-26)bugfix: vm class - remove terminate method1.5.0 (2019-08-23)feature: the vms list is keeping in runtime driver (latest possible)ans is refreshed by the git worker on every cycle1.4.2 (2019-08-14)bugfix: remove next _initialize_master_working_set line1.4.1 (2019-08-14)bugfix: remove _initialize_master_working_set on each driver get1.4.0 (2019-08-12)feature: rpc - list_vms - created at field1.3.5 (2019-07-26)bugfix: fix problem with sys.path in driversbugfix: reload entry_points1.3.3 (2019-07-26)bugfix:  add asyncio.lock for git clone/pull commands1.3.2 (2019-07-26)bugfix:  Add unique name for a tmp preset directory in a Git Driver1.3.1 (2019-06-03)bugfix:  change the return type for get_vm_ipfeature: custom exception class for errors1.3.0 (2019-06-03)feature: configure unmanaged state for presetsfeature: rpc api - get_vm_ip(preset_name, vm_id)1.2.3 (2019-05-10)bugfix: panel - fail to load due jinja error1.2.1 (2019-05-09)bugfix: update runtime data after manage even if unlockedbugfix: panel - deterministic preset order1.2.0 (2018-08-07)feature: api - added list_presets1.1.0 (2018-06-13)feature: adjustable timeout for http requests to iaas1.0.1 (2018-06-08)bugfix: API should use last cycle databugfix: OpenStackDriver refresh token1.0.0 (2018-06-06)preserve preset state (dashboard shows data from last cycle)bump AsyncOpenStackClient (0.6.2)docs0.7.7 (2018-05-10)bump AsyncOpenStackClient (0.5.2)0.7.6 (2018-05-10)bump AsyncOpenStackClient (0.5.1)0.7.5 (2018-04-09)runtime driver abstract fix0.7.4 (2018-03-22)cleanup, verify0.7.3 (2018-03-22)bump AsyncOpenStackClient (+ compat)0.7.2 (2018-03-22)user-data base640.7.1 (2018-03-21)multiple network interfaces0.7.0 (2018-03-20)AsyncOpenStackClient0.6.0 (2018-02-01)web panelrpc api0.0.3 (2018-02-01)initial