Skip to content

Commit

Permalink
Use monasca/python for monasca/persister-python (#224)
Browse files Browse the repository at this point in the history
monasca/python provides a foundation for the Python
monasca components and several features & fixes that
concern and affects all Python applications.

!push monasca-persister-python
  • Loading branch information
kornicameister authored and matrixik committed Oct 4, 2017
1 parent 87d930a commit 0f1a078
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
23 changes: 8 additions & 15 deletions monasca-persister-python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM alpine:3.5
ARG PYTHON_VERSION
ARG TIMESTAMP_SLUG
FROM monasca/python:${PYTHON_VERSION}-${TIMESTAMP_SLUG}

ARG PERSISTER_REPO=https://github.com/openstack/monasca-persister.git
ARG PERSISTER_BRANCH="master"
ARG PERSISTER_BRANCH=master
ARG CONSTRAINTS_BRANCH=master

# To force a rebuild, pass --build-arg REBUILD="$(DATE)" when running
# `docker build`
Expand All @@ -23,19 +26,9 @@ ENV CONFIG_TEMPLATE=true \
INFLUX_PASSWORD=password \
INFLUX_DB=mon

RUN apk add --no-cache python py2-pip py2-jinja2 && \
apk add --no-cache --virtual build-dep \
python-dev git make g++ linux-headers && \
git clone \
--single-branch --depth=1 -b $PERSISTER_BRANCH \
$PERSISTER_REPO /monasca-persister && \
pip install influxdb && \
cd /monasca-persister && \
pip install -r requirements.txt && \
python setup.py install && \
cd / && \
rm -rf /monasca-persister && \
apk del build-dep
RUN /build.sh -r ${PERSISTER_REPO} -b ${PERSISTER_BRANCH} \
-q ${CONSTRAINTS_BRANCH} -d "influxdb Jinja2" && \
rm -rf /build.sh

COPY persister.conf.j2 /etc/monasca-persister/
COPY template.py start.sh kafka_wait_for_topics.py /
Expand Down
23 changes: 20 additions & 3 deletions monasca-persister-python/build.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
repository: monasca/persister
variants:
- tag: 1.5.0-python
- tag: 1.6.0-python
aliases:
- :latest
- :latest-python
- :1.6.0
- :1.6
- :1
- :1-python
args:
PERSISTER_BRANCH: 1.6.0
PYTHON_VERSION: '2'
TIMESTAMP_SLUG: 20170809-155207

- tag: 1.5.0-python
aliases:
- :1.5.0
- :1.5
- :1.5-python
- :1
- :1-python
args:
PERSISTER_BRANCH: 1.5.0
PYTHON_VERSION: '2'
TIMESTAMP_SLUG: 20170809-155207

- tag: ocata-python
aliases:
- :ocata
args:
PERSISTER_BRANCH: stable/ocata
PYTHON_VERSION: '2'
TIMESTAMP_SLUG: 20170809-155207
CONSTRAINTS_BRANCH: stable/ocata

- tag: master
aliases:
- :master-{date}-{time}
- :master-python
args:
PERSISTER_BRANCH: master
PYTHON_VERSION: '2'
TIMESTAMP_SLUG: 20170809-155207
CONSTRAINTS_BRANCH: master
3 changes: 1 addition & 2 deletions monasca-persister-python/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ else
cp /etc/monasca-persister/persister.conf.j2 /etc/monasca-persister/persister.conf
fi

python /usr/lib/python2.7/site-packages/monasca_persister/persister.py \
--config-file /etc/monasca-persister/persister.conf
monasca-persister --config-file /etc/monasca-persister/persister.conf

0 comments on commit 0f1a078

Please sign in to comment.