Skip to content

Commit

Permalink
v1.0.0 Merge
Browse files Browse the repository at this point in the history
v1.0.0 Merge
  • Loading branch information
dirtycajunrice authored Jan 23, 2019
2 parents b14186a + 8108846 commit 0354c2c
Show file tree
Hide file tree
Showing 20 changed files with 152 additions and 160 deletions.
10 changes: 0 additions & 10 deletions .dockerignore

This file was deleted.

2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ addons:
- docker-ce

script:
- pip install flake8 && flake8 *.py pyouroboros/
- python3 ./ouroboros -i 1 -l debug --run-once
- pip install flake8 && flake8 --max-line-length 120 *.py pyouroboros/
- python3 ./ouroboros -l debug --run-once

deploy:
- provider: pypi
Expand Down
39 changes: 37 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
# Change Log

## [0.6.0](https://github.com/pyouroboros/ouroboros/tree/0.6.0) (2019-01-16)
## [1.0.0](https://github.com/pyouroboros/ouroboros/tree/1.0.0) (2019-01-22)
[Full Changelog](https://github.com/pyouroboros/ouroboros/compare/0.6.0...1.0.0)

**Implemented enhancements:**

- Stop containers with alternate signal [\#107](https://github.com/pyouroboros/ouroboros/issues/107)
- Docker Socket secure connections [\#105](https://github.com/pyouroboros/ouroboros/issues/105)
- Selectively monitor containers with label [\#104](https://github.com/pyouroboros/ouroboros/issues/104)
- Allow stop-signal label [\#133](https://github.com/pyouroboros/ouroboros/pull/133) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- Docker TLS Verify option [\#132](https://github.com/pyouroboros/ouroboros/pull/132) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- add label priority feature for watch/ignore. Addresses \#104 [\#121](https://github.com/pyouroboros/ouroboros/pull/121) ([DirtyCajunRice](https://github.com/DirtyCajunRice))

**Fixed bugs:**

- Unexpected docker API causes program to quit ‘500 Server Error: Internal Server Error’ [\#130](https://github.com/pyouroboros/ouroboros/issues/130)
- Error tag handling under the registry with port [\#129](https://github.com/pyouroboros/ouroboros/issues/129)
- a fatal error when none tag image [\#122](https://github.com/pyouroboros/ouroboros/issues/122)
- Bug/ignore logic [\#135](https://github.com/pyouroboros/ouroboros/pull/135) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- Bug/registry logic [\#131](https://github.com/pyouroboros/ouroboros/pull/131) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- catch no tags in get\_running [\#124](https://github.com/pyouroboros/ouroboros/pull/124) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- fixed logic for latest vs develop, and added -f to specify file [\#119](https://github.com/pyouroboros/ouroboros/pull/119) ([DirtyCajunRice](https://github.com/DirtyCajunRice))

**Closed issues:**

- Missing docker-compose.yml from documentation [\#120](https://github.com/pyouroboros/ouroboros/issues/120) [[documentation](https://github.com/pyouroboros/ouroboros/labels/documentation)]
- Wiki usage docs reference old argument names [\#115](https://github.com/pyouroboros/ouroboros/issues/115) [[documentation](https://github.com/pyouroboros/ouroboros/labels/documentation)]

**Other Pull Requests**

- v1.0.0 to develop [\#136](https://github.com/pyouroboros/ouroboros/pull/136) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- v1.0.0 Merge [\#137](https://github.com/pyouroboros/ouroboros/pull/137) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- Clean old legacy files [\#134](https://github.com/pyouroboros/ouroboros/pull/134) [[cleanup](https://github.com/pyouroboros/ouroboros/labels/cleanup)] ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- Cleanup/qemu logic [\#128](https://github.com/pyouroboros/ouroboros/pull/128) [[cleanup](https://github.com/pyouroboros/ouroboros/labels/cleanup)] ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- fix readme wording for monitoring remote hosts [\#126](https://github.com/pyouroboros/ouroboros/pull/126) [[documentation](https://github.com/pyouroboros/ouroboros/labels/documentation)] ([circa10a](https://github.com/circa10a))

## [0.6.0](https://github.com/pyouroboros/ouroboros/tree/0.6.0) (2019-01-17)
[Full Changelog](https://github.com/pyouroboros/ouroboros/compare/0.5.0...0.6.0)

**Implemented enhancements:**
Expand All @@ -26,8 +61,8 @@

**Other Pull Requests**

- Master Merge v0.6.0 [\#117](https://github.com/pyouroboros/ouroboros/pull/117) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- v0.6.0 to develop [\#118](https://github.com/pyouroboros/ouroboros/pull/118) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- v0.6.0 Merge [\#117](https://github.com/pyouroboros/ouroboros/pull/117) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- add changelog formatting and fix all labels going back to 1 [\#116](https://github.com/pyouroboros/ouroboros/pull/116) [[documentation](https://github.com/pyouroboros/ouroboros/labels/documentation)] ([DirtyCajunRice](https://github.com/DirtyCajunRice))

## [0.5.0](https://github.com/pyouroboros/ouroboros/tree/0.5.0) (2019-01-13)
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ FROM amd64/python:3.7.2-alpine

LABEL maintainers="dirtycajunrice,circa10a,tkdeviant"

COPY / /app

WORKDIR /app

COPY /requirements.txt /setup.py /ouroboros /README.md /app/

COPY /pyouroboros /app/pyouroboros

RUN apk add --no-cache tzdata && \
pip install --no-cache-dir .

Expand Down
8 changes: 5 additions & 3 deletions Dockerfile.arm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ FROM arm32v6/python:3.7.2-alpine

LABEL maintainers="dirtycajunrice,circa10a,tkdeviant"

COPY / /app
WORKDIR /app

COPY /tmp/qemu-arm-static /usr/bin/qemu-arm-static
COPY /qemu-arm-static /usr/bin/qemu-arm-static

WORKDIR /app
COPY /requirements.txt /setup.py /ouroboros /README.md /app/

COPY /pyouroboros /app/pyouroboros

RUN apk add --no-cache tzdata && \
pip install --no-cache-dir .
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ FROM arm64v8/python:3.7.2-alpine

LABEL maintainers="dirtycajunrice,circa10a,tkdeviant"

COPY / /app
WORKDIR /app

COPY /tmp/qemu-aarch64-static /usr/bin/qemu-aarch64-static
COPY /qemu-aarch64-static /usr/bin/qemu-aarch64-static

WORKDIR /app
COPY /requirements.txt /setup.py /ouroboros /README.md /app/

COPY /pyouroboros /app/pyouroboros

RUN apk add --no-cache tzdata && \
pip install --no-cache-dir .
Expand Down
13 changes: 0 additions & 13 deletions Dockerfile.armhf

This file was deleted.

39 changes: 7 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<img width="800" src="https://bin.cajun.pro/images/ouroboros/ouroboros_logo_primary_long_cropped.jpg">

[![Discord](https://img.shields.io/badge/Discord-Ouroboros-7289DA.svg?logo=discord&style=flat-square)](https://discord.gg/qHNByUW)
[![Discord](https://img.shields.io/discord/532695326117593112.svg?colorB=7289DA&label=Discord&logo=Discord&logoColor=7289DA&style=flat-square)](https://discord.gg/qHNByUW)
[![BuyUsCoffee](https://img.shields.io/badge/BuyMeACoffee-Donate-ff813f.svg?logo=CoffeeScript&style=flat-square)](https://buymeacoff.ee/ouroboros)
[![Travis](https://img.shields.io/travis/pyouroboros/ouroboros/master.svg?style=flat-square)](https://travis-ci.org/pyouroboros/ouroboros)
[![Image Version](https://images.microbadger.com/badges/version/pyouroboros/ouroboros.svg)](https://hub.docker.com/r/pyouroboros/ouroboros/)
[![Release](https://img.shields.io/github/release/pyouroboros/ouroboros.svg?style=flat-square)](https://hub.docker.com/r/pyouroboros/ouroboros/)
[![Pypi Downloads](https://img.shields.io/pypi/dm/ouroboros-cli.svg?style=flat-square)](https://pypi.org/project/ouroboros-cli/)
[![Python Version](https://img.shields.io/pypi/pyversions/ouroboros-cli.svg?style=flat-square)](https://pypi.org/project/ouroboros-cli/)
[![Docker Pulls](https://img.shields.io/docker/pulls/pyouroboros/ouroboros.svg?style=flat-square)](https://hub.docker.com/r/pyouroboros/ouroboros/)
[![Layers](https://images.microbadger.com/badges/image/pyouroboros/ouroboros.svg)](https://microbadger.com/images/pyouroboros/ouroboros)
[![Layers](https://images.microbadger.com/badges/image/pyouroboros/ouroboros.svg)](https://microbadger.com/images/pyouroboros/ouroboros)

Automatically update your running Docker containers to the latest available image.

A python-based alternative to [watchtower](https://github.com/v2tec/watchtower)
A python-based successor to [watchtower](https://github.com/v2tec/watchtower)

## Overview

Expand All @@ -38,7 +38,7 @@ docker run -d --name ouroboros \
pyouroboros/ouroboros
```

> This is image is compatible for amd64, arm32v7, and arm64v8 CPU architectures (regular systems and Raspberry Pi's)
> This is image is compatible for amd64, arm32, and arm64 CPU architectures
or via `docker-compose`:

Expand All @@ -61,33 +61,8 @@ $ ouroboros --interval 300 --loglevel debug
> This can be useful if you would like to create a `systemd` service or similar daemon that doesn't run in a container
## Examples

### Monitor for updates for latest tag
Instead of updating to your original image tag you can specify if you would like Ouroboros to update all containers to `latest`.
e.g. If your container was started with `nginx:1.14-alpine` using `LATEST=true` will poll the docker registry and compare digests. If there is a new image for `nginx:latest`, ouroboros will update your container using the newly patched version.
> Default is `false`
```bash
docker run -d --name ouroboros \
-v /var/run/docker.sock:/var/run/docker.sock \
-e LATEST=true \
pyouroboros/ouroboros
```

### Update containers on a remote host

Ouroboros can monitor things other than just local, pass the `--url` argument to update a system with the Docker API exposed.

> Default is unix://var/run/docker.sock
```bash
docker run -d --name ouroboros \
-v /var/run/docker.sock:/var/run/docker.sock \
-e DOCKER_SOCKETS=tcp://my-remote-docker-server:2376 \
pyouroboros/ouroboros
```

Many more examples are located in our wiki on the [usage page](https://github.com/pyouroboros/ouroboros/wiki/Usage)
Per-command and scenario examples can be found in the [wiki](https://github.com/pyouroboros/ouroboros/wiki/Usage)

## Contributing

All welcome
All contributions are welcome! Contributing guidelines are in the works
39 changes: 11 additions & 28 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USER" --password-stdin

# Prepare QEMU for ARM builds
docker run --rm --privileged multiarch/qemu-user-static:register --reset
wget -P tmp/ "https://github.com/multiarch/qemu-user-static/releases/download/v3.1.0-2/qemu-aarch64-static"
wget -P tmp/ "https://github.com/multiarch/qemu-user-static/releases/download/v3.1.0-2/qemu-arm-static"
chmod +x tmp/qemu-aarch64-static tmp/qemu-arm-static
bash prebuild.sh
chmod +x qemu-aarch64-static qemu-arm-static

# Set tag based off of branch
if [[ "$BRANCH" == "latest" ]]; then
Expand All @@ -48,44 +47,28 @@ docker build -t "${REPOSITORY}:${TAG}-amd64" . && \
docker push "${REPOSITORY}:${TAG}-amd64"

# Create Initial Manifests
docker manifest create "${REPOSITORY}:${BRANCH}" "${REPOSITORY}:${BRANCH}-amd64"
docker manifest create "${REPOSITORY}:${TAG}" "${REPOSITORY}:${TAG}-amd64"
if [[ "$BRANCH" == "latest" ]]; then
docker manifest create "${REPOSITORY}:${TAG}" "${REPOSITORY}:${TAG}-amd64"
docker manifest create "${REPOSITORY}:${BRANCH}" "${REPOSITORY}:${TAG}-amd64"
fi

# ARM variants
for i in $(ls *arm*); do
ARCH="$(echo ${i} | cut -d. -f2)"
docker build -t "${REPOSITORY}:${TAG}-${ARCH}" . && \
docker build -f "Dockerfile.${ARCH}" -t "${REPOSITORY}:${TAG}-${ARCH}" . && \
docker push "${REPOSITORY}:${TAG}-${ARCH}"
# Add variant to manifest
docker manifest create -a "${REPOSITORY}:${BRANCH}" "${REPOSITORY}:${BRANCH}-${ARCH}"
docker manifest create -a "${REPOSITORY}:${TAG}" "${REPOSITORY}:${TAG}-${ARCH}"
if [[ "$BRANCH" == "latest" ]]; then
docker manifest create -a "${REPOSITORY}:${TAG}" "${REPOSITORY}:${TAG}-${ARCH}"
fi
if [[ "$ARCH" == "arm64" ]]; then
docker manifest annotate "${REPOSITORY}:${BRANCH}" "${REPOSITORY}:${BRANCH}-${ARCH}" --variant v8 --arch arm64
if [[ "$BRANCH" == "latest" ]]; then
docker manifest annotate "${REPOSITORY}:${TAG}" "${REPOSITORY}:${TAG}-${ARCH}" --variant v8 --arch arm64
fi
elif [[ "$ARCH" == "armhf" ]]; then
docker manifest annotate "${REPOSITORY}:${BRANCH}" "${REPOSITORY}:${BRANCH}-${ARCH}" --variant v7 --arch arm
if [[ "$BRANCH" == "latest" ]]; then
docker manifest annotate "${REPOSITORY}:${TAG}" "${REPOSITORY}:${TAG}-${ARCH}" --variant v7 --arch arm
fi
elif [[ "$ARCH" == "arm" ]]; then
docker manifest annotate "${REPOSITORY}:${BRANCH}" "${REPOSITORY}:${BRANCH}-${ARCH}" --variant v6 --arch arm
if [[ "$BRANCH" == "latest" ]]; then
docker manifest annotate "${REPOSITORY}:${TAG}" "${REPOSITORY}:${TAG}-${ARCH}" --variant v6 --arch arm
fi
docker manifest create -a "${REPOSITORY}:${BRANCH}" "${REPOSITORY}:${TAG}-${ARCH}"
fi
done

docker manifest inspect "${REPOSITORY}:${BRANCH}" && \
docker manifest push "${REPOSITORY}:${BRANCH}"
docker manifest inspect "${REPOSITORY}:${TAG}" && \
docker manifest push "${REPOSITORY}:${TAG}"
if [[ "$BRANCH" == "latest" ]]; then
docker manifest inspect "${REPOSITORY}:${TAG}" && \
docker manifest push "${REPOSITORY}:${TAG}"
docker manifest inspect "${REPOSITORY}:${BRANCH}" && \
docker manifest push "${REPOSITORY}:${BRANCH}"
fi

# Git tags
Expand Down
9 changes: 0 additions & 9 deletions dev-environment.yml

This file was deleted.

14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'
services:
ouroboros:
container_name: ouroboros
hostname: ouroboros
image: pyouroboros/ouroboros
environment:
- CLEANUP=true
- INTERVAL=300
- LOG_LEVEL=info
- SELF_UPDATE=true
- IGNORE=mongo influxdb postgres mariadb
- TZ=America/Chicago
restart: unless-stopped
8 changes: 0 additions & 8 deletions environment.yml

This file was deleted.

3 changes: 3 additions & 0 deletions prebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
wget -q "https://github.com/multiarch/qemu-user-static/releases/download/v3.1.0-2/qemu-aarch64-static"
wget -q "https://github.com/multiarch/qemu-user-static/releases/download/v3.1.0-2/qemu-arm-static"
2 changes: 1 addition & 1 deletion pyouroboros/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = "0.6.0"
VERSION = "1.0.0"
BRANCH = "master"
6 changes: 4 additions & 2 deletions pyouroboros/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ class Config(object):
'INFLUX_URL', 'INFLUX_PORT', 'INFLUX_USERNAME', 'INFLUX_PASSWORD', 'INFLUX_DATABASE', 'INFLUX_SSL',
'INFLUX_VERIFY_SSL', 'DATA_EXPORT', 'PUSHOVER_TOKEN', 'PUSHOVER_USER', 'PUSHOVER_DEVICE', 'SMTP_HOST',
'SMTP_PORT', 'SMTP_STARTTLS', 'SMTP_USERNAME', 'SMTP_PASSWORD', 'SMTP_RECIPIENTS', 'SMTP_FROM_EMAIL',
'SMTP_FROM_NAME', 'SELF_UPDATE']
'SMTP_FROM_NAME', 'SELF_UPDATE', 'LABEL_ENABLE', 'DOCKER_TLS_VERIFY']

interval = 300
docker_sockets = 'unix://var/run/docker.sock'
docker_tls_verify = False
monitor = []
ignore = []
data_export = None
Expand All @@ -20,6 +21,7 @@ class Config(object):
cleanup = False
run_once = False
self_update = False
label_enable = False

repo_user = None
repo_pass = None
Expand Down Expand Up @@ -93,7 +95,7 @@ def parse(self):
except ValueError as e:
print(e)
elif option in ['LATEST', 'CLEANUP', 'RUN_ONCE', 'INFLUX_SSL', 'INFLUX_VERIFY_SSL',
'SMTP_STARTTLS', 'SELF_UPDATE']:
'SMTP_STARTTLS', 'SELF_UPDATE', 'LABEL_ENABLE', 'DOCKER_TLS_VERIFY']:
if self.environment_vars[option].lower() == 'true':
setattr(self, option.lower(), True)
else:
Expand Down
Loading

0 comments on commit 0354c2c

Please sign in to comment.