Bake matplotlib into robot image 75/42175/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 20 Jul 2016 21:03:25 +0000 (17:03 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 20 Jul 2016 23:56:26 +0000 (19:56 -0400)
matplotlib takes at least 6 minutes to compile when running pip install.
Use packaged version of matplotlib instead and bake it into robot image.

Change-Id: I5035361da26aafe5f462e0be227df0300f558d96
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/integration/include-raw-integration-install-robotframework.sh
packer/provision/robot.sh

index 59e870e24b96c07da39379b9d13f604be16ed202..e8ca86e1bffc7271c1eadbb70a7fc91c4a153447 100644 (file)
 ROBOT_VENV=`mktemp -d --suffix=robot_venv`
 echo ROBOT_VENV=${ROBOT_VENV} >> ${WORKSPACE}/env.properties
 
-virtualenv ${ROBOT_VENV}
+# The --system-site-packages parameter allows us to pick up system level
+# installed packages. This allows us to bake matplotlib which takes very long
+# to install into the image.
+virtualenv --system-site-packages ${ROBOT_VENV}
 source ${ROBOT_VENV}/bin/activate
 
 set -exu
@@ -29,7 +32,6 @@ pip install --upgrade jsonpath-rw
 
 # Modules for longevity framework robot library
 pip install elasticsearch==1.7.0 elasticsearch-dsl==0.0.11
-pip install --upgrade matplotlib
 
 # Print installed versions.
 pip freeze
index 441b0104784eb9a9e07f920d9c4f4c9f44e74e11..19aee18284b4a988c5492530b7840c7ed0a06400 100644 (file)
@@ -12,7 +12,7 @@ yum install -q -y python-{devel,setuptools,virtualenv} @development
 yum install -y -q yum-utils unzip sshuttle nc libffi-devel openssl-devel
 
 # Install dependencies for matplotlib library used in longevity framework
-yum-builddep -y python-matplotlib
+yum install -y -q libpng-devel freetype-devel python-matplotlib
 
 # install crudini command line tool for editing config files
 yum install -y -q crudini