Skip to content

Commit

Permalink
Use monasca/python for monasca/api-python (#221)
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-api-python
  • Loading branch information
kornicameister authored and matrixik committed Oct 4, 2017
1 parent bf45be6 commit 29d077f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
24 changes: 9 additions & 15 deletions monasca-api-python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM alpine:3.5
ARG TIMESTAMP_SLUG
# monasca-api cannot run under Python3
# enforcing Python2
FROM monasca/python:2-${TIMESTAMP_SLUG}

ARG API_REPO=https://github.com/openstack/monasca-api.git
ARG API_BRANCH=master
ARG CONSTRAINTS_BRANCH=master

# To force a rebuild, pass --build-arg REBUILD="$(DATE)" when running
# `docker build`
Expand Down Expand Up @@ -34,20 +38,10 @@ ENV CONFIG_TEMPLATE=true \
ACCESS_LOG_FORMAT="%(asctime)s [%(process)d] gunicorn.access [%(levelname)s] %(message)s" \
ACCESS_LOG_FIELDS='%(h)s %(l)s %(u)s %(t)s %(r)s %(s)s %(b)s "%(f)s" "%(a)s" %(L)s'

RUN apk add --no-cache python py2-pip py2-jinja2 curl mysql-client && \
apk add --no-cache --virtual build-dep \
python-dev git make g++ linux-headers && \
mkdir /monasca-api && cd /monasca-api && \
git init && \
git remote add origin $API_REPO && \
git fetch origin $API_BRANCH && \
git reset --hard FETCH_HEAD && \
pip install --no-cache-dir gunicorn influxdb \
python-memcached -r requirements.txt && \
python setup.py install && \
cd / && \
rm -rf /monasca-api && \
apk del build-dep
COPY apk_install.sh /apk.sh
RUN /build.sh -r ${API_REPO} -b ${API_BRANCH} \
-q ${CONSTRAINTS_BRANCH} -d "gunicorn influxdb python-memcached Jinja2" && \
rm -rf /build.sh

COPY api-* /etc/monasca/
COPY template.py start.sh health-check.sh kafka_wait_for_topics.py /
Expand Down
4 changes: 4 additions & 0 deletions monasca-api-python/apk_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
install_apk_deps() {
apk add --no-cache curl mysql-client
apk add --no-cache --virtual build-dep git make g++ linux-headers
}
2 changes: 2 additions & 0 deletions monasca-api-python/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ variants:
- :master-{date}-{time}
args:
API_BRANCH: refs/changes/63/417163/10
CONSTRAINTS_BRANCH: master
TIMESTAMP_SLUG: 20170809-155207

0 comments on commit 29d077f

Please sign in to comment.