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

Add Python interpreter to execution PATH for AWS Batch #735

Merged
merged 4 commits into from Oct 11, 2021

Conversation

savingoyal
Copy link
Collaborator

This is needed to ensure non-pythonic conda dependencies are visible to the user code on AWS Batch

This is needed to ensure non-pythonic conda dependencies are visible
to the user code on AWS Batch
# Add the Python interpreter's parent to the path. This is to
# ensure that any non-pythonic dependencies introduced by the conda
# environment are visible to the user code.
env_path = os.path.dirname(sys.executable)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this have unintended consequences in a non Conda env? I don't think so but checking.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This shouldn't since the effect is isolated to an individual task.

@@ -305,11 +313,7 @@ def runtime_step_cli(self,
if self.addl_paths is not None:
addl_paths = os.pathsep.join(self.addl_paths)
python_path = os.pathsep.join([addl_paths, python_path])
Copy link
Contributor

Choose a reason for hiding this comment

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

So here we are assuming that PATH will be updated later in task_pre_step, correct? Why not just remove the restriction on batch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct. Just removing the restriction on batch won't work since we need to set the environment during task execution and this hook executes pre-task execution.

@savingoyal
Copy link
Collaborator Author

@romain-intel Good to merge?

Copy link
Contributor

@romain-intel romain-intel left a comment

Choose a reason for hiding this comment

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

LGTM (well, tests should pass but is it the R issue again)

@savingoyal savingoyal merged commit c561622 into master Oct 11, 2021
@savingoyal savingoyal deleted the conda-path-for-aws-batch branch October 11, 2021 20:35
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.

None yet

2 participants