Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
First commit for open source release
  • Loading branch information
stefreak committed Nov 14, 2018
0 parents commit cdaaaaa
Show file tree
Hide file tree
Showing 34 changed files with 1,410 additions and 0 deletions.
110 changes: 110 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Mac OS
.DS_Store

# Vim
*.sw[po]
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ARG PYTHON_VERSION
FROM python:$PYTHON_VERSION-alpine

RUN apk add bash git socat
RUN pip install tox

WORKDIR /src
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 SysEleven GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Unattended Reboot Manager

## Overview

Rebootmgr is an operations tool, that can help you safely automate reboots of nodes in complex, distributed environments.

We created rebootmgr for our public cloud offering SysEleven Stack, because we wanted to make sure that our services are always up-to-date and secure.

We noticed that rebootmgr does not only save valuable time for our engineers, it can also reboot more reliably, because it is more vigilant than a human, always keeping an eye on the cluster's health.

## Design

Using consul, rebootmgr is able to have an overview of your cluster's services health. It also uses the locking and key-value store features of Consul to make sure, that only one node in the cluster is rebooting at a time.

For a deep dive how exactly rebootmgr works internally and why we created it, see our [design document](docs/design.md).

## Getting started

If you want to try rebootmgr hands-on, have a look at our [installation guide](docs/install.md).

## Reference

For a deep-dive into rebootmgr usage scenarios, have a look at our [reference guide](docs/reference.md)

## Testing

For running the integration tests you need docker compose. For running the linter and safety checks, you need tox.

```
# Run integration tests with different python versions
$ docker-compose run --rm integration_tests_py37
$ docker-compose run --rm integration_tests_py36
$ docker-compose run --rm integration_tests_py35
# Run linter and safety checks
$ tox -e lint
$ tox -e safety
# Clean up docker
docker-compose down --rmi local -v
```

## Contributing

We would love seeing community contributions for rebootmgr, and are eager to collaborate with you.
105 changes: 105 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
rebootmgr (0.0.20-0+syseleven1) xenial; urgency=medium

* Don't restart rebootmgr after update/installation

-- Dennis Kuhn <[email protected]> Wed,22 Aug 2018 15:03:37 +0200
rebootmgr (0.0.19-0+syseleven1) xenial; urgency=medium

* Change default cli options

-- Dennis Kuhn <[email protected]> Fri,17 Aug 2018 15:03:37 +0200
rebootmgr (0.0.18-0+syseleven1) xenial; urgency=medium

* Remove systemd timer from package

-- Dennis Kuhn <[email protected]> Fri,27 Jul 2018 15:03:37 +0200
rebootmgr (0.0.17-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Fri,29 Jun 2018 15:03:37 +0200
rebootmgr (0.0.16-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Wed,11 Sep 2018 15:03:37 +0200
rebootmgr (0.0.15-0+syseleven1) xenial; urgency=medium

* Version update

-- Steffen Neubauer <[email protected]> Wed,04 Sep 2017 15:03:37 +0200
rebootmgr (0.0.14-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Wed,16 Aug 2017 15:03:37 +0200
rebootmgr (0.0.13-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Mon,17 Jul 2017 15:03:37 +0200
rebootmgr (0.0.12-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Tue,4 Jul 2017 15:03:37 +0200
rebootmgr (0.0.11-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Thu,3 Jul 2017 15:03:37 +0200
rebootmgr (0.0.10-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Thu, 20 Apr 2017 15:03:37 +0200
rebootmgr (0.0.9-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Thu, 20 Apr 2017 15:03:37 +0200
rebootmgr (0.0.8-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Thu, 20 Apr 2017 15:03:37 +0200
rebootmgr (0.0.7-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Wed, 22 Mar 2017 15:03:37 +0200
rebootmgr (0.0.6-0+syseleven2) xenial; urgency=medium

* use symlink for etc/kernel/postinst.d/update-notifier

-- Dennis Kuhn <[email protected]> Wed, 22 Mar 2017 15:03:37 +0200
rebootmgr (0.0.6-0+syseleven1) xenial; urgency=medium

* Version update to 0.0.6

-- Dennis Kuhn <[email protected]> Wed, 22 Mar 2017 15:03:37 +0200
rebootmgr (0.0.5-0+syseleven1) xenial; urgency=medium

* Version update to 0.0.5

-- Dennis Kuhn <[email protected]> Fri, 17 Mar 2017 15:03:37 +0200
rebootmgr (0.0.4-0+syseleven1) xenial; urgency=medium

* Version update to 0.0.4

-- Dennis Kuhn <[email protected]> Thu, 09 Mar 2017 15:03:37 +0200
rebootmgr (0.0.3-0+syseleven1) xenial; urgency=medium

* Version update

-- Dennis Kuhn <[email protected]> Thu, 09 Mar 2017 15:03:37 +0200
rebootmgr (0.0.2-0+syseleven1) xenial; urgency=medium

* fix pybuild install

-- Dennis Kuhn <[email protected]> Thu, 09 Mar 2017 15:03:37 +0200
rebootmgr (0.0.1-0+syseleven1) xenial; urgency=medium

* Initial build of this package for Ubuntu 16.04

-- Dennis Kuhn <[email protected]> Thu, 09 Mar 2017 15:03:37 +0200
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
30 changes: 30 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Source: rebootmgr
Maintainer: Dennis Kuhn <[email protected]>
Section: python
Priority: optional
Build-Depends: debhelper (>= 9),
python3-setuptools (>= 0.6b3),
python3-consul,
python3-requests,
python3-urllib3,
python3-click,
python3-colorlog,
python3-retrying,
python3-all,
dh-systemd,
dh-python
X-Python3-Version: >= 3.2
Standards-Version: 3.9.7
Homepage: https://gitlab.syseleven.de/openstack/underlay/tree/master/rebootmgr

Package: rebootmgr
Architecture: all
Depends: ${misc:Depends}, ${python3:Depends}, python3-consul-lib, python3-holidays
Conflicts: update-notifier-common
Description: Rebootmgr
Rebootmgr reboots a single node. Rebootmgr checks all
consul checks with the tag "rebootmgr" and executes all task
in /etc/rebootmgr/post_boot_tasks or /etc/rebootmgr/pre_boot_tasks
.
This package contains the binary in /usr/bin and
systemd service.
27 changes: 27 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rebootmgr
Source: https://gitlab.syseleven.de/openstack/underlay/tree/master/rebootmgr

Files: *
Copyright: 2016 SysEleven GmbH
License: Apache-2

Files: debian/*
Copyright: 2016 SysEleven GmbH
License: Apache-2

License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.
2 changes: 2 additions & 0 deletions debian/dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/etc/rebootmgr/post_boot_tasks
/etc/rebootmgr/pre_boot_tasks
2 changes: 2 additions & 0 deletions debian/rebootmgr.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
systemd/rebootmgr.service lib/systemd/system
extra/notify-reboot-required usr/share/update-notifier/
1 change: 1 addition & 0 deletions debian/rebootmgr.links
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/share/update-notifier/notify-reboot-required etc/kernel/postinst.d/update-notifier
3 changes: 3 additions & 0 deletions debian/rebootmgr.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
fi
3 changes: 3 additions & 0 deletions debian/rebootmgr.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
fi
10 changes: 10 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/make -f

export PBR_VERSION=0.0.1

%:
dh $@ --with python3,systemd --buildsystem=pybuild

override_dh_systemd_start:
echo "don't run dh_systemd_start"

1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
Loading

0 comments on commit cdaaaaa

Please sign in to comment.