conda-lock
Conda lock is a lightweight library that can be used to generate fully reproducible lock files for conda environments.
It does this by performing multiple solves for conda targeting a set of platforms you desire lockfiles for.
This also has the added benefit of acting as an external presolve for conda as the lockfiles it generates results in the conda solver not being invoked when installing the packages from the generated lockfile.
why?
Conda environment.yaml files are very useful for defining desired environments but there are times when we want to be able to EXACTLY reproduce an environment by just installing and downloading the packages needed.
This is particularly handy in the context of a gitops style setup where you use conda to provision environments in various places
Dockerfile example
In order to use conda-lock in a docker-style context you want to add the lockfile to the
docker container. In order to refresh the lock file just run conda-lock again.
Dockerfile
environment.yaml
* conda-linux-64.lock
# Dockerfile
# Build container
FROM continuumio/miniconda:latest as conda
ADD conda-linux-64.lock /locks/conda-linux-64.lock
RUN conda create -p /opt/env --copy --file /locks/conda-linux-64.lock
# Primary container
FROM gcr.io/distroless/base-debian10
COPY --from=conda /opt/env /opt/env
installation
pip install conda-lock
usage
# generate the lockfiles
conda-lock -f environment.yml -p osx-64 -p linux-64
# create an environment from the lockfile
conda create -n my-locked-env --file conda-linux-64.lock
Release files for conda-lock 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| conda_lock-0.5.0.tar.gz | 47.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| conda_lock-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 60.3 kB
Release files / conda_lock-0.5.0.tar.gz
| Download URL | conda_lock-0.5.0.tar.gz |
|---|---|
| Size | 47.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3a254f5759704c75847b0fa4371d55b0c4471656a1496d1f281c50de5e5b0eb
|
|
BLAKE2b-256 checksum How to use checksums |
c558b7c8f4971e97b67201e9e68ecf170b0231a3db06cf8dc8ea56612251a7b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200529 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
|
Release files / conda_lock-0.5.0-py3-none-any.whl
| Download URL | conda_lock-0.5.0-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38049a34cf308075e9ea42d4a6dad38cd1ee2eeab5560112f9b45cfbc9ec45c9
|
|
BLAKE2b-256 checksum How to use checksums |
8da88054eccce8b94e7120156512a54fe6eb0a34b65c54c42cc4cdb8b07385d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200529 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
|