Giter Site home page Giter Site logo

ansible-conda's People

Contributors

brianhelba avatar ellisonbg avatar jiffyclub avatar maxalbert avatar waddell avatar zodiacfireworks 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

ansible-conda's Issues

broken conda 4.3.11

Referring to #9

I'm using conda 4.3.11 and the output is now different, so this patch is not working because it's returning a dict instead of string:

$ conda list -f ^oracle-instantclient$ --json
[
  {
    "base_url": null,
    "build_number": 1,
    "build_string": "1",
    "channel": "dody",
    "dist_name": "oracle-instantclient-11.2.0.4.0-1",
    "name": "oracle-instantclient",
    "platform": null,
    "version": "11.2.0.4.0",
    "with_features_depends": null
  }
]

conda hanging when installing a package

Okay I was able to reproduce this and can point to what is causing it.

To reproduce:

  1. Create a task to install a package, eg: pillow
  2. Stop the task half way by doing ctrl-C
  3. Re-run the task again. The task will hang

I found that because in the backend what is happening is conda has created a lock file that is not cleanly deleted when Ctrl-C is hit. So this causes the package install to hang while it tries to deal with the lock file. The can be seen when running conda install manually on the target host.

What can be done is to:

  1. return the error where it discovers a lock file
  2. clean out lock file before attempting to install packages (might not be so good)

Change reported when no update - `conda` ignores trailing ".0"s

If a version number has extra ".0" precision - e.g. only version 0.8 exists, yet version 0.8.0 is requested - conda happily ignores the extra ".0"s.

However, this module still reports a change when this happens, e.g.:

TASK [hail : install conda prerequisites] ******************************************************************************************************************************************************************
changed: [localhost] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "channels": null,
            "executable": "/usr/local/anaconda-4.4.0/bin/conda",
            "extra_args": null,
            "name": "seaborn",
            "state": "present",
            "version": "0.8.0"
        }
    },
    "name": "seaborn",
    "stderr": "",
    "stderr_lines": [],
    "stdout": "Fetching package metadata .........\nSolving package specifications: .\n\n# All requested packages already installed.\n# packages in environment at /usr/local/Anaconda2-4.4.0-Linux-x86_64:\n#\nseaborn                   0.8                      py27_0  \n",
    "stdout_lines": [
        "Fetching package metadata .........",
        "Solving package specifications: .",
        "",
        "# All requested packages already installed.",
        "# packages in environment at /usr/local/Anaconda2-4.4.0-Linux-x86_64:",
        "#",
        "seaborn                   0.8                      py27_0  "
    ],
    "version": "0.8.0"
}

It's worth noting that conda install seaborn=0.8.1 leads to a PackageNotFoundError error.

Feature request: determine order of channels

I love this plugin, so first off, thanks for the time you took to create and publish it!


Currently the channels parameter allows one to append channels to the channel list when using conda. The code for this is here and although the language suggests addition, the action is an append:

ansible-conda/conda.py

Lines 175 to 189 in f26ac9f

def add_channels_to_command(command, channels):
"""
Add extra channels to a conda command by splitting the channels
and putting "--channel" before each one.
"""
if channels:
channels = channels.strip().split()
dashc = []
for channel in channels:
dashc.append('--channel')
dashc.append(channel)
return command[:2] + dashc + command[2:]
else:
return command

Using the Bioconda channel requires addition of channels in a known order so installation is predictable and dependencies are matched correctly:

❯ conda config --add channels defaults
❯ conda config --add channels bioconda
❯ conda config --add channels conda-forge

So the channels order become:

❯ conda config --show channels

channels:
  - conda-forge
  - bioconda
  - defaults

Would you be willing to support overriding of the channel order via configuration? If you have a good idea on how to achieve this I would be willing to submit a PR!

Error with conda.py

Hi, I posted this issue already here.

jupyterhub/jupyterhub-deploy-teaching#77

I'm getting a lot of errors of this kind

failed: [sapho - longwing](item = ipywidgets) => {
    "failed": true,
    "item": "ipywidgets",
    "module_stderr": "\
        OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016    \
        debug1: Reading configuration data /etc/ssh/ssh_config    \
        debug1: /etc/ssh/ssh_config line 19: Applying options for *    \
        debug1: auto-mux: Trying existing master    \
        debug2: fd 3 setting O_NONBLOCK    \
        debug2: mux_client_hello_exchange: master version 4    \
        debug3: mux_client_forwards: request forwardings: 0 local, 0 remote    \
        debug3: mux_client_request_session: entering    \
        debug3: mux_client_request_alive: entering    \
        debug3: mux_client_request_alive: done pid = 897    \
        debug3: mux_client_request_session: session request sent    \
        debug1: mux_client_request_session: master session id: 2    \
        debug3: mux_client_read_packet: read header failed: Broken pipe    \
        debug2: Received exit status from master 0    \
        Shared connection to sapho-longwing closed.    \
    ",
    "module_stdout": "\
        Traceback (most recent call last):    \
          File \"/tmp/ansible_dRn5ki/ansible_module_conda.py\", line 296, in <module>    \
            main()    \
          File \"/tmp/ansible_dRn5ki/ansible_module_conda.py\", line 281, in main    \
            installed, installed_version = _check_installed(module, conda, name)    \
          File \"/tmp/ansible_dRn5ki/ansible_module_conda.py\", line 141, in _check_installed    \
            pname, pversion, pdist = other.rsplit('-', 2)    \
        AttributeError: 'dict' object has no attribute 'rsplit'    \
    ",
    "msg": "MODULE FAILURE",
    "rc": 0
}

With many packages. The problem is that sometimes object becomes a dict object. In thos case I solved the problem with this

if isinstance(other, dict):
    pname = other.get('name', '') 
    pversion = other.get('version', '') 
else:
    pname, pversion, pdist = other.rsplit('-', 2)

RFE: Be able to specify multiple packages to install

conda's depsolving is pretty strange, and if you ask to install packages one at a time you can get pretty different results and a lot of churn among dependencies compared to when you request all of the packages you want at once.

First decision is how to specify the list of packages and perhaps versions. My preference would be to try to match a module like dnf as much as possible. This would be a big change though - as I think we would want to get rid of the separate version argument and have users pass in the version specification in name (as is done in dnf). Then name could be a comma separated string or a list of packages.

conda hanging

When I try using this conda library it gets stuck at this stage:

TASK: [app_server | Upgrade conda] ******************************************** 

<localhost> REMOTE_MODULE conda name=conda state=latest executable=/opt/miniconda2/bin/conda CHECKMODE=True

<localhost> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1464234711.62-251681184121083 && echo $HOME/.ansible/tmp/ansible-tmp-1464234711.62-251681184121083']

<localhost> PUT /tmp/tmpJtd_Ak TO //.ansible/tmp/

Any idea why ?

Do not reinstall package by default

Hello,

When using the conda module, if a playbook is replayed, conda packages will be reinstalled too.
A check should be performed to verify if a package is already installed before installing it ?

Regards,

Nicolas

How to install packages into specific conda environment?

How do I use this module to install package to specific environment?

For example,
Given that I have Anaconda installed under /opt/anaconda2/,
and that I have manually created environment called 'myconda'

I want to write a task to install package pip into environment 'myconda'

Here is an example task:

  • name: Install pip via conda module
    conda:
    name: pip
    state: latest
    executable: /opt/anaconda2/bin/conda
    extra_args:
    - "-n myconda"

This does not work in my environment with ansible 2.4.3.0

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.