Creation of Local Docker for Daily Job 05/37305/4
authormbeierl <mark.beierl@dell.com>
Thu, 13 Jul 2017 01:41:01 +0000 (21:41 -0400)
committermbeierl <mark.beierl@dell.com>
Thu, 13 Jul 2017 01:50:39 +0000 (21:50 -0400)
Moves the dockerfiles for the different submodules/containers into
their respective directories.
Adds a docker compose file that can build the containers from the
local filesystem, and mounts the local filesystem as a volume,
making it easier for developer testing as local changes are
automatically reflected in the final container.

Change-Id: I2376034258cab2a3dc3a0d1ac3f01bbf5d1f59e7
JIRA: STORPERF-189
Signed-off-by: mbeierl <mark.beierl@dell.com>
13 files changed:
ci/launch_docker_container.sh
ci/remove_docker_container.sh
docker-compose/docker-compose.yaml
docker/graphite/local_settings.py [deleted file]
docker/local-docker-compose.yaml [new file with mode: 0644]
docker/storperf-httpfrontend/Dockerfile [moved from docker/Dockerfile-httpfrontend with 85% similarity]
docker/storperf-master/Dockerfile [moved from docker/Dockerfile-master with 92% similarity]
docker/storperf-master/graphite/carbon.conf [moved from docker/graphite/carbon.conf with 100% similarity]
docker/storperf-master/graphite/initial_data.json [moved from docker/graphite/initial_data.json with 100% similarity]
docker/storperf-master/graphite/local_settings.py [new file with mode: 0644]
docker/storperf-master/graphite/nginx.conf [moved from docker/graphite/nginx.conf with 100% similarity]
docker/storperf-master/graphite/storage-schemas.conf [moved from docker/graphite/storage-schemas.conf with 100% similarity]
docker/storperf-reporting/Dockerfile [moved from docker/Dockerfile-reporting with 85% similarity]

index 4f4e38b..b2cf1c4 100755 (executable)
@@ -11,9 +11,8 @@
 cd `dirname $0`
 ci=`pwd`
 
-cd ${ci}/../docker-compose
+cd ${ci}/../docker
 
-export TAG=${DOCKER_TAG:-latest}
 export ENV_FILE=${ci}/job/admin.rc
 export CARBON_DIR=${ci}/job/carbon/
 
@@ -23,15 +22,11 @@ then
     sudo chown 33:33 ${ci}/job/carbon
 fi
 
-docker-compose pull
-docker-compose up -d
+docker-compose -f local-docker-compose.yaml up -d
 
 echo "Waiting for StorPerf to become active"
