A package for ansible and its depends #53

Merged
PeterSurda merged 5 commits from lee.miller/openwrt:python into main 2023-10-25 07:36:14 +00:00
Collaborator

Hi!

Here are the packages for ansible-core and it's dependencies, I discovered.

Hi! Here are the packages for `ansible-core` and it's dependencies, I discovered.
lee.miller added 3 commits 2023-07-04 09:37:44 +00:00
Owner

It mostly seems to work but I'm getting this error which I didn't get when I installed it from pip. I did pip install ansible and not pip install ansible-core, but I think ansible-core is a better choice, assuming we can get it working.

root@OpenWrt:~# ansible localhost -vv -m setup
ansible [core 2.14.2]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Jul  1 2023, 13:54:25) [GCC 11.2.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
No config file found; using defaults
ERROR! Unable to load the cache plugin (memory).
root@OpenWrt:~# 
It mostly seems to work but I'm getting this error which I didn't get when I installed it from pip. I did `pip install ansible` and not `pip install ansible-core`, but I think ansible-core is a better choice, assuming we can get it working. ``` root@OpenWrt:~# ansible localhost -vv -m setup ansible [core 2.14.2] config file = None configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.10/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.10.12 (main, Jul 1 2023, 13:54:25) [GCC 11.2.0] (/usr/bin/python3) jinja version = 3.0.3 libyaml = True No config file found; using defaults ERROR! Unable to load the cache plugin (memory). root@OpenWrt:~# ```
Author
Collaborator

It mostly seems to work but I'm getting this error which I didn't get when I installed it from pip. I did pip install ansible and not pip install ansible-core, but I think ansible-core is a better choice, assuming we can get it working.

root@OpenWrt:~# ansible localhost -vv -m setup
ansible [core 2.14.2]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Jul  1 2023, 13:54:25) [GCC 11.2.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
No config file found; using defaults
ERROR! Unable to load the cache plugin (memory).
root@OpenWrt:~# 

Here https://github.com/ansible-community/molecule/issues/2444 they suggest to set a fact_caching_connection variable in the ansible config.

> It mostly seems to work but I'm getting this error which I didn't get when I installed it from pip. I did `pip install ansible` and not `pip install ansible-core`, but I think ansible-core is a better choice, assuming we can get it working. > > ``` > root@OpenWrt:~# ansible localhost -vv -m setup > ansible [core 2.14.2] > config file = None > configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] > ansible python module location = /usr/lib/python3.10/site-packages/ansible > ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections > executable location = /usr/bin/ansible > python version = 3.10.12 (main, Jul 1 2023, 13:54:25) [GCC 11.2.0] (/usr/bin/python3) > jinja version = 3.0.3 > libyaml = True > No config file found; using defaults > ERROR! Unable to load the cache plugin (memory). > root@OpenWrt:~# > ``` Here https://github.com/ansible-community/molecule/issues/2444 they suggest to set a `fact_caching_connection` variable in the ansible config.
Owner

I did further tests. Even if I override the config to change the cache to yaml and set a the fact_caching_connection to a path, it still prints the same error. Running strace brings up this:

newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/ansible/plugins/cache/__init__.pyc", {st_mode=S_IFREG|0644, st_size=12484, ...}, 0) = 0
newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/ansible/plugins/cache/base.pyc", {st_mode=S_IFREG|0644, st_size=368, ...}, 0) = 0
newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/ansible/plugins/cache/jsonfile.pyc", {st_mode=S_IFREG|0644, st_size=2293, ...}, 0) = 0
newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/ansible/plugins/cache/memory.pyc", {st_mode=S_IFREG|0644, st_size=2141, ...}, 0) = 0
newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/ansible/plugins/cache/memory.py", 0x7ffe334dc8, 0) = -1 ENOENT (No such file or directory)
write(2, "\33[0;31mERROR! Unable to load the"..., 60) = 60

For some reason it wants the source even though the compiled file is available. When I manually download the .py files it's looking for (from the ansible git repo) and place them in the corresponding directories, it gradually moves on. After I download memory.py, then it complains about the inventory. When I download an inventory plugin, then it complains about the stdout callback. If I upgrade ansible-core with pip, it deploys the .py files instead of the .pyc files, and ansible works. I'm not fully sure why this is happening, but maybe if the packaging is updated to include the sources, that would fix it.

I did further tests. Even if I override the config to change the cache to yaml and set a the `fact_caching_connection` to a path, it still prints the same error. Running `strace` brings up this: ``` newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/ansible/plugins/cache/__init__.pyc", {st_mode=S_IFREG|0644, st_size=12484, ...}, 0) = 0 newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/ansible/plugins/cache/base.pyc", {st_mode=S_IFREG|0644, st_size=368, ...}, 0) = 0 newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/ansible/plugins/cache/jsonfile.pyc", {st_mode=S_IFREG|0644, st_size=2293, ...}, 0) = 0 newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/ansible/plugins/cache/memory.pyc", {st_mode=S_IFREG|0644, st_size=2141, ...}, 0) = 0 newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/ansible/plugins/cache/memory.py", 0x7ffe334dc8, 0) = -1 ENOENT (No such file or directory) write(2, "\33[0;31mERROR! Unable to load the"..., 60) = 60 ``` For some reason it wants the source even though the compiled file is available. When I manually download the `.py` files it's looking for (from the ansible git repo) and place them in the corresponding directories, it gradually moves on. After I download `memory.py`, then it complains about the inventory. When I download an inventory plugin, then it complains about the stdout callback. If I upgrade ansible-core with pip, it deploys the `.py` files instead of the `.pyc` files, and ansible works. I'm not fully sure why this is happening, but maybe if the packaging is updated to include the sources, that would fix it.
lee.miller force-pushed python from 68693fb117 to 4604c6054a 2023-10-18 01:39:22 +00:00 Compare
Author
Collaborator

There is a python3-ansible-core-src package. I added it to PACKAGES. Maybe this helps.

There is a `python3-ansible-core-src` package. I added it to `PACKAGES`. Maybe this helps.
Owner

ok I'll test.

ok I'll test.
Author
Collaborator

Of course they have broken also resolvelib:

make[2]: Entering directory '/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/feed/resolvelib'
rm -f /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/pypi/resolvelib-0.9.0/.built
touch /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/pypi/resolvelib-0.9.0/.built_check
SHELL= flock /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/tmp/.pip.flock -c ' ARCH="x86_64" CC="gcc" CCSHARED="gcc -DPIC -fPIC" CXX="g++" LD="gcc" LDSHARED="gcc -shared" CFLAGS="-O2 -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/host/include -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/include -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_cortex-a72_musl/host/include" CPPFLAGS="-I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/host/include -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/include -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_cortex-a72_musl/host/include -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/include/python3.10" LDFLAGS="-L/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/host/lib -L/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/lib -L/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_cortex-a72_musl/host/lib -lpython3.10 -Wl,-rpath,/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/lib" PIP_CACHE_DIR="/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/dl/pip-cache" PIP_CONFIG_FILE=/dev/null PIP_DISABLE_PIP_VERSION_CHECK=1 /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/bin/pip3.10 install --no-binary :all: --progress-bar off --require-hashes  --requirement /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/feeds/packages/lang/python/host-pip-requirements/setuptools-scm.txt   --requirement /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/feeds/packages/lang/python/host-pip-requirements/toml.txt  ' 
WARNING: The directory '/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/dl/pip-cache' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
ERROR: Could not open requirements file: [Errno 2] No such file or directory: '/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/feeds/packages/lang/python/host-pip-requirements/setuptools-scm.txt'

So far I cannot found a solution for this. There is no host-pip-requirements dir in the container.

Of course they have broken also resolvelib: ``` make[2]: Entering directory '/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/feed/resolvelib' rm -f /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/pypi/resolvelib-0.9.0/.built touch /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a72_musl/pypi/resolvelib-0.9.0/.built_check SHELL= flock /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/tmp/.pip.flock -c ' ARCH="x86_64" CC="gcc" CCSHARED="gcc -DPIC -fPIC" CXX="g++" LD="gcc" LDSHARED="gcc -shared" CFLAGS="-O2 -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/host/include -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/include -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_cortex-a72_musl/host/include" CPPFLAGS="-I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/host/include -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/include -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_cortex-a72_musl/host/include -I/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/include/python3.10" LDFLAGS="-L/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/host/lib -L/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/lib -L/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_cortex-a72_musl/host/lib -lpython3.10 -Wl,-rpath,/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/lib" PIP_CACHE_DIR="/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/dl/pip-cache" PIP_CONFIG_FILE=/dev/null PIP_DISABLE_PIP_VERSION_CHECK=1 /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/staging_dir/hostpkg/bin/pip3.10 install --no-binary :all: --progress-bar off --require-hashes --requirement /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/feeds/packages/lang/python/host-pip-requirements/setuptools-scm.txt --requirement /openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/feeds/packages/lang/python/host-pip-requirements/toml.txt ' WARNING: The directory '/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/dl/pip-cache' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. ERROR: Could not open requirements file: [Errno 2] No such file or directory: '/openwrt-sdk-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64/feeds/packages/lang/python/host-pip-requirements/setuptools-scm.txt' ``` So far I cannot found a solution for this. There is no `host-pip-requirements` dir in the container.
lee.miller force-pushed python from 4604c6054a to 86890bf436 2023-10-24 01:54:34 +00:00 Compare
Owner

Is it this one that fixed it? 6a390b09c3

Let me test.

Is it this one that fixed it? https://github.com/openwrt/packages/commit/6a390b09c386b2caf3eca052b99610fd1a023942 Let me test.
Author
Collaborator

Is it this one that fixed it? 6a390b09c3

Let me test.

I updated resolvelib Makefile: 86890bf436

> Is it this one that fixed it? https://github.com/openwrt/packages/commit/6a390b09c386b2caf3eca052b99610fd1a023942 > > Let me test. I updated `resolvelib` Makefile: 86890bf436ced6040b1d3dc54e852120b647e8fd
lee.miller changed title from A package for ansible and it's depends to A package for ansible and its depends 2023-10-24 18:01:32 +00:00
Owner

What I meant was that previously host-pip-requirements was missing but in the upstream commit I posted they added it again.

Anyway I tested it and ansible now works, so I'm merging.

What I meant was that previously `host-pip-requirements` was missing but in the upstream commit I posted they added it again. Anyway I tested it and ansible now works, so I'm merging.
PeterSurda merged commit 86890bf436 into main 2023-10-25 07:36:14 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Sysdeploy/openwrt#53
No description provided.