Closed dingp closed 1 year ago
Here are some suggested tests of the two features:
dbt-create -n last_fddaq <new_workarea_dir>
to verify <new_workarea_dir>/.venv
subdirectory is not created in the work area, and then verify if the the .venv
from cvmfs is loaded when doing cd <new_workarea_dir>; source env.sh
;--clone-pyvenv
;--install-pyvenv
;dbt-create -s -n last_fddaq <new_workarea_dir>
and verify <new_workarea_dir>/.spack
is created, and then load the workarea with cd <new_workarea_dir>; source env.sh
, followed by spack install --reuse dpdk@21.11
to install an older version of dpdk
locally. Use spack find -p dpdk
to verify the locally installed dpdk
is listed. Use spack load dpdk@21.11
to make sure it can be loaded;Repeat the test above by replacing last_fddaq
with last_successful
when calling dbt-create
.
I tried all the suggested tests, and things looked fine. I also added two changes:
1) Updated the documentation on this feature branch to reflect the updated dbt-create
interface
2) Working off the principle of "write a function if you do something more than once in your code", I wrapped the subprocess.Popen
polling and return value checking in a run_command
function I added to dbt_setup_tools.py
Thanks John! Merging the PR.
This PR contains two features:
support the use of python venv from cvmfs, and avoid the time-consuming cloning/installing a venv into a work area;
The first feature allows developers to skip the creation of python venv (either via clone or fresh install) inside a workarea when using
dbt-create
.Unless
-i/--install-pyvenv
or-c/--clone-pyvenv
is used withdbt-create
, the workarea will not contain a pre-installed python venv.dbt-workarea-env
will check the existence of$DBT_WORKAREA_ROOT/$DBT_VENV
, if not found, it will activate the python venv in the release directory on cvmfs.support the installation of a writable spack instance into a work area, so developers can install their own spack packages.
Use option
-s/--spack
when callingdbt-create
.This optionw will create
.spack
under the workarea, and addLOCAL_SPACK_DIR
env to thedbt-workarea-constants.sh
.The local
.spack
is a clone of the spack instance from the release directory on cvmfs with the following modifications:spack-repo
subdir is created, and added to therepos.yaml
in the local.spack
. In case one need to modify a package's recipe file, they should copy over the existing recipe file into.spack/spack-repo/packages/<pkg_name>
, and modify it there;When calling
dbt-workarea-env
, it will check ifLOCAL_SPACK_DIR
is set, if so, load the spack setup script from there.