-curl -X GET 'http://127.0.0.1:5000/api/v1.0/configurations' > test.html 2>&1
-while [ `grep 'agent_count' test.html | wc -l` == "0" ]
+
+while [ $(curl -s -o /dev/null -I -w "%{http_code}" -X GET http://127.0.0.1:5000/api/v1.0/configurations) != "200" ]
 do
     sleep 1
-    curl -X GET 'http://127.0.0.1:5000/api/v1.0/configurations' > test.html 2>&1
 done
-
-rm -f test.html
index f424110..1764034 100755 (executable)
 cd `dirname $0`
 ci=`pwd`
 
-cd ${ci}/../docker-compose
+cd ${ci}/../docker
 
 export TAG=${DOCKER_TAG:-latest}
 export ENV_FILE=${ci}/job/admin.rc
 export CARBON_DIR=${ci}/job/carbon/
 
-docker-compose down
+docker-compose -f local-docker-compose.yaml down
 
-for container_name in storperf swagger-ui http-front-end
+for container_name in storperf storperf-master storperf-swaggerui storperf-httpfrontend storperf-reporting
 do
     container=`docker ps -a -q -f name=$container_name`
     if [ ! -z $container ]
index 7747506..bb09eef 100644 (file)
@@ -1,3 +1,12 @@
+##############################################################################
+# Copyright (c) 2017 Dell 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
+##############################################################################
+
 version: '2'
 services:
     storperf-master:
diff --git a/docker/graphite/local_settings.py b/docker/graphite/local_settings.py
deleted file mode 100644 (file)
index 177d674..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-# Edit this file to override the default graphite settings, do not edit settings.py
-
-# Turn on debugging and restart apache if you ever see an "Internal Server Error" page
-#DEBUG = True
-
-# Set your local timezone (django will try to figure this out automatically)
-TIME_ZONE = 'UTC'
-
-# Setting MEMCACHE_HOSTS to be empty will turn off use of memcached entirely
-#MEMCACHE_HOSTS = ['127.0.0.1:11211']
-
-# Sometimes you need to do a lot of rendering work but cannot share your storage mount
-#REMOTE_RENDERING = True
-#RENDERING_HOSTS = ['fastserver01','fastserver02']
-#LOG_RENDERING_PERFORMANCE = True
-#LOG_CACHE_PERFORMANCE = True
-
-# If you've got more than one backend server they should all be listed here
-#CLUSTER_SERVERS = []
-
-# Override this if you need to provide documentation specific to your graphite deployment
-#DOCUMENTATION_URL = "http://wiki.mycompany.com/graphite"
-
-# Enable email-related features
-#SMTP_SERVER = "mail.mycompany.com"
-
-# LDAP / ActiveDirectory authentication setup
-#USE_LDAP_AUTH = True
-#LDAP_SERVER = "ldap.mycompany.com"
-#LDAP_PORT = 389
-#LDAP_SEARCH_BASE = "OU=users,DC=mycompany,DC=com"
-#LDAP_BASE_USER = "CN=some_readonly_account,DC=mycompany,DC=com"
-#LDAP_BASE_PASS = "readonly_account_password"
-#LDAP_USER_QUERY = "(username=%s)"  #For Active Directory use "(sAMAccountName=%s)"
-
-# If sqlite won't cut it, configure your real database here (don't forget to run manage.py syncdb!)
-#DATABASE_ENGINE = 'mysql' # or 'postgres'
-#DATABASE_NAME = 'graphite'
-#DATABASE_USER = 'graphite'
-#DATABASE_PASSWORD = 'graphite-is-awesome'
-#DATABASE_HOST = 'mysql.mycompany.com'
-#DATABASE_PORT = '3306'
diff --git a/docker/local-docker-compose.yaml b/docker/local-docker-compose.yaml
new file mode 100644 (file)
index 0000000..75cf429
--- /dev/null
@@ -0,0 +1,43 @@
+##############################################################################
+# Copyright (c) 2017 Dell 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
+##############################################################################
+
+version: '2'
+services:
+
+    storperf-master:
+        container_name: "storperf-master"
+        build: storperf-master
+        ports:
+            - "8000:8000"
+        env_file: ${ENV_FILE}
+        volumes:
+            - ${CARBON_DIR}:/opt/graphite/storage/whisper
+            - ./storperf-master/:/home/opnfv/repos/storperf
+
+    storperf-reporting:
+        container_name: "storperf-reporting"
+        build: storperf-reporting
+        ports:
+            - "5080:5000"
+        volumes:
+            - ./storperf-reporting/:/home/opnfv/storperf-reporting
+
+    storperf-swaggerui:
+        container_name: "storperf-swaggerui"
+        image: "schickling/swagger-ui"
+
+    storperf-httpfrontend:
+        container_name: "storperf-httpfrontend"
+        build: storperf-httpfrontend
+        ports:
+            - "5000:5000"
+        links:
+            - storperf-master
+            - storperf-reporting
+            - storperf-swaggerui
\ No newline at end of file
similarity index 85%
rename from docker/Dockerfile-httpfrontend
rename to docker/storperf-httpfrontend/Dockerfile
index dc97b80..4069d24 100644 (file)
@@ -17,9 +17,7 @@ FROM nginx:stable-alpine
 MAINTAINER Mark Beierl <mark.beierl@dell.com>
 LABEL version="3.1" description="OPNFV Storperf HTTP Front End Container"
 
-ARG BRANCH=master
-
-COPY storperf-httpfrontend/nginx.conf /etc/nginx/nginx.conf
-COPY storperf-httpfrontend/html /etc/nginx/html
+COPY ./nginx.conf /etc/nginx/nginx.conf
+COPY ./html /etc/nginx/html
 
 EXPOSE 5000
similarity index 92%
rename from docker/Dockerfile-master
rename to docker/storperf-master/Dockerfile
index 38e8265..aa52fbb 100644 (file)
@@ -19,8 +19,6 @@ FROM ubuntu:14.04
 MAINTAINER Jose Lausuch <jose.lausuch@ericsson.com>
 LABEL version="5.0" description="OPNFV Storperf Docker container"
 
-ARG BRANCH=master
-
 ENV repos_dir /home/opnfv/repos
 ENV DEBIAN_FRONTEND noninteractive
 
@@ -69,14 +67,9 @@ RUN chmod 0664 /var/lib/graphite/storage/graphite.db
 RUN cd /var/lib/graphite/webapp/graphite && python manage.py syncdb --noinput
 
 
-# Git configuration
-
-RUN git config --global http.sslVerify false
-RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${repos_dir}/releng
-
-
 # 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 && make install
@@ -84,11 +77,11 @@ RUN cd ${repos_dir}/fio && git checkout tags/fio-2.2.10
 
 # Install StorPerf
 
-COPY storperf-master ${repos_dir}/storperf
+COPY . ${repos_dir}/storperf
 RUN chmod 600 ${repos_dir}/storperf/storperf/resources/ssh/storperf_rsa
 RUN pip install --upgrade setuptools==33.1.1
 RUN pip install -r ${repos_dir}/storperf/requirements.pip
-COPY storperf-master/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
+COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
 
 # Graphite
 EXPOSE 8000
diff --git a/docker/storperf-master/graphite/local_settings.py b/docker/storperf-master/graphite/local_settings.py
new file mode 100644 (file)
index 0000000..7cff8f7
--- /dev/null
@@ -0,0 +1 @@
+TIME_ZONE = 'UTC'
similarity index 85%
rename from docker/Dockerfile-reporting
rename to docker/storperf-reporting/Dockerfile
index ad00019..606bac0 100644 (file)
@@ -19,15 +19,12 @@ FROM alpine:3.1
 MAINTAINER Mark Beierl <mark.beierl@dell.com>
 LABEL version="0.1" description="OPNFV Storperf Reporting Container"
 
-ARG BRANCH=master
-
 RUN apk add --update python py-pip
 
-COPY storperf-reporting /home/opnfv/storperf-reporting
+COPY . /home/opnfv/storperf-reporting
 WORKDIR /home/opnfv/storperf-reporting
-
 RUN pip install -r /home/opnfv/storperf-reporting/requirements.txt
-ENTRYPOINT ["python"]
-CMD ["/home/opnfv/storperf-reporting/src/app.py"]
+
+CMD ["python", "app.py"]
 
 EXPOSE 5000
\ No newline at end of file