Skip to content

Commit

Permalink
v1.6.3 Merge
Browse files Browse the repository at this point in the history
v1.6.3 Merge
  • Loading branch information
dirtycajunrice authored Jan 16, 2019
2 parents cae34c1 + e9ba258 commit b99b59f
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 17 deletions.
28 changes: 15 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
sudo: true
dist: xenial
language: minimal
services:
- docker

jobs:
include:
- stage: "Build and Push"
script:
- docker build -t boerderij/varken:$TRAVIS_BRANCH .
- docker images
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push boerderij/varken:$TRAVIS_BRANCH

env:
global:
- secure: c91+zQXN28Anr2q94vhJAzN36teKovgniNmUI0MaejYfwcShN8TVeojkxbP+AxZuvGh1AfvB26LQeuPqAAntoNxvtPg3PLxv93rRSkAf0jk9apm9biYDAJNAM3OSiqCGfzfNhtUHmPmybRy2UmRXpHc6ZU1GmOdX2yyXCC2S6wjJOGabRpCA2Lw1vNnQuSJMDZ78amybZNmqAkK+rxe9hH2TGwcSImW8dlW2Ryt8H4a2s9VW9rbebQF+PzY4pw+OlIarpVUXZzUyEq8PS2EmJTuhrNA+RtZWJ4yRZ33jK4UqZRJzfC4FniZzSqtV/P3YGgSFNzhM87y5VhNiauX6QmtIDfLUV6c86cWCy24O41SrAJQOi4CLszJVkYfyggVFoRFegNS2+njN+f2Bbbx3rHtmNds0cDSfFuK3XhtTe0EhNgHLXOCX4IyAGzYWO+afmbqm/8S+m/QjCT28+0GgxYSqD2qO3FuPRA7woWucrKl2xa/tYikkurkDif0yBHxPac8mB8KLPLrjGzHlBG6SYYpTlpjWJrddbYhm0EZVmMkkFHRHLcOK8AOHKQipQBHmP+wvTGouwaZ8Uv5+uDNZ76st4BZR1tfXCtZ6A0RLRspo0wJ5EKlrNr8OIQGdj1G4TJ0H029mycqkAQ5yFPlvF/wAZ0shVFb/uMejpQw+2ks=
addons:
apt:
packages:
- docker-ce
branches:
only:
- master
deploy:
- provider: script
script: bash deploy.sh
on:
branch: master
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# 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)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.6.1...v1.6.2)

Expand All @@ -9,7 +24,7 @@

**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)
[Full Changelog](https://github.com/Boerderij/Varken/compare/v1.6...v1.6.1)
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM lsiobase/alpine.python3
FROM amd64/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 \
Expand Down
21 changes: 21 additions & 0 deletions Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -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 changes: 21 additions & 0 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -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 changes: 21 additions & 0 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -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 changes: 54 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion varken/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = "1.6.2"
VERSION = "1.6.3"
BRANCH = 'master'
8 changes: 7 additions & 1 deletion varken/dbmanager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from logging import getLogger
from influxdb import InfluxDBClient
from requests.exceptions import ConnectionError
from influxdb.exceptions import InfluxDBServerError


class DBManager(object):
Expand All @@ -21,4 +23,8 @@ def __init__(self, server):
def write_points(self, data):
d = data
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)

0 comments on commit b99b59f

Please sign in to comment.