Feat!: Re-factor lf-activate-venv() to re-use venv 97/70597/8
authorAnil Belur <abelur@linuxfoundation.org>
Wed, 7 Sep 2022 12:20:28 +0000 (22:20 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Sat, 10 Sep 2022 00:28:04 +0000 (10:28 +1000)
commit5f3d9b0c8343ee4dce1ed0d0c39f8677799b0c74
tree712dde5f96f22018d0761f5246c4c175c896c68e
parenta8c7722c19cfca9f0361c578ce63bf552093dd0e
Feat!: Re-factor lf-activate-venv() to re-use venv

Add new CLI option to set venv file.

Example:

lf-activate-venv --venv-file /tmp/.robot_venv \
robotframework

Modify lf-activate-venv() to allow creation of a venv file and re-use
the venv to improve job performance. When a dependency is already
installed, pip skips the package therefore reduces the time it takes
to create venv in every script.

Precedence for venv file.
  a. Re-use an existing venv file if one exists.
       1. Use venv file path from --venv-file
       2. Use default venv file path "/tmp/.os_lf_venv"
  b. Create new venv when 1. and 2. is absent

Note: The default file "/tmp/.os_lf_venv" is created by a pre-build
script (../shell/python-tools-install.sh).

In the situation where a fresh venv is required remove
"/tmp/.os_lf_venv" before calling lf-activate-venv().

Update all the required scripts that call lf-activate-venv().

Issue-ID: RELENG-4403
Change-Id: I559f759a8dba7eca0a62f8b73a360dc627699ed2
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
25 files changed:
jenkins-init-scripts/lf-env.sh
releasenotes/notes/refactor-lf-activate-venv-0bf51b617553ab93.yaml [new file with mode: 0644]
shell/deploy-maven-file.sh
shell/jenkins-configure-clouds.sh
shell/jenkins-configure-global-vars.sh
shell/jenkins-sandbox-cleanup.sh
shell/jjb-deploy-job.sh
shell/jjb-verify-job.sh
shell/maven-central.sh
shell/maven-deploy.sh
shell/maven-javadoc-publish.sh
shell/maven-stage.sh
shell/openstack-cleanup-old-images.sh
shell/openstack-cleanup-orphaned-k8s-clusters.sh
shell/openstack-cleanup-orphaned-ports.sh
shell/openstack-cleanup-orphaned-servers.sh
shell/openstack-cleanup-orphaned-stacks.sh
shell/openstack-cleanup-orphaned-volumes.sh
shell/openstack-kubernetes-create.sh
shell/openstack-protect-in-use-images.sh
shell/openstack-stack-copy-ssh-keys.sh
shell/openstack-stack-create.sh
shell/openstack-stack-delete.sh
shell/rtdv3.sh
shell/sigul-sign-dir.sh