Code Monkey home page Code Monkey logo

Comments (8)

nickjj avatar nickjj commented on June 12, 2024 1

Yeah I think removing it might not be the right play. Ideally I'd like to not change anything from the role / documentation level and get things to work the same as they did before except instead of making a symlink, you can make a proxy script.

Basically a bash script that does nothing except call the full binary path but pass in $@ to forward any arguments. I'll take care of this PR, don't worry about it.

from ansible-docker.

shadow1runner avatar shadow1runner commented on June 12, 2024

Or could it be that the role requires changes like in https://github.com/nickjj/ansible-docker/pull/75/files#diff-2444ad0870f91f17ca6c2a5e96b26823?

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Hi,

Have you tried using the master branch of this role instead of the latest pushed release?

I believe this likely stems from you having an older 18.04 server that was provisioned a while back which uses an older version of virtualenv.

But newer versions of virtualenv broke using symlinks. So the fix is to apt install virtualenv instead of pip installing it, and even Ubuntu 20.04 should have an old enough version of virtualenv where you should be safe.

The master branch patched things to use apt to install virtualenv. I should really make a release for that.

from ansible-docker.

shadow1runner avatar shadow1runner commented on June 12, 2024

Thank you for your help; unfortunately it didn't work; here's what I did:

ansible-galaxy remove nickjj.docker # not really necessary, but still
ansible-galaxy install git+https://github.com/nickjj/ansible-docker.git,master

Manually edited the playbook to use the new role (using the output of ansible-galaxy list -> role: ansible-docker, master) and then I've started over with two new VMs, still the result is the same as before:

/usr/bin/env python-docker
Python 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'docker'
>>> import sys
>>> print(sys.path)
['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']

The master branch patched things to use apt to install virtualenv

Interestingly enough though, neither can I find the role doing the installation, nor do I see it in the ansible output while running the playbook; still, trying to install virtualenv on Ubuntu 20.04 shows no changes (also because first thing my role does is to update all packages on the new system):

sudo apt install virtualenv 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
virtualenv is already the newest version (20.0.17-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Any other hints/anything I did wrong or misunderstand?
Thanks a lot for the help btw

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Ah I see the issue. Ubuntu 20.04 comes with virtualenv 20.0.17 which has the symlink bug. When Googling for Ubuntu 20.0.4 virtualenv apt version some of the first hits were for Ubuntu 19.x which has an older version that was safe.

I guess a proper fix will need to be put in place to get around the symlink issue. Basically it will involve not using the symlink. It's kind of inconvenient but the author of virtualenv said it's due to the venv package no longer supporting it.

It boils down to referencing /usr/local/lib/docker/virtualenv/bin/python instead of python-docker in any tasks that happen to use Ansible's docker and docker_compose modules.

from ansible-docker.

shadow1runner avatar shadow1runner commented on June 12, 2024

Thanks for the hint, now it works.
Please have a look at the PR I've just opened; at least all CI tests pass, but I'm quite sure many users of this role won't be too happy with the change, what do you think?

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

This has been addressed on master with this commit 88937d9.

I'll push a new release once Docker officially supports 20.04.

from ansible-docker.

shadow1runner avatar shadow1runner commented on June 12, 2024

Thanks for your work on this, I've just tried with your master branch and it is working fine 👍

from ansible-docker.

Related Issues (20)

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.