Skip to content

Commit

Permalink
IMPROVE CI and related docs
Browse files Browse the repository at this point in the history
- Remove the last remaining parts of travis CI
- Minor improvements
  • Loading branch information
mgmax committed Dec 23, 2023
1 parent c00e09f commit af097a7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
- name: Install dependencies
run: sudo ./install_dependencies_ubuntu.sh

- name: Run tests
- name: Run low-level unittests
run: python3 -m unittest

- name: Run high-level tests on example config
run: sudo ./example-config/run_tests.py


14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Kastenwesen ╰[°‿°]╯

[![Build Status](https://travis-ci.org/fau-fablab/kastenwesen.svg?branch=master)](https://travis-ci.org/fau-fablab/kastenwesen)

A python script for managing multiple docker containers on a server.
A python script for managing multiple docker containers on a server. Roughly equivalent to a simplified version of docker-compose, plus status monitoring and automatic rebuilds on security updates.

Imagine your server has multiple services that you want to separate and manage using docker.

Expand All @@ -12,7 +10,7 @@ Imagine your server has multiple services that you want to separate and manage u
- You still understand what this script is doing, because all executed docker commands are shown in the output. You could always run these yourself if something goes wrong.
- If there is a security update for a package that some of your containers depend on, simply run ``kastenwesen rebuild --no-cache``, so that docker's cache is not used and the fresh package is downloaded.

Even more is possible: You can use kastenwesen inside a VM, or even on travis.org, to test your server config before it goes live.
Even more is possible: You can use kastenwesen inside a VM, or even in a CI pipeline, to test your server config before it goes live.

# Testing it inside a vagrant VM

Expand Down Expand Up @@ -42,7 +40,11 @@ curl localhost

# Continuous integration

For travis-ci, a demo .travis.yml file is provided. You at least want to run `kastenwesen rebuild` in your CI build.
If you want to check your server config in CI before deploying, you can find some notes in this section.

You at least want to run `kastenwesen rebuild` in your CI build, wait some time (depending on the configured startup gracetime) and then check `kastenwesen status`.

As a starting point for using GitHub actions, see the CI files .github/ in this repository.

Because of docker, the build needs root privilege. If you want to use Vagrant in a custom CI setup or for developer testing to ensure that your config is correct before going into production, a sample Vagrantfile and kastenwesen_vagrant_test_build.py build script are provided.
Because of docker and of permissions for the status directory /var/lib/kastenwesen, the build needs root privilege. If you want to use Vagrant in a custom CI setup or for developer testing to ensure that your config is correct before going into production, a sample Vagrantfile and kastenwesen_vagrant_test_build.py build script are provided.

7 changes: 0 additions & 7 deletions example-config/kastenwesen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@

disable_auto_upgrade = True

travis = False
if os.environ.get("TRAVIS"):
print("\nHey Travis, nice to see you. I will progress slowly for you, so my tests won't fail.\n")
travis = True
STARTUP_GRACETIME = 5
TCP_TIMEOUT = 20
HTTP_TIMEOUT = 30

#########################################
# my_linux_base #
Expand Down
8 changes: 2 additions & 6 deletions example-config/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@

script_dir = os.path.dirname(os.path.realpath(__file__))

EXTRA_SLEEP = 0
if os.environ.get("TRAVIS"):
print("\nOh hi Travis, how are you? I will go slowly on your machines in order to prevent failing tests.\n")
travis = True
EXTRA_SLEEP = 5

# extra sleep time in seconds. Must be higher than DEFAULT_STARTUP_GRACETIME. Some extra time can be helpful to work around race-condition bugs in the docker daemon.
EXTRA_SLEEP = 3

def diagnostics():
# extra diagnostics output at each build step
Expand Down

0 comments on commit af097a7

Please sign in to comment.