summaryrefslogtreecommitdiffstats
path: root/docker/storperf-master/Dockerfile
blob: a70e21ebb2e9d56bf3f73973150ac808b7a49c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
##############################################################################
# Copyright (c) 2015 EMC and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
#   Docker container for STORPERF
#
# Purpose: docker image for Storperf project
#
# Maintained by Jose Lausuch, Mark Beierl
# Build:
#    $ docker build -t opnfv/storperf-master:tag .
#

FROM alpine:3.5 as fio-builder

LABEL version="5.0" description="OPNFV Storperf Docker container"

ARG BRANCH=master

ENV repos_dir /home/opnfv/repos

RUN apk --no-cache add --update \
    python-dev \
    git \
    alpine-sdk \
    linux-headers \
    libaio \
    libaio-dev \
    zlib-dev

# Third party git fetches

RUN git config --global http.sslVerify false
RUN git clone http://git.kernel.dk/fio.git ${repos_dir}/fio
RUN cd ${repos_dir}/fio && git checkout tags/fio-2.2.10
RUN cd ${repos_dir}/fio && EXTFLAGS="-static" make install

# StorPerf Master Builder

FROM alpine:3.5 as storperf-builder

RUN apk --no-cache add --update \
    libffi-dev \
    libressl-dev \
    python \
    py-pip \
    python-dev \
    alpine-sdk \
    linux-headers \
    bash

# Install StorPerf

COPY requirements.pip /storperf/
RUN pip install --upgrade setuptools==33.1.1
RUN pip install -r /storperf/requirements.pip

# Build stripped down StorPerf image

FROM alpine:3.5 as storperf-master

RUN apk --no-cache add --update \
    python \
    bash

COPY --from=storperf-builder /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages
COPY --from=fio-builder /usr/local/bin/fio /usr/local/bin/fio
COPY . /storperf

WORKDIR /storperf
RUN chmod 600 storperf/resources/ssh/storperf_rsa

# ReST API

EXPOSE 5000

# Install Graphite
# Everything from here down will be removed once Graphite/Carbon gets broken
# out into its own container.

RUN apk --no-cache add --update \
    python \
    py-pip \
    python-dev \
    alpine-sdk \
    py-tz \
    nginx \
    cairo \
    supervisor

RUN deluser xfs

RUN pip install \
    gunicorn==17.5 \
    Django==1.6.11 \
    django-tagging==0.3.1 \
    cairocffi \
    constants \
    zope.interface

RUN adduser -S -g www-data -u 33 www-data

RUN pip install whisper==0.9.15
RUN pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/lib" carbon==0.9.15
RUN pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/webapp" graphite-web==0.9.15

ADD graphite/nginx.conf /etc/nginx/nginx.conf
ADD graphite/local_settings.py /var/lib/graphite/webapp/graphite/local_settings.py
ADD graphite/carbon.conf /var/lib/graphite/conf/carbon.conf
ADD graphite/storage-schemas.conf /var/lib/graphite/conf/storage-schemas.conf
RUN mkdir -p /opt/graphite/storage
RUN ln -s /var/lib/graphite/storage/whisper /opt/graphite/storage/whisper
RUN touch /var/lib/graphite/storage/graphite.db /var/lib/graphite/storage/index
RUN chown -R www-data /var/lib/graphite/storage
RUN chmod 0775 /var/lib/graphite/storage /var/lib/graphite/storage/whisper
RUN chmod 0664 /var/lib/graphite/storage/graphite.db

RUN cd /var/lib/graphite/webapp/graphite && python manage.py syncdb --noinput
ADD graphite/initial_data.json /var/lib/graphite/webapp/graphite/initial_data.json
RUN cd /var/lib/graphite/webapp/graphite && python manage.py syncdb --noinput

RUN mkdir -p /var/log/supervisor

COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf

EXPOSE 8000

# Entry point

CMD ["/usr/bin/supervisord"]