ansible / awx-ee

An Ansible execution environment for AWX project
https://quay.io/ansible/awx-ee
Other
137 stars 158 forks source link

Unable to build on arm #224

Open askipl opened 10 months ago

askipl commented 10 months ago

Hi, I've tried to build awx-ee on arm, it's failing currently (I've added gcc-c++ additional package so I fixed one issue) unfortunately still some errors: ...

#26 131.4   Created wheel for pykerberos: filename=pykerberos-1.2.4-cp39-cp39-linux_aarch64.whl size=61735 sha256=8c56b1438af72bb8d92ab4cb61788681718c74436aaee2b54891c2f0943162ae
#26 131.4   Stored in directory: /output/wheels/wheels/5c/f6/2c/0c802c0c3c90cb3b7f786bc638d812430e7801073d5bc590c1
#26 131.4   Building wheel for pendulum (pyproject.toml): started
#26 131.9   Building wheel for pendulum (pyproject.toml): finished with status 'error'
#26 132.0   error: subprocess-exited-with-error
#26 132.0   
#26 132.0   × Building wheel for pendulum (pyproject.toml) did not run successfully.
#26 132.0   │ exit code: 1
#26 132.0   ╰─> [28 lines of output]
#26 132.0       Traceback (most recent call last):
#26 132.0         File "/tmp/pip-install-j7lqibbh/pendulum_547928ff487342bb8531a8fc7ccf22c3/build.py", line 5, in <module>
#26 132.0           from distutils.command.build_ext import build_ext
#26 132.0         File "/usr/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 83, in create_module
#26 132.0           return importlib.import_module('setuptools._distutils')
#26 132.0         File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
#26 132.0           return _bootstrap._gcd_import(name[level:], package, level)
#26 132.0       ModuleNotFoundError: No module named 'setuptools'
#26 132.0       Traceback (most recent call last):
#26 132.0         File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
#26 132.0           main()
#26 132.0         File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
#26 132.0           json_out['return_val'] = hook(**hook_input['kwargs'])
#26 132.0         File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
#26 132.0           return _build_backend().build_wheel(wheel_directory, config_settings,
#26 132.0         File "/tmp/pip-build-env-s4tmxomh/overlay/lib/python3.9/site-packages/poetry/core/masonry/api.py", line 58, in build_wheel
#26 132.0           return WheelBuilder.make_in(
#26 132.0         File "/tmp/pip-build-env-s4tmxomh/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 88, in make_in
#26 132.0           wb.build(target_dir=directory)
#26 132.0         File "/tmp/pip-build-env-s4tmxomh/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 123, in build
#26 132.0           self._build(zip_file)
#26 132.0         File "/tmp/pip-build-env-s4tmxomh/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 172, in _build
#26 132.0           self._run_build_script(self._package.build_script)
#26 132.0         File "/tmp/pip-build-env-s4tmxomh/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 266, in _run_build_script
#26 132.0           subprocess.check_call([self.executable.as_posix(), build_script])
#26 132.0         File "/usr/lib64/python3.9/subprocess.py", line 373, in check_call
#26 132.0           raise CalledProcessError(retcode, cmd)
#26 132.0       subprocess.CalledProcessError: Command '['/usr/bin/python3', 'build.py']' returned non-zero exit status 1.
#26 132.0       [end of output]
#26 132.0   
#26 132.0   note: This error originates from a subprocess, and is likely not a problem with pip.
#26 132.0   ERROR: Failed building wheel for pendulum
#26 132.0   Building wheel for netifaces (pyproject.toml): started

On x86_64 no issues

shanemcd commented 10 months ago

This looks like an upstream issue with the pendulum library.

dsavineau commented 10 months ago

This is more a configuration issue in awx-ee definition (and/or ansible-builder bug).

Some python packages (like uamqp and pendulum) aren't available as wheel files on PyPi for arm64 architecture (unlike amd64) so they are built from sources. However, the current configuration doesn't provide all tools needed to build thoses packages from sources (like gcc-c++ for uamqp)

According the logs shared above, the setuptools dependency [1] is the culprit here:

ModuleNotFoundError: No module named 'setuptools'

But this seems weird to not have setuptools available during the assemble execution.

[1] https://github.com/sdispater/pendulum/blob/2.1.2/build.py#L5-L10

askipl commented 10 months ago

I've seen setuptools info, but unfortunately, I have no idea based scripts what is really running, I've checked on centos9 arm container and installed "pendulum pip" without any issues also tried to build from source also no issues :(