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

Improve environmental variable caching #2101

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

stxue1
Copy link
Contributor

@stxue1 stxue1 commented Feb 19, 2025

PR to support environmental variable caching as mentioned here: DataBiosphere/toil#5187 (comment)

The structure of the preserve_environment code is roughly copied from a related function:

cwltool/cwltool/job.py

Lines 486 to 497 in 1b56338

if runtimeContext.preserve_entire_environment:
self._preserve_environment_on_containers_warning()
env.update(os.environ)
elif runtimeContext.preserve_environment:
self._preserve_environment_on_containers_warning(runtimeContext.preserve_environment)
for key in runtimeContext.preserve_environment:
try:
env[key] = os.environ[key]
except KeyError:
_logger.warning(
f"Attempting to preserve environment variable {key!r} which is not present"
)

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 10.52632% with 17 lines in your changes missing coverage. Please review.

Project coverage is 84.57%. Comparing base (1b56338) to head (6db18b7).

Files with missing lines Patch % Lines
cwltool/command_line_tool.py 10.52% 11 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2101      +/-   ##
==========================================
- Coverage   84.77%   84.57%   -0.20%     
==========================================
  Files          46       46              
  Lines        8359     8378      +19     
  Branches     1960     1968       +8     
==========================================
  Hits         7086     7086              
- Misses        805      819      +14     
- Partials      468      473       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mr-c mr-c changed the title Add environmental variable caching Improve environmental variable caching Feb 20, 2025
Copy link
Member

@mr-c mr-c left a comment

Choose a reason for hiding this comment

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

Thank you @stxue1 ; this will need some extra tests added to confirm your fixes

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.

2 participants