CSIT-114: Eliminate repeated download of PIP packages 68/1268/2
authorCarsten Koester <ckoester@cisco.com>
Wed, 25 May 2016 21:52:01 +0000 (17:52 -0400)
committerDave Wallace <dwallacelf@gmail.com>
Thu, 2 Jun 2016 16:51:10 +0000 (16:51 +0000)
Allow VirtualEnv to use existing system-wide packages if they already exist.

Change-Id: I6f39178d56e81affea0bee7b9065bef66712ddaa
Signed-off-by: Carsten Koester <ckoester@cisco.com>
README
bootstrap-multilink.sh
bootstrap-verify-perf.sh
bootstrap-vpp-verify-weekly.sh
bootstrap.sh
resources/libraries/python/SetupFramework.py
resources/libraries/python/TrafficScriptExecutor.py

diff --git a/README b/README
index f8c478e..2b4fbce 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@
  - install virtualenv
  - generate environment using virtualenv:
     # cd $ROOT
-    # virtualenv env
+    # virtualenv --system-site-packages env
     # source env/bin/activate
  - install python requirements for this project by executing:
     # pip install -r requirements.txt
index 950b29c..1f7698b 100755 (executable)
@@ -16,7 +16,7 @@
 
 sudo apt-get -y install python-virtualenv
 
-virtualenv env
+virtualenv --system-site-packages env
 . env/bin/activate
 pip install -r requirements.txt
 
index 1f5acd3..925e3a6 100755 (executable)
@@ -64,7 +64,7 @@ export PYTHONPATH=${CUR_DIR}
 sudo apt-get -y update
 sudo apt-get -y install libpython2.7-dev python-virtualenv
 
-virtualenv env
+virtualenv --system-site-packages env
 . env/bin/activate
 
 echo pip install
index 5c94e89..90ff2b7 100644 (file)
@@ -142,7 +142,7 @@ if [ "$?" -ne "0" ]; then
 fi
 
 
-virtualenv env
+virtualenv --system-site-packages env
 . env/bin/activate
 
 echo pip install
index 9c7db03..ee80247 100755 (executable)
@@ -184,7 +184,7 @@ if [ "$?" -ne "0" ]; then
 fi
 
 
-virtualenv env
+virtualenv --system-site-packages env
 . env/bin/activate
 
 echo pip install
index ddc5514..b81a306 100644 (file)
@@ -102,7 +102,7 @@ def create_env_directory_at_node(node):
     ssh = SSH()
     ssh.connect(node)
     (ret_code, stdout, stderr) = ssh.exec_command(
-        'cd {0} && rm -rf env && virtualenv env && . env/bin/activate && '
+        'cd {0} && rm -rf env && virtualenv --system-site-packages env && . env/bin/activate && '
         'pip install -r requirements.txt'
         .format(con.REMOTE_FW_DIR), timeout=100)
     if 0 != ret_code:
index fa44623..108b2b9 100644 (file)
@@ -52,7 +52,7 @@ class TrafficScriptExecutor(object):
         logger.trace("{}".format(timeout))
         ssh = SSH()
         ssh.connect(node)
-        cmd = ("cd {}; virtualenv env && " +
+        cmd = ("cd {}; virtualenv --system-site-packages env && " +
                "export PYTHONPATH=${{PWD}}; " +
                ". ${{PWD}}/env/bin/activate; " +
                "resources/traffic_scripts/{} {}") \