GithubHelp home page GithubHelp logo

conda-incubator / conda-env-builder Goto Github PK

View Code? Open in Web Editor NEW
36.0 2.0 4.0 124 KB

Build and maintain multiple custom conda environments all in one place.

License: MIT License

Scala 98.92% Shell 1.08%
conda conda-environment bioinformatics bioinformatics-pipeline scala

conda-env-builder's People

Contributors

nh13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

conda-env-builder's Issues

Should pip `--upgrade-strategy only-if-needed` be a default argument?

We already mention it in the scala docs here:

/** Example YAML encoding for [[PipStep]]
* {{{
* - pip:
* args:
* - --upgrade-strategy
* - only-if-needed
* requirements:
* - defopt==5.1.0
* - samwell
* }}}
*
* Both `args` and `requirements` are optional.
*
* Requirements may omit version numbers, which can be compiled from the default environment
*/

And it's part of the conda doc recommendations here: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#using-pip-in-an-environment

We'd want to support opting out if we make it the default, which could be inelegant.

Thoughts?

I am curious about the motivation of the project

This is not an issue. I am just curious about the motivation of this project. I also suffered issues when installing bio tools inside the same namespace, for example, if I install GATK4/Picard requiring openjdk8 first, then install Trinity requiring openjdk7, the default higher version of JDK is overwritten by the older version, then Picard is corrupted. Basically, this can be solved via installing Trinity first then Picard, at last, the openjdk8 will be kept and there will be no issues.

Did you know the following project:
https://github.com/conda-tools/conda-execute

I'd like to help if you can share with me more about the issues encountered.
Thanks!

Found a cyclical dependency in the environment inheritance misreported

I would expect that the error would be "inherited environment samtools does not exist". Instead we get "Found a cyclical dependency in the environment inheritance."

Input YAML

name: example
environments:
  defaults:
    steps:
      - conda:
          channels:
            - conda-forge
            - bioconda
          requirements:
            - bwa=0.7.17
            - python=3.6.10
  bwa:
    group: alignment
    inherits:
      - samtools
    steps:
      - conda:
          requirements:
            - samtools
            - bwa
conda-env-builder Compile -c config.yaml 
...
[2020/12/15 21:31:19 | CondaEnvironmentBuilderMain | Info] Executing Compile from conda-env-builder version 010c473 as [email protected] on JRE 1.8.0_192-b01
[2020/12/15 21:31:19 | CondaEnvironmentBuilderMain | Info] Compile failed. Elapsed time: 0.02 minutes.
Exception in thread "main" java.lang.IllegalArgumentException: Found a cyclical dependency in the environment inheritance.
	at com.github.nh13.condaenvbuilder.api.Spec$.com$github$nh13$condaenvbuilder$api$Spec$$compile(Spec.scala:160)
	at com.github.nh13.condaenvbuilder.api.Spec.compiled(Spec.scala:22)
	at com.github.nh13.condaenvbuilder.tools.Compile.execute(Compile.scala:30)
	at com.github.nh13.condaenvbuilder.cmdline.CondaEnvironmentBuilderMain.makeItSo(CondaEnvironmentBuilderMain.scala:62)
	at com.github.nh13.condaenvbuilder.cmdline.CondaEnvironmentBuilderMain.makeItSoAndExit(CondaEnvironmentBuilderMain.scala:47)
	at com.github.nh13.condaenvbuilder.cmdline.CondaEnvironmentBuilderMain$.main(CondaEnvironmentBuilderMain.scala:20)
	at com.github.nh13.condaenvbuilder.cmdline.CondaEnvironmentBuilderMain.main(CondaEnvironmentBuilderMain.scala)

Accept an optional platform spec in the environments.yaml

I have found platform specifications to be a useful feature in conda-lock, as it provides an option for locking dependencies per environment specified. It would be great if conda-env-builder could also include this option.

Currently, conda-env-builder does not support platform specifications in the environment.yaml file. This requires developers to manually add platform specifications, which can be a time-consuming process and could potentially lead to errors.

I understand that adding new features can be a complex process, but I wanted to request that this feature be considered for future development. Thank you for your work on this tool.

Use conda-lock to create lock files

See: https://github.com/conda-incubator/conda-lock. We could then support multi-arch lock files.

Possible Implementation

The Solve command would have an option --conda-lock=<arch> that would run:

conda-lock lock -f <env-name>.yaml -p <arch> --lockfile <env-name>-conda-lock.yml
conda-lock render --kind explicit --filename-template <env-name>-<arch>.lock <env-name>-conda-lock.yml

The <env-name>-<arch>.lock would then be parsed so that the URL/hash given for conda packages is stored in the version string in the output YAML, while for pip packages, everything after the # pip <package-name> @.

Then Assemble would generate a <env>-<arch>.lock file instead of a <env>.yaml for <env-name>.build-conda.sh to use. The latter would use conda-lock install --name <env> <env>-<arch>.lock. Does Assemble know it's a conda-lock version if the "version" is a URL, or should we have an explicit option --conda-lock=<arch>? If the latter, must the architecture be encoded in the filename?

Note: both the conda-lock render and install commands use the --mamba option in conda-lock lock, so set those if --mamba given to conda-env-bulider

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.