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

collection install fails on docker Mac M1 #1386

Closed
uccsjarmo opened this issue Dec 28, 2023 · 4 comments
Closed

collection install fails on docker Mac M1 #1386

uccsjarmo opened this issue Dec 28, 2023 · 4 comments
Labels
medium_priority Medium priority question Further information is requested work in In trying to solve, or in working with contributors

Comments

@uccsjarmo
Copy link

SUMMARY

Collection install fails on docker on Macbook Pro M1 with error "Building wheel for uamqp (PEP 517) ... error"

ISSUE TYPE
  • Bug Report
COMPONENT NAME

Installation

ANSIBLE VERSION
ansible [core 2.14.9]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.18 (main, Sep  7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
azure.azcollection-2.1.1
CONFIGURATION

OS / ENVIRONMENT

Rocky Linux release 9.3

STEPS TO REPRODUCE

Dockerfile to build ansible image

FROM rockylinux:9.3

RUN dnf update -y && \
    dnf install -y ansible-core python3-pip

ENV PATH="/root/ansible/.local/bin:$PATH"

RUN ansible-galaxy collection install azure.azcollection && \
    python3 -m pip install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
EXPECTED RESULTS

Collection installed

ACTUAL RESULTS

Installer fails to to build wheel for uamqp

41.15   psutil could not be installed from sources because gcc is not installed. Try running:
41.15     sudo yum install gcc python3-devel
41.15   error: command 'gcc' failed: No such file or directory
41.15   ----------------------------------------
41.15   ERROR: Failed building wheel for psutil
41.15   Building wheel for uamqp (PEP 517): started
41.51   Building wheel for uamqp (PEP 517): finished with status 'error'
41.51   ERROR: Command errored out with exit status 1:
41.51    command: /usr/bin/python3 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmplwja5r2o
41.51        cwd: /tmp/pip-install-_ubu77xj/uamqp_cf57c0fdfe2345c5bd53016e19645560
41.51   Complete output (101 lines):
41.51   running bdist_wheel
41.51   running build
41.51   running build_py
41.51   creating build
41.51   creating build/lib.linux-aarch64-cpython-39
41.51   creating build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/compat.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/utils.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/constants.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/types.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/errors.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/address.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/__init__.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/receiver.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/session.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/sender.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/client.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/mgmt_operation.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/connection.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   copying uamqp/message.py -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   creating build/lib.linux-aarch64-cpython-39/uamqp/async_ops
41.51   copying uamqp/async_ops/receiver_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
41.51   copying uamqp/async_ops/utils.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
41.51   copying uamqp/async_ops/session_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
41.51   copying uamqp/async_ops/__init__.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
41.51   copying uamqp/async_ops/mgmt_operation_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
41.51   copying uamqp/async_ops/connection_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
41.51   copying uamqp/async_ops/sender_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
41.51   copying uamqp/async_ops/client_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/async_ops
41.51   creating build/lib.linux-aarch64-cpython-39/uamqp/authentication
41.51   copying uamqp/authentication/cbs_auth.py -> build/lib.linux-aarch64-cpython-39/uamqp/authentication
41.51   copying uamqp/authentication/common.py -> build/lib.linux-aarch64-cpython-39/uamqp/authentication
41.51   copying uamqp/authentication/cbs_auth_async.py -> build/lib.linux-aarch64-cpython-39/uamqp/authentication
41.51   copying uamqp/authentication/__init__.py -> build/lib.linux-aarch64-cpython-39/uamqp/authentication
41.51   running egg_info
41.51   writing uamqp.egg-info/PKG-INFO
41.51   writing dependency_links to uamqp.egg-info/dependency_links.txt
41.51   writing requirements to uamqp.egg-info/requires.txt
41.51   writing top-level names to uamqp.egg-info/top_level.txt
41.51   reading manifest file 'uamqp.egg-info/SOURCES.txt'
41.51   reading manifest template 'MANIFEST.in'
41.51   adding license file 'LICENSE'
41.51   writing manifest file 'uamqp.egg-info/SOURCES.txt'
41.51   copying uamqp/c_uamqp.c -> build/lib.linux-aarch64-cpython-39/uamqp
41.51   running build_ext
41.51   will build uamqp in build/temp.linux-aarch64-cpython-39/cmake
41.51   Building with generator flags: -G "Unix Makefiles"
41.51   calling cmake /tmp/pip-install-_ubu77xj/uamqp_cf57c0fdfe2345c5bd53016e19645560/src/vendor/azure-uamqp-c/ -G "Unix Makefiles" -Duse_openssl:bool=ON -Duse_default_uuid:bool=ON  -Duse_builtin_httpapi:bool=ON  -Dskip_samples:bool=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release
41.51   CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
41.51   CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
41.51   CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
41.51   -- Configuring incomplete, errors occurred!
41.51   Traceback (most recent call last):
41.51     File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
41.51       main()
41.51     File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
41.51       json_out['return_val'] = hook(**hook_input['kwargs'])
41.51     File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 248, in build_wheel
41.51       return _build_backend().build_wheel(wheel_directory, config_settings,
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 404, in build_wheel
41.51       return self._build_with_temp_dir(
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
41.51       self.run_setup()
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 480, in run_setup
41.51       super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
41.51       exec(code, locals())
41.51     File "<string>", line 260, in <module>
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 103, in setup
41.51       return distutils.core.setup(**attrs)
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
41.51       return run_commands(dist)
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
41.51       dist.run_commands()
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
41.51       self.run_command(cmd)
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 963, in run_command
41.51       super().run_command(command)
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
41.51       cmd_obj.run()
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 368, in run
41.51       self.run_command("build")
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
41.51       self.distribution.run_command(command)
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 963, in run_command
41.51       super().run_command(command)
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
41.51       cmd_obj.run()
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
41.51       self.run_command(cmd_name)
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
41.51       self.distribution.run_command(command)
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 963, in run_command
41.51       super().run_command(command)
41.51     File "/tmp/pip-build-env-xcqft3av/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
41.51       cmd_obj.run()
41.51     File "<string>", line 134, in run
41.51     File "<string>", line 183, in build_cmake
41.51     File "/usr/lib64/python3.9/subprocess.py", line 373, in check_call
41.51       raise CalledProcessError(retcode, cmd)
41.51   subprocess.CalledProcessError: Command 'cmake /tmp/pip-install-_ubu77xj/uamqp_cf57c0fdfe2345c5bd53016e19645560/src/vendor/azure-uamqp-c/ -G "Unix Makefiles" -Duse_openssl:bool=ON -Duse_default_uuid:bool=ON  -Duse_builtin_httpapi:bool=ON  -Dskip_samples:bool=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release' returned non-zero exit status 1.
41.51   ----------------------------------------
41.51   ERROR: Failed building wheel for uamqp
41.51 Failed to build psutil uamqp
41.51 ERROR: Could not build wheels for psutil, uamqp which use PEP 517 and cannot be installed directly
------
Debug.Dockerfile:8
--------------------
   7 |     
   8 | >>> RUN ansible-galaxy collection install azure.azcollection && \
   9 | >>>     python3 -m pip install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
  10 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c ansible-galaxy collection install azure.azcollection &&     python3 -m pip install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt" did not complete successfully: exit code: 1
@Fred-sun
Copy link
Collaborator

Fred-sun commented Jan 4, 2024

@uccsjarmo Can you try following method?

FROM rockylinux:9.3

RUN dnf update -y && \
    dnf install -y ansible python3-pip

ENV PATH="/root/ansible/.local/bin:$PATH"

RUN ansible-galaxy collection install azure.azcollection && \
    python3 -m pip install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
FROM rockylinux:9.3

RUN dnf update -y && \
    dnf install -y python3-pip

ENV PATH="/root/ansible/.local/bin:$PATH"

RUN pip3 install ansible && ansible-galaxy collection install azure.azcollection && \
    python3 -m pip install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt

@Fred-sun Fred-sun added question Further information is requested medium_priority Medium priority work in In trying to solve, or in working with contributors labels Jan 4, 2024
@haaranenjarmo
Copy link

It will throw an error: Unable to find a match: ansible

image

dnf search ansible output is following

image

I think package name should be ansible-core

@Fred-sun
Copy link
Collaborator

Fred-sun commented Jan 8, 2024

@haaranenjarmo Thanks for your feedback! I will retry it!

@uccsjarmo
Copy link
Author

Problem is with uamqp package not in the collection. Azure/azure-uamqp-python#191

I got the installation working when I first removed the Python3.12 installation and used the Python3.11 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority question Further information is requested work in In trying to solve, or in working with contributors
Projects
None yet
Development

No branches or pull requests

3 participants