salt: [BUG] docker-compose - current module uses now depreciated python library. should be migrated to use docker-compose v2 or docker compose commands

Description the current docker-compose integration uses the old docker-compose v1 python library, this is now Deprecated. docker-compose v2 is go based. since its creation there is now also a docker compose command in newer docker versions.

As of oct 22 there will be no more security fixes for the v1 branch

A plan to eventually move to ether v2 docker-compose or supporting the in-built compose command in docker should be considered

Additional context https://docs.docker.com/compose/#compose-v2-and-the-new-docker-compose-command https://www.docker.com/blog/announcing-compose-v2-general-availability/ https://github.com/docker/roadmap/issues/257

module: https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.dockercompose.html

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

Hello, I’m sorry in advance, if I left my message on the wrong issue. I can’t install a docker-compose module on my minion from salt-master. Is this because of the depreciated Python library? Thanks!

(venv) myuser@saltmaster:~/salt-ssh$ salt --versions-report
Salt Version:
          Salt: 3006.4

Python Version:
        Python: 3.10.13 (main, Oct  4 2023, 21:54:22) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.13.12
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: ubuntu 22.04.3 jammy
        locale: utf-8
       machine: x86_64
       release: 5.15.0-87-generic
        system: Linux
       version: Ubuntu 22.04.3 jammy

(venv) myuser@saltmaster:~/salt-ssh$ sudo salt 'salt-minion' pip.install docker-compose
[7/1864]hms:
    ----------
    pid:
        10919
    retcode:
        1
    stderr:
          error: subprocess-exited-with-error
          × Getting requirements to build wheel did not run successfully.
          │ exit code: 1
          ╰─> [20 lines of output]
              Error in sitecustomize; set PYTHONVERBOSE for traceback:
              TypeError: expected str, bytes or os.PathLike object, not NoneType
              Fatal Python error: init_import_site: Failed to import the site module
              Python runtime state: initialized
              Traceback (most recent call last):
                File "/opt/saltstack/salt/lib/python3.10/site.py", line 617, in <module>
                  main()
                File "/opt/saltstack/salt/lib/python3.10/site.py", line 610, in main
                  execsitecustomize()
                File "/opt/saltstack/salt/lib/python3.10/site-packages/relenv/runtime.py", line 933, in wrapper
                  import sitecustomize
                File "/tmp/pip-build-env-yw9s_lz0/site/sitecustomize.py", line 23, in <module>
                  site.addsitedir(path)
                File "/opt/saltstack/salt/lib/python3.10/site.py", line 216, in addsitedir
                  sitedir, sitedircase = makepath(sitedir)
                File "/opt/saltstack/salt/lib/python3.10/site.py", line 97, in makepath
                  dir = os.path.join(*paths)
                File "/opt/saltstack/salt/lib/python3.10/posixpath.py", line 76, in join
                  a = os.fspath(a)
              TypeError: expected str, bytes or os.PathLike object, not NoneType
              [end of output]
          note: This error originates from a subprocess, and is likely not a problem with pip.
        error: subprocess-exited-with-error
        × Getting requirements to build wheel did not run successfully.
        │ exit code: 1
        ╰─> See above for output.
        note: This error originates from a subprocess, and is likely not a problem with pip.
    stdout:
        Collecting docker-compose
          Using cached docker_compose-1.29.2-py2.py3-none-any.whl (114 kB)
        Collecting PyYAML<6,>=3.10 (from docker-compose)
          Using cached PyYAML-5.4.1.tar.gz (175 kB)
          Installing build dependencies: started
          Installing build dependencies: finished with status 'done'
          Getting requirements to build wheel: started
          Getting requirements to build wheel: finished with status 'error'
ERROR: Minions returned with non-zero exit code