-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Write the modified conda env to a temporary file #8585
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
Conversation
@@ -767,16 +773,16 @@ def _append_core_requirements(self): | |||
dependencies.append(pip_dependencies) | |||
dependencies.extend(conda_requirements) | |||
environment.update({'dependencies': dependencies}) | |||
_, output_filename = tempfile.mkstemp(dir=Path(self.checkout_path) / ".." / "..", suffix=".yml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main issue I had was working out what the correct base path for this tempfile should be. I tried /tmp
but then the shell commands couldn't find the file, this was the only compromise I could get to work. I am sure someone can tell me a better answer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is because this code is executed in the host, and then the file is read from inside the container. So, the only way to share a file between them is by using a path under the one that is mounted from the host into the container (self.checkout_path
)
Thanks @Cadair for trying to get to this point. @humitos @ericholscher This is very clearly a dirty hack, but I wonder if we can get it to a point where it's mergeable, or if we should find a totally different strategy? @Cadair shared with me some logs in private while working on the issue and it was like some directories were wiped between steps, or something like that. I didn't have enough knowledge about our build process to give better recommendations. |
Hi all! I think the idea makes sense: use a temporal file outside the git checkout to avoid having a dirty state. However, we do modify other files as well (like Regarding the implementation itself, we should double-check where else Finally, what happened with the suggestion from this comment #8201 (comment). Have you tried it?
|
The specific issue with this one is that it is modified before the package is installed. Things like modifying the
Yes, we hacked various things together, it's possible but really ugly if you want to keep development version numbers for the "latest" builds. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Thanks for opening this PR. We are implementing pre/post commands in our builders. Once that is done, this issue can be solved with the git command described at #8201 (comment) I'm closing this PR because I don't think we will include a solution like this in the core application. We can come back to this and re-open if we feel it. Thanks! |
This is a stab in the dark at fixing #8201
It attempts to save the conda env file to a location outside of the checkout so that it doesn't interfere with the checkout / version number.