Skip to main content

Quick environment solver

Project description

# mungo

**IMPORTANT WARNING**
*mungo* is experimental, things are *very* likely to break.

*mungo* acts as a drop-in replacement for `conda create` and `conda install` -
but with way faster environment resolution.
The improvements in speed are achieved by employing linear programming instead
of sat-solving and caching of intermediate results (see "The ILP" for more information).

Note that we do not want to replace conda - we merely wish to share our solution so that it can be tested and perhaps
someday be integrated into conda itself.

## Caveats
- *mungo* only exposes basic functionality:
- `install (package_spec)+ (--name NAME)? (--channel CHANNEL)* (--file FILE)?`
- `create  (package_spec)* (--name NAME)? (--channel CHANNEL)* (--file FILE)?`
- *mungo*'s solutions will *not* be the same as conda's.
- *mungo* cannot handle custom channel urls. Any channel which has `repodata.json.bz2` files available from `https://conda.anaconda.org/CHANNEL/ARCH` is fine, though.
- *mungo* only reads channels from `~/.condarc` (but also uses the `--channel` arguments, if supplied, of course).
- *mungo* only supports linux at the moment.

## Installation
You need a working conda installation, since actual package installation is
delegated to conda.
### from PIP
pip install mungo

## Examples
# create an environment named 'foo' with the specified packages
mungo create -n foo "python>=3.7" pulp packaging pyyaml

# create an environment from an environment file (such as mungo.yml)
mungo create --file mungo.yml

# install packages into the current environment
mungo install bwa

# install packages into a different environment
mungo install -n foo bwa

## The ILP
*mungo* uses an integer linear program to determine a configuration of compatible packages which maximizes version numbers while also keeping channel order in mind.

![alt text](images/dag.png "Dependency DAG")

After merging, the algorithm creates an ILP variable [0;1] for each p-node. This variable later represents if the package with the related version is selected for installation (1) or not (0).
As a second step, the algorithm iterates over all contrain nodes and creates the following ILP constrain:
For each parent p (variable), the sum of all children (variables) C must be greater or equal p. This represents the fact, that if p is installed, at least one available version of each dependent package must also be installed. If p is not selected for installation (p=0), the installation status of its dependencies is not imporatant to p.

![alt text](images/dag2.png "Dependency DAG")


![alt text](images/dag3.png "Dependency DAG")
## Changelog
- version 0.1.0: Initial version.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mungo-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

mungo-0.1.0-py3.6.egg (20.3 kB view details)

Uploaded Egg

File details

Details for the file mungo-0.1.0.tar.gz.

File metadata

  • Download URL: mungo-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4

File hashes

Hashes for mungo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a5aaa9af4d48ece4f28ddaefd4a723e9fc2f207bd0178fb8bbfd62d686a284c5
MD5 67e675218c85e75a7082ad9bc5635779
BLAKE2b-256 c072498e053e831d33d706f931c68e399306061b4e4065dd24630a2960a87fa6

See more details on using hashes here.

File details

Details for the file mungo-0.1.0-py3.6.egg.

File metadata

  • Download URL: mungo-0.1.0-py3.6.egg
  • Upload date:
  • Size: 20.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4

File hashes

Hashes for mungo-0.1.0-py3.6.egg
Algorithm Hash digest
SHA256 239a5caf4afd792dad810c01fc7fdbf93c1eaa81ed3cfd81c59849c8af726f35
MD5 87d26fdfa468799be3567752579a6299
BLAKE2b-256 50a89f05273b77e90f1645575e8704d7d6f8a5128736c570d8d0d055d146396b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page