Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added virtual_env detection for ship_env flag #18

Merged
merged 3 commits into from
Nov 21, 2022

Conversation

yimuchen
Copy link
Contributor

Using the VIRTUAL_ENV environment variable for deciding which directly to pass to remote worker.
Needs to use os.getenv with a default empty pass, as lpcjobqueue will be passed to the remote worker, which doesn't have the VIRTUAL_ENV variable.

@@ -43,6 +43,7 @@ class LPCCondorJob(HTCondorJob):
container_prefix = "/cvmfs/unpacked.cern.ch/registry.hub.docker.com/"
config_name = "lpccondor"
known_jobs = set()
env_name = os.path.basename(os.getenv('VIRTUAL_ENV', ''))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the default for os.getenv be .env instead of '' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Updated in new commit

@@ -252,8 +253,9 @@ def _build_scratch(self):
self.scratch_area = tempfile.TemporaryDirectory(dir=tmproot)
infiles = []
if self._ship_env:
shutil.copytree("/srv/.env", os.path.join(self.scratch_area.name, ".env"))
infiles.append(".env")
env_path = os.getenv('VIRTUAL_ENV', '')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set default to /srv/.env?

@lgray lgray merged commit fa33e23 into CoffeaTeam:main Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants