Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] docker_* states not available with onedir salt install #327

Open
satwell opened this issue Apr 21, 2023 · 0 comments
Open

[BUG] docker_* states not available with onedir salt install #327

satwell opened this issue Apr 21, 2023 · 0 comments
Labels

Comments

@satwell
Copy link

satwell commented Apr 21, 2023

Your setup

Formula commit hash / release tag

v2.4.2

Versions reports (master & minion)

# salt-call -V
Salt Version:
          Salt: 3006.0

Python Version:
        Python: 3.10.11 (main, Apr 14 2023, 05:57:16) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      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: 5.4.1
         PyZMQ: 23.2.0
        relenv: 0.11.2
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: debian 11 bullseye
        locale: utf-8
       machine: x86_64
       release: 5.10.0-21-cloud-amd64
        system: Linux
       version: Debian GNU/Linux 11 bullseye

Pillar / config used


Bug details

Describe the bug

salt 3006.0 and newer support only onedir installs. These versions install their own Python interpreter, separate from the system packages.

The docker_* states such as docker_container rely on the docker Python package. docker-formula installs this as a system package on most OSes (except centos/redhat), which means that it's not available to salt onedir installs. So docker states that require the Python module fail with an error like 'docker_image' __virtual__ returned False: 'docker.version' is not available.

Steps to reproduce the bug

Install salt 3006.0 on Debian and try to use docker-formula to install docker and create containers. This will fail with an error that says 'docker.version' is not available.

Expected behaviour

docker_* states should work after installing docker with docker-formula.

Attempts to fix the bug

As a workaround, I'm installing the docker Python package in a separate state with pip.installed, which installs into Salt's own Python interpreter:

docker-pip-package:
  pip.installed:
    - name: docker
    - reload_modules: true
    - require_in:
      - pkg: docker-software-package-install-pkg

Additional context

@satwell satwell added the bug label Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant