andrewrothstein / ansible-anaconda Goto Github PK
View Code? Open in Web Editor NEWAnsible role for installing Anaconda
License: MIT License
Ansible role for installing Anaconda
License: MIT License
hey,
would you be open to a pr to add windows support?
At this moment this role is still using the template documentation readme file and is lacking even a minimal usage example.
Information like: for which user it would install conda, is this going to replace system python or not? ....
Your role triggers an error at second run here because removing curl package does not remove libcurl.a file (first run install conda, uninstall curl conda package, let libcurl.a, then second run fails because libcurl.a is still here, so curl conda package uninstall is triggered again and fail because this package is not installed).
Removing libcurl may be a better choice (and also remove curl).
Error at second run:
TASK [andrewrothstein.anaconda : update conda pkgs...] ************************************************************************************************************************************************************
changed: [jupyter.lxc]
TASK [andrewrothstein.anaconda : remove conda-curl since it conflicts with the system curl] ***********************************************************************************************************************
fatal: [jupyter.lxc]: FAILED! => {"changed": true, "cmd": ["/usr/local/anaconda/bin/conda", "remove", "-y", "curl"], "delta": "0:00:01.138967", "end": "2018-02-03 16:01:53.361129", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-02-03 16:01:52.222162", "stderr": "\nPackagesNotFoundError: The following packages are missing from the target environment:\n - curl", "stderr_lines": ["", "PackagesNotFoundError: The following packages are missing from the target environment:", " - curl"], "stdout": "Solving environment: ...working... failed", "stdout_lines": ["Solving environment: ...working... failed"]}
to retry, use: --limit @/home/lalmeras/git/log/jupyter.retry
The binary for conda has a different name and path prpbably from some changes in the release archives.
The error during the update of conda is here
TASK [andrewrothstein.anaconda : update conda pkgs...] *****************************************************************************************************************************
Tuesday 03 December 2019 12:33:13 -0500 (0:00:00.235) 0:00:27.991 ******
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/usr/local/anaconda/bin/conda update -y --all", "msg": "[Errno 2] No such file or directory", "rc": 2}
The new location of the installed binary is here
/usr/local/anaconda/conda.exe
instead of here
/usr/local/anaconda/bin/conda
Hello,
Running this role against fresh Ubuntu Server 18.04 LTS produces below error on task remove conda-curl since it conflicts with the system curl
{
"changed": false,
"module_stderr": "Shared connection to xxx.xxx.xxx.xxx closed.\r\n",
"module_stdout": "Traceback (most recent call last):\r\n File \"/home/xxx/.ansible/tmp/ansible-tmp-1611129119.9166963-71440610783391/AnsiballZ_conda.py\", line 102, in <module>\r\n _ansiballz_main()\r\n File \"/home/gko/.ansible/tmp/ansible-tmp-1611129119.9166963-71440610783391/AnsiballZ_conda.py\", line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/home/xxx/.ansible/tmp/ansible-tmp-1611129119.9166963-71440610783391/AnsiballZ_conda.py\", line 40, in invoke_module\r\n runpy.run_module(mod_name='ansible.modules.conda', init_globals=None, run_name='__main__', alter_sys=True)\r\n File \"/usr/lib/python3.6/runpy.py\", line 205, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/lib/python3.6/runpy.py\", line 96, in _run_module_code\r\n mod_name, mod_spec, pkg_name, script_name)\r\n File \"/usr/lib/python3.6/runpy.py\", line 85, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_conda_payload_ot31k7m9/ansible_conda_payload.zip/ansible/modules/conda.py\", line 73, in <module>\r\nModuleNotFoundError: No module named 'distutils.spawn'\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
Ansible Version: 2.9.6
I don't think conda-curl is installed with later versions of Anaconda, which causes the remove conda-curl since it conflicts with the system curl
step to fail:
FAILED! => {"changed": true, "cmd": ["/usr/local/anaconda-5.1.0/bin/conda", "remove", "-y", "curl"], "delta": "0:00:03.035634", "end": "2018-03-28 08:48:27.526240", "msg": "non-zero return code", "rc": 1, "start": "2018-03-28 08:48:24.490606", "stderr": "\nPackagesNotFoundError: The following packages are missing from the target environment:\n - curl", "stderr_lines": ["", "PackagesNotFoundError: The following packages are missing from the target environment:", " - curl"], "stdout": "Solving environment: ...working... failed", "stdout_lines": ["Solving environment: ...working... failed"]}
Perhaps it would be a good idea to use the conda
module developed here to remove conda-curl, instead of using a command?
The profile.d shell scriptlet shouldn't set PYTHON. That causes problems for applications respecting this environment variable whilst running inside a conda environment
It looks like the latest release of this role, v4.0.1, isn't available from Ansible Galaxy.
is this something that you think would be a useful improvement?
Thank you for this great project. It successfully installed conda for me (on Centos7 in a vagrant box) but then failed with the following error message.
TASK [andrewrothstein.anaconda : remove conda-curl since it conflicts with the system curl] ***
fatal: [default]: FAILED! => {"msg": "module (conda) is missing interpreter line"}
to retry, use: --limit @/vagrant/playbook.retry
PLAY RECAP *********************************************************************
default : ok=9 changed=5 unreachable=0 failed=1
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
It would be nice to have the link be optional. In my case I need both anaconda2 and 3 to be installed / maintained.
- hosts: all
become: yes
become_method: sudo
gather_facts: true
vars:
python_versions:
- 2
- 3
(...)
tasks:
(...)
- name: "Install anaconda for python versions"
with_items: "{{ python_versions }}"
loop_control:
loop_var: version
include_role:
name: andrewrothstein.anaconda
vars:
anaconda_parent_dir: /hadoop/anaconda
anaconda_python_ver: "{{ version }}"
I can think of a few ways to tackle this - thoughts on what you would prefer? Simply making the link optional may work however I can see where you would want to have anaconda2 symlink to latest for 2, ditto for anaconda3.
Happy to submit a pr
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.