-
Notifications
You must be signed in to change notification settings - Fork 104
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
Support conda/mamba install --copy
#267
Conversation
✅ Deploy Preview for conda-lock ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
conda activate lock && \ | ||
mamba env list && \ | ||
mamba install --yes pip conda-lock>=1.2.2 setuptools wheel && \ | ||
conda-lock lock \ |
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.
If I'm following correctly, then conda-lock.yml
only lives in the Docker cache where it can't be tracked with version control. Do we really want to recommend this?
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.
hence the two approaches in this document
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.
I feel like I'm missing something obvious here... I think I don't know what is a "build-container style system".
Two reasons I can think of off the top of my head for locking:
- Control explicitly when dependencies are updated
- Having an explicit record of the versions installed
It seems like neither of these applies in this case. (For 2. at least there's a file in the container, but if you have to go into the container to see it, you might as well run conda env export
.)
What's the benefit to this approach over installing directly from environment.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.
So the main benefit is more when you are using something like earthly
and have a single earthfile specify multiple docker outputs.
- This example does NOT deal with this case
- The explicit record is at least kept in the build-container style build described here, which means you can introspect a bit more easily as to what should be in the env.
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.
Thanks, I didn't know about Earthly. So if I understand correctly, one benefit is that the lockfile can be reused in multiple Dockerfile stages (or similar) to avoid multiple solves.
# optionally you can perfom some more cleanup on your conda install after this | ||
# to get a leaner conda environment |
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.
Let's just be explicit here?
# optionally you can perfom some more cleanup on your conda install after this | |
# to get a leaner conda environment | |
RUN mamba clean --all --force-pkgs-dirs --yes |
Co-authored-by: Ben Mares <services-git-throwaway1@tensorial.com>
0b52c95
to
b5d3dd9
Compare
BTW, I recently implemented another variation here, actually inspired by this PR, where I use micromamba in a build Docker-stage to generate the Conda environment and then copy the Conda environment into the primary Docker-stage. (As a result, I reduced the image size of the CF automerge bot. 😄) |
This would probably make for a nicer example |
Cool, I'll aim to add a MWE along these lines this weekend. |
No description provided.