File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class LPCCondorJob(HTCondorJob):
4343 container_prefix = "/cvmfs/unpacked.cern.ch/registry.hub.docker.com/"
4444 config_name = "lpccondor"
4545 known_jobs = set ()
46+ env_name = os .path .basename (os .getenv ('VIRTUAL_ENV' , '.env' ))
4647
4748 def __init__ (
4849 self ,
@@ -55,7 +56,7 @@ def __init__(
5556 ):
5657 image = self .container_prefix + image
5758 if ship_env :
58- base_class_kwargs ["python" ] = ".env /bin/python"
59+ base_class_kwargs ["python" ] = f" { self . env_name } /bin/python"
5960 base_class_kwargs .setdefault (
6061 "worker_extra_args" , list (dask .config .get ("jobqueue.%s.worker_extra_args" % self .config_name ))
6162 )
@@ -252,8 +253,9 @@ def _build_scratch(self):
252253 self .scratch_area = tempfile .TemporaryDirectory (dir = tmproot )
253254 infiles = []
254255 if self ._ship_env :
255- shutil .copytree ("/srv/.env" , os .path .join (self .scratch_area .name , ".env" ))
256- infiles .append (".env" )
256+ env_path = os .getenv ('VIRTUAL_ENV' , '/srv/.env' )
257+ shutil .copytree (env_path , os .path .join (self .scratch_area .name , os .path .basename (env_path )))
258+ infiles .append (os .path .basename (env_path ))
257259 for fn in self ._transfer_input_files :
258260 fn = os .path .abspath (fn )
259261 if any (os .path .commonprefix ([fn , p ]) == p for p in self .schedd_safe_paths ):
You can’t perform that action at this time.
0 commit comments