v1.6.3 Merge
v1.6.3 Merge
This commit is contained in:
commit
596af5c723
9 changed files with 159 additions and 17 deletions
28
.travis.yml
28
.travis.yml
|
@ -1,15 +1,17 @@
|
||||||
|
sudo: true
|
||||||
|
dist: xenial
|
||||||
|
language: minimal
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
addons:
|
||||||
jobs:
|
apt:
|
||||||
include:
|
packages:
|
||||||
- stage: "Build and Push"
|
- docker-ce
|
||||||
script:
|
branches:
|
||||||
- docker build -t boerderij/varken:$TRAVIS_BRANCH .
|
only:
|
||||||
- docker images
|
- master
|
||||||
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
deploy:
|
||||||
- docker push boerderij/varken:$TRAVIS_BRANCH
|
- provider: script
|
||||||
|
script: bash deploy.sh
|
||||||
env:
|
on:
|
||||||
global:
|
branch: master
|
||||||
- secure: c91+zQXN28Anr2q94vhJAzN36teKovgniNmUI0MaejYfwcShN8TVeojkxbP+AxZuvGh1AfvB26LQeuPqAAntoNxvtPg3PLxv93rRSkAf0jk9apm9biYDAJNAM3OSiqCGfzfNhtUHmPmybRy2UmRXpHc6ZU1GmOdX2yyXCC2S6wjJOGabRpCA2Lw1vNnQuSJMDZ78amybZNmqAkK+rxe9hH2TGwcSImW8dlW2Ryt8H4a2s9VW9rbebQF+PzY4pw+OlIarpVUXZzUyEq8PS2EmJTuhrNA+RtZWJ4yRZ33jK4UqZRJzfC4FniZzSqtV/P3YGgSFNzhM87y5VhNiauX6QmtIDfLUV6c86cWCy24O41SrAJQOi4CLszJVkYfyggVFoRFegNS2+njN+f2Bbbx3rHtmNds0cDSfFuK3XhtTe0EhNgHLXOCX4IyAGzYWO+afmbqm/8S+m/QjCT28+0GgxYSqD2qO3FuPRA7woWucrKl2xa/tYikkurkDif0yBHxPac8mB8KLPLrjGzHlBG6SYYpTlpjWJrddbYhm0EZVmMkkFHRHLcOK8AOHKQipQBHmP+wvTGouwaZ8Uv5+uDNZ76st4BZR1tfXCtZ6A0RLRspo0wJ5EKlrNr8OIQGdj1G4TJ0H029mycqkAQ5yFPlvF/wAZ0shVFb/uMejpQw+2ks=
|
|
||||||
|
|
17
CHANGELOG.md
17
CHANGELOG.md
|
@ -1,5 +1,20 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [v1.6.3](https://github.com/Boerderij/Varken/tree/v1.6.3) (2019-01-16)
|
||||||
|
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.6.2...v1.6.3)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- \[Feature Request\] ARM, ARMHF and ARM64 Docker Images [\#71](https://github.com/Boerderij/Varken/issues/71)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- \[BUG\] Newer influxdb has timeouts and connection errors [\#93](https://github.com/Boerderij/Varken/issues/93)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- v1.6.3 Merge [\#94](https://github.com/Boerderij/Varken/pull/92) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
|
||||||
|
|
||||||
## [v1.6.2](https://github.com/Boerderij/Varken/tree/v1.6.2) (2019-01-12)
|
## [v1.6.2](https://github.com/Boerderij/Varken/tree/v1.6.2) (2019-01-12)
|
||||||
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.6.1...v1.6.2)
|
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.6.1...v1.6.2)
|
||||||
|
|
||||||
|
@ -9,7 +24,7 @@
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- v1.6.2 Merge [\#90](https://github.com/Boerderij/Varken/pull/92) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
|
- v1.6.2 Merge [\#92](https://github.com/Boerderij/Varken/pull/92) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
|
||||||
|
|
||||||
## [v1.6.1](https://github.com/Boerderij/Varken/tree/v1.6.1) (2019-01-12)
|
## [v1.6.1](https://github.com/Boerderij/Varken/tree/v1.6.1) (2019-01-12)
|
||||||
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.6...v1.6.1)
|
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.6...v1.6.1)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM lsiobase/alpine.python3
|
FROM amd64/python:3.7.2-alpine
|
||||||
|
|
||||||
LABEL maintainers="dirtycajunrice,samwiseg0"
|
LABEL maintainers="dirtycajunrice,samwiseg0"
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@ ENV DEBUG="False"
|
||||||
|
|
||||||
COPY / /app
|
COPY / /app
|
||||||
|
|
||||||
|
COPY /tmp/qemu-arm-static /usr/bin/qemu-arm-static
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
python3 -m pip install -r /app/requirements.txt && \
|
python3 -m pip install -r /app/requirements.txt && \
|
||||||
chown -R abc:abc \
|
chown -R abc:abc \
|
||||||
|
|
21
Dockerfile.arm
Normal file
21
Dockerfile.arm
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
FROM arm32v6/python:3.7.2-alpine
|
||||||
|
|
||||||
|
LABEL maintainers="dirtycajunrice,samwiseg0"
|
||||||
|
|
||||||
|
ENV DEBUG="False"
|
||||||
|
|
||||||
|
COPY / /app
|
||||||
|
|
||||||
|
COPY /tmp/qemu-arm-static /usr/bin/qemu-arm-static
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
python3 -m pip install -r /app/requirements.txt && \
|
||||||
|
chown -R abc:abc \
|
||||||
|
/config \
|
||||||
|
/app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
CMD cp /app/data/varken.example.ini /config/varken.example.ini && python3 /app/Varken.py --data-folder /config
|
||||||
|
|
||||||
|
VOLUME /config
|
21
Dockerfile.arm64
Normal file
21
Dockerfile.arm64
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
FROM arm64v8/python:3.7.2-alpine
|
||||||
|
|
||||||
|
LABEL maintainers="dirtycajunrice,samwiseg0"
|
||||||
|
|
||||||
|
ENV DEBUG="False"
|
||||||
|
|
||||||
|
COPY / /app
|
||||||
|
|
||||||
|
COPY /tmp/qemu-arm-static /usr/bin/qemu-arm-static
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
python3 -m pip install -r /app/requirements.txt && \
|
||||||
|
chown -R abc:abc \
|
||||||
|
/config \
|
||||||
|
/app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
CMD cp /app/data/varken.example.ini /config/varken.example.ini && python3 /app/Varken.py --data-folder /config
|
||||||
|
|
||||||
|
VOLUME /config
|
21
Dockerfile.armhf
Normal file
21
Dockerfile.armhf
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
FROM arm32v7/python:3.7.2-slim
|
||||||
|
|
||||||
|
LABEL maintainers="dirtycajunrice,samwiseg0"
|
||||||
|
|
||||||
|
ENV DEBUG="False"
|
||||||
|
|
||||||
|
COPY / /app
|
||||||
|
|
||||||
|
COPY /tmp/qemu-arm-static /usr/bin/qemu-arm-static
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
python3 -m pip install -r /app/requirements.txt && \
|
||||||
|
chown -R abc:abc \
|
||||||
|
/config \
|
||||||
|
/app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
CMD cp /app/data/varken.example.ini /config/varken.example.ini && python3 /app/Varken.py --data-folder /config
|
||||||
|
|
||||||
|
VOLUME /config
|
54
deploy.sh
Normal file
54
deploy.sh
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
VERSION="$(grep -i version varken.__init__.py | cut -d' ' -f3 | tr -d \")"
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
GITHUB_USER='dirtycajunrice'
|
||||||
|
DOCKER_USER='dirtycajunrice'
|
||||||
|
PROJECT='varken'
|
||||||
|
NAMESPACE="boerderij/${PROJECT}"
|
||||||
|
|
||||||
|
# Docker experimental config
|
||||||
|
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
|
||||||
|
[[ -d ~/.docker ]] || mkdir ~/.docker
|
||||||
|
[[ -f ~/.docker/config.json ]] || touch ~/.docker/config.json
|
||||||
|
echo '{"experimental":"enabled"}' | sudo tee ~/.docker/config.json
|
||||||
|
sudo service docker restart
|
||||||
|
|
||||||
|
# Auth
|
||||||
|
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USER" --password-stdin
|
||||||
|
|
||||||
|
# Latest x64
|
||||||
|
docker build -t "${NAMESPACE}:latest" . && \
|
||||||
|
docker push "${NAMESPACE}:latest" && \
|
||||||
|
# Versioned x64
|
||||||
|
docker tag "${NAMESPACE}:latest" "${NAMESPACE}:${VERSION}" && \
|
||||||
|
docker push "${NAMESPACE}:${VERSION}" && \
|
||||||
|
# x64 Arch
|
||||||
|
docker tag "${NAMESPACE}:latest" "${NAMESPACE}:latest-amd64" && \
|
||||||
|
docker push "${NAMESPACE}:latest-amd64"
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# ARM images
|
||||||
|
for i in $(ls *arm*); do
|
||||||
|
arch="$(echo ${i} | cut -d. -f2)"
|
||||||
|
# Latest
|
||||||
|
docker build -f "./Dockerfile.${arch}" -t "${NAMESPACE}:latest-${arch}" . && \
|
||||||
|
docker push "${NAMESPACE}:latest-${arch}" && \
|
||||||
|
# Versioned
|
||||||
|
docker tag "${NAMESPACE}:latest-${arch}" "${NAMESPACE}:${VERSION}-${arch}" && \
|
||||||
|
docker push "${NAMESPACE}:${VERSION}-${arch}"
|
||||||
|
done
|
||||||
|
|
||||||
|
wget -O manifest-tool https://github.com/estesp/manifest-tool/releases/download/v0.9.0/manifest-tool-linux-amd64 && \
|
||||||
|
chmod +x manifest-tool && \
|
||||||
|
python3 manifest_generator.py && \
|
||||||
|
./manifest-tool --username "$DOCKER_USER" --password "$DOCKER_PASSWORD" push from-spec ".manifest.yaml"
|
||||||
|
# Git tags
|
||||||
|
git remote set-url origin "https://${GITHUB_USER}:${GITHUB_API_KEY}@github.com/${NAMESPACE}.git" && \
|
||||||
|
git tag "${VERSION}" && \
|
||||||
|
git push --tags
|
|
@ -1,2 +1,2 @@
|
||||||
VERSION = "1.6.2"
|
VERSION = "1.6.3"
|
||||||
BRANCH = 'master'
|
BRANCH = 'master'
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from influxdb import InfluxDBClient
|
from influxdb import InfluxDBClient
|
||||||
|
from requests.exceptions import ConnectionError
|
||||||
|
from influxdb.exceptions import InfluxDBServerError
|
||||||
|
|
||||||
|
|
||||||
class DBManager(object):
|
class DBManager(object):
|
||||||
|
@ -21,4 +23,8 @@ class DBManager(object):
|
||||||
def write_points(self, data):
|
def write_points(self, data):
|
||||||
d = data
|
d = data
|
||||||
self.logger.debug('Writing Data to InfluxDB %s', d)
|
self.logger.debug('Writing Data to InfluxDB %s', d)
|
||||||
self.influx.write_points(d)
|
try:
|
||||||
|
self.influx.write_points(d)
|
||||||
|
except (InfluxDBServerError, ConnectionError) as e:
|
||||||
|
self.logger.error('Error writing data to influxdb. Dropping this set of data. '
|
||||||
|
'Check your database! Error: %s', e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue