-
Notifications
You must be signed in to change notification settings - Fork 362
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
Provide support or recommendation for how to interact with conda-lock lockfiles #1312
Comments
We already have lock files for pinning the base requirements, though these aren't yaml files: |
@manics This might be a
It seems though, that yes, the format of what you have is different. Example:
compared to something like https://iris-hep.org/analysis-systems-env-nightlies/iris-hep-rc/3.11/conda-lock.yml # This lock file was generated by conda-lock (https://github.com/conda/conda-lock). DO NOT EDIT!
#
# A "lock file" contains a concrete list of package versions (with checksums) to be installed. Unlike
# e.g. `conda env create`, the resulting environment will not change as new package versions become
# available, unless you explicitly update the lock file.
#
# Install this environment as "YOURENV" with:
# conda-lock install -n YOURENV --file conda-lock.yml
# To update a single package to the latest version compatible with the version constraints in the source:
# conda-lock lock --lockfile conda-lock.yml --update PACKAGE
# To re-solve the entire environment, e.g. after changing a version constraint in the source file:
# conda-lock -f iris-hep-rc/3.11/environment.yml --lockfile conda-lock.yml
version: 1
metadata:
content_hash:
linux-64: e002febb8b04300e80dded8f2b7dabb269ace11a83f98db20719007774f0f52c
channels:
- url: conda-forge
used_env_vars: []
platforms:
- linux-64
sources:
- iris-hep-rc/3.11/environment.yml
package:
- name: _libgcc_mutex
version: '0.1'
manager: conda
platform: linux-64
dependencies: {}
url: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
hash:
md5: d7c89558ba9fa0495403155b64376d81
sha256: fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726
category: main
optional: false
- name: ca-certificates
version: 2023.7.22
manager: conda
platform: linux-64
dependencies: {}
url: https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2023.7.22-hbcca054_0.conda
hash:
md5: a73ecd2988327ad4c8f2c331482917f2
sha256: 525b7b6b5135b952ec1808de84e5eca57c7c7ff144e29ef3e96ae4040ff432c1
category: main
optional: false
... (edit) Ah yes, here we go:
So it seems that you're using the pre- |
Supporting conda-lock outputs would be... nice, but would likely require some guardrails, and blessing some "r2d knows best" conventions.
As, ideally, it would replace (not change) the
The Thus far, there is no specific naming convention for A Well-Known Conda Lock File in a repo, as a number of "first-party" tools within the
|
So, to tighten up the above as a recommendation:
|
Chiming in here with a user experience, leading to a question about the above recommendation. My goals are to keep only my project's dependencies in an environment.yml with minimal pinning, have some lockfile for protection against untested updates, and to not conflict with packages added by the conda buildpack. I do not understand how I can create or use a lockfile that is aware of the package constraints introduced in the conda buildpack. Wouldn't the recommendation, which uses Aside: If not for some few packages that seem to need the notebook kernel to be the same as the environment running jupyterhub-singleuser, I would have used a separate environment for my project's kernel. |
Proposed change
At the moment,
repo2docker
supports conda/mamba/micromambaenvironment.yml
environment files as Binder config files. This is great, but even if you pin packages with==
their dependencies can still float and so reproducibility into the future can break. For long term reproducible builds (e.g. launching into Binder from a Zenodo DOI) you would want to be able to also haverepo2docker
work with lock files. As the conda ecosystem is already supported a natural extension would be to useconda-lock
, and withmamba/micromamba
you can interact withconda-lock
lock files on a nearly equal footing as you would anenvironment.yml
.However, at the moment, if you place a
conda-lock
lock file namedenvironment.yml
under abinder/
directory in a repo,repo2docker
will fail to build from it and error with(c.f. matthewfeickert-talks/talk-pyhep-2023#5)
It would be super nice if
conda-lock
lock files could have support added for them as a validrepo2docker
config file.Alternative options
Though if that is too big of a feature request, it would be nice if there was a method to allow users to interact with a
conda-lock
lock file that works withpostBuild
. At the moment, if you try to have apostBuild
config file that hasthis will again fail with
While
micromamba
is able to handle a command likeit seems that
conda
can not and so similarly having apostBuild
file withwill fail with
If the ability to install an environment from a
conda-lock
lock file without supportingconda-lock
could be supported then if instructions on how to work withconda-lock
lock files were also added this could resolve things as well.Who would use this feature?
People that want to ensure that a Binder link will run far into the future (so maybe the same people that put things on Zenodo).
How much effort will adding it take?
I'm not sure. I would hope not much, but I haven't taken the time to look at how
repo2docker
currently supports all the config files it already does.Who can do this work?
Someone with familiarity with
conda-lock
.The text was updated successfully, but these errors were encountered: