Ansible execution environment: ModuleNotFoundError: No module named 'lxml'?
Ansible execution environment: ModuleNotFoundError: No module named 'lxml'?
当 运行 使用我的自定义执行环境的剧本时,即使安装了 lxml,我也会收到以下错误:
ModuleNotFoundError: No module named 'lxml'
如何确保 lxml 可用?
我构建执行环境的文件和过程...
execution-environment.yaml
:
---
version: 1
build_arg_defaults:
EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:stable-2.11-devel'
dependencies:
galaxy: requirements.yml
python: requirements.txt
additional_build_steps:
prepend:
- RUN pip install pip --upgrade
- RUN whoami
- RUN cat /etc/os-release
requirements.txt
:
jmespath==0.9.4
netaddr==0.7.19
pyvcloud==21.0.1
pyvcloud includes dependency for lxml
requirements.yml
:
---
collections:
- name: ansible.utils
version: 2.3.1
- name: community.general
- name: ansible.netcommon
构建图像日志:
ansible-builder build --tag=ee-vdc-provisioning -v3
Ansible Builder is building your execution environment image, "ee-vdc-provisioning".
File context/_build/requirements.yml is already up-to-date.
File context/_build/requirements.txt had modifications and will be rewritten
Rewriting Containerfile to capture collection requirements
Running command:
docker build -f context/Dockerfile -t ee-vdc-provisioning context
Sending build context to Docker daemon 5.12kB
Step 1/22 : ARG EE_BASE_IMAGE=quay.io/ansible/ansible-runner:stable-2.11-devel
Step 2/22 : ARG EE_BUILDER_IMAGE=quay.io/ansible/ansible-builder:latest
Step 3/22 : FROM $EE_BASE_IMAGE as galaxy
stable-2.11-devel: Pulling from ansible/ansible-runner
7a0437f04f83: Already exists
...
dea385bd2208: Pull complete
Digest: sha256:b5db8f78c5db830bd79589d926670cc6997a56e66ee1f4cf83f2d9600569489c
Status: Downloaded newer image for quay.io/ansible/ansible-runner:stable-2.11-devel
---> bac3a63558ef
Step 4/22 : ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=
---> Running in 4addc682993c
Removing intermediate container 4addc682993c
---> 76904e6db013
Step 5/22 : USER root
---> Running in c79b075ce2c1
Removing intermediate container c79b075ce2c1
---> b1e145b630fc
Step 6/22 : ADD _build /build
---> 0da78f554e57
Step 7/22 : WORKDIR /build
---> Running in d2d9e54e1deb
Removing intermediate container d2d9e54e1deb
---> b3eca50b6059
Step 8/22 : RUN ansible-galaxy role install -r requirements.yml --roles-path /usr/share/ansible/roles
---> Running in 65cb2c2993f6
Skipping install, no requirements found
Removing intermediate container 65cb2c2993f6
---> 7f9d44a54e1a
Step 9/22 : RUN ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path /usr/share/ansible/collections
---> Running in f3f2ae1f8933
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/download/ansible-utils-2.3.1.tar.gz to /home/runner/.ansible/tmp/ansible-local-1v97miv3n/tmpsqqgh1je/ansible-utils-2.3.1-7fqkmpu9
Installing 'ansible.utils:2.3.1' to '/usr/share/ansible/collections/ansible_collections/ansible/utils'
ansible.utils:2.3.1 was installed successfully
Downloading https://galaxy.ansible.com/download/ansible-netcommon-2.4.0.tar.gz to /home/runner/.ansible/tmp/ansible-local-1v97miv3n/tmpsqqgh1je/ansible-netcommon-2.4.0-lp5tkb63
Installing 'ansible.netcommon:2.4.0' to '/usr/share/ansible/collections/ansible_collections/ansible/netcommon'
ansible.netcommon:2.4.0 was installed successfully
Downloading https://galaxy.ansible.com/download/community-general-3.6.0.tar.gz to /home/runner/.ansible/tmp/ansible-local-1v97miv3n/tmpsqqgh1je/community-general-3.6.0-t9_6t8qg
Installing 'community.general:3.6.0' to '/usr/share/ansible/collections/ansible_collections/community/general'
community.general:3.6.0 was installed successfully
Removing intermediate container f3f2ae1f8933
---> b8af138c706f
Step 10/22 : FROM $EE_BUILDER_IMAGE as builder
---> b8aaf3766431
Step 11/22 : COPY --from=galaxy /usr/share/ansible /usr/share/ansible
---> Using cache
---> d0ae7f063c09
Step 12/22 : ADD _build/requirements.txt requirements.txt
---> b93f1b4efd85
Step 13/22 : RUN ansible-builder introspect --sanitize --user-pip=requirements.txt --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt
---> Running in ce1856981322
# Sanitized dependencies for /usr/share/ansible/collections
---
python:
- 'ansible-pylibssh>=0.2.0 # from collection ansible.netcommon'
- 'jxmlease # from collection ansible.netcommon'
- 'ncclient # from collection ansible.netcommon'
- 'netaddr==0.7.19 # from collection ansible.netcommon,user'
- 'paramiko # from collection ansible.netcommon'
- 'xmltodict # from collection ansible.netcommon,ansible.utils'
- 'jsonschema # from collection ansible.utils'
- 'textfsm # from collection ansible.utils'
- 'ttp # from collection ansible.utils'
- 'jmespath==0.9.4 # from collection user'
- 'pyvcloud==21.0.1 # from collection user'
system:
- 'gcc-c++ [doc test platform:rpm] # from collection ansible.netcommon, ansible.utils'
- 'libyaml-devel [test platform:rpm] # from collection ansible.netcommon'
- 'libyaml-dev [test platform:dpkg] # from collection ansible.netcommon'
- 'python3-devel [test platform:rpm] # from collection ansible.netcommon, ansible.utils'
- 'python3 [test platform:rpm] # from collection ansible.netcommon, ansible.utils'
- 'gcc [compile platform:centos-8 platform:rhel-8] # from collection ansible.netcommon,
ansible.netcommon'
- 'libssh-devel [compile platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-Cython [compile platform:centos-8 platform:rhel-8] # from collection
ansible.netcommon'
- 'python38-six [platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-lxml [platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'findutils [compile platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'make [compile platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-devel [compile platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-cffi [platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-cryptography [platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-pycparser [platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
Creating parent directory for /tmp/src/requirements.txt
Removing intermediate container ce1856981322
---> 4c6b34447822
Step 14/22 : RUN assemble
---> Running in f55f696895c9
++ source /etc/os-release
+++ NAME='CentOS Linux'
+++ VERSION=8
+++ ID=centos
+++ ID_LIKE='rhel fedora'
+++ VERSION_ID=8
+++ PLATFORM_ID=platform:el8
+++ PRETTY_NAME='CentOS Linux 8'
+++ ANSI_COLOR='0;31'
+++ CPE_NAME=cpe:/o:centos:centos:8
+++ HOME_URL=https://centos.org/
+++ BUG_REPORT_URL=https://bugs.centos.org/
+++ CENTOS_MANTISBT_PROJECT=CentOS-8
+++ CENTOS_MANTISBT_PROJECT_VERSION=8
++ echo centos
+ RELEASE=centos
+ PKGMGR=
+ PKGMGR_OPTS=
+ '[' -z ']'
+ PKGMGR=/usr/bin/dnf
+ '[' -f /usr/bin/microdnf ']'
+ mkdir -p /output/bindep
+ mkdir -p /output/wheels
+ mkdir -p /tmp/src
+ cd /tmp/src
+ /usr/bin/dnf update -y
CentOS Linux 8 - AppStream 3.3 MB/s | 8.8 MB 00:02
CentOS Linux 8 - BaseOS 10 MB/s | 5.6 MB 00:00
CentOS Linux 8 - Extras 4.6 kB/s | 10 kB 00:02
CentOS Linux 8 - PowerTools 2.2 MB/s | 2.3 MB 00:01
Extra Packages for Enterprise Linux Modular 8 - 561 kB/s | 939 kB 00:01
Dependencies resolved.
Nothing to do.
Complete!
+ PACKAGES=
+ PIP_OPTS=
+ install_bindep
+ '[' -f bindep.txt ']'
+ bindep -l newline
+ sort
+ '[' centos == centos ']'
+ bindep -l newline -b epel
+ sort
+ grep -Fxvf /output/bindep/run.txt /output/bindep/stage.txt
+ true
+ rm -rf /output/bindep/stage.txt
++ bindep -b compile
++ true
+ compile_packages='gcc
libssh-devel
make
python38-Cython
python38-cffi
python38-cryptography
python38-devel
python38-lxml
python38-pycparser
python38-six'
+ '[' '!' -z 'gcc
libssh-devel
make
python38-Cython
python38-cffi
python38-cryptography
python38-devel
python38-lxml
python38-pycparser
python38-six' ']'
+ /usr/bin/dnf install -y gcc libssh-devel make python38-Cython python38-cffi python38-cryptography python38-devel python38-lxml python38-pycparser python38-six
Last metadata expiration check: 0:00:10 ago on Wed Sep 8 06:32:08 2021.
Dependencies resolved.
Downloading Packages:
...
(15/29): python38-lxml-4.4.1-5.module_el8.4.0+6 4.0 MB/s | 1.5 MB 00:00
...
--------------------------------------------------------------------------------
Total 6.1 MB/s | 51 MB 00:08
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libmpc-1.1.0-9.1.el8.x86_64 1/29
Installing : cpp-8.4.1-1.el8.x86_64 2/29
...
Verifying : python38-lxml-4.4.1-5.module_el8.4.0+647+0ba99ce8. 13/29
...
Installed:
cmake-filesystem-3.18.2-11.el8_4.x86_64
cpp-8.4.1-1.el8.x86_64
gcc-8.4.1-1.el8.x86_64
....
python38-lxml-4.4.1-5.module_el8.4.0+647+0ba99ce8.x86_64
...
Complete!
+ python3 -m venv /tmp/venv --system-site-packages --without-pip
+ source /tmp/venv/bin/activate
++ deactivate nondestructive
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n /bin/bash -o -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/tmp/venv
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/tmp/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ export PATH
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ '[' 'x(venv) ' '!=' x ']'
++ PS1='(venv) '
++ export PS1
++ '[' -n /bin/bash -o -n '' ']'
++ hash -r
+ '[' -f /tmp/src/upper-constraints.txt ']'
+ [[ -n '' ]]
+ install_wheels
+ '[' -f /tmp/src/build-requirements.txt ']'
+ '[' -f setup.py ']'
+ '[' -f /tmp/src/requirements.txt ']'
+ '[' '!' -f /output/requirements.txt ']'
+ pip3 install --cache-dir=/output/wheels -r /tmp/src/requirements.txt
Collecting ansible-pylibssh>=0.2.0
Downloading ansible_pylibssh-0.2.0-cp38-cp38-manylinux2014_x86_64.whl (2.2 MB)
Collecting jxmlease
Downloading jxmlease-1.0.3-py2.py3-none-any.whl (37 kB)
Collecting ncclient
Downloading ncclient-0.6.12.tar.gz (106 kB)
Collecting netaddr==0.7.19
Downloading netaddr-0.7.19-py2.py3-none-any.whl (1.6 MB)
Collecting paramiko
Downloading paramiko-2.7.2-py2.py3-none-any.whl (206 kB)
Collecting xmltodict
Downloading xmltodict-0.12.0-py2.py3-none-any.whl (9.2 kB)
Collecting jsonschema
Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting textfsm
Downloading textfsm-1.1.2-py2.py3-none-any.whl (44 kB)
Collecting ttp
Downloading ttp-0.7.2.tar.gz (63 kB)
Collecting jmespath==0.9.4
Downloading jmespath-0.9.4-py2.py3-none-any.whl (24 kB)
Collecting pyvcloud==21.0.1
Downloading pyvcloud-21.0.1-py3-none-any.whl (204 kB)
Requirement already satisfied: lxml>=4.2.1 in /usr/lib64/python3.8/site-packages (from pyvcloud==21.0.1->-r /tmp/src/requirements.txt (line 11)) (4.4.1)
Collecting humanfriendly>=4.8
Downloading humanfriendly-9.2-py2.py3-none-any.whl (86 kB)
Collecting unittest-xml-reporting>=2.2.1
Downloading unittest_xml_reporting-3.0.4-py2.py3-none-any.whl (19 kB)
Collecting requests>=2.18.4
Downloading requests-2.26.0-py2.py3-none-any.whl (62 kB)
Requirement already satisfied: PyYAML>=4.2b1 in /usr/local/lib64/python3.8/site-packages (from pyvcloud==21.0.1->-r /tmp/src/requirements.txt (line 11)) (5.4.1)
Collecting pygments>=2.2.0
Downloading Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Requirement already satisfied: setuptools>0.6 in /usr/lib/python3.8/site-packages (from ncclient->-r /tmp/src/requirements.txt (line 3)) (41.6.0)
Requirement already satisfied: six in /usr/lib/python3.8/site-packages (from ncclient->-r /tmp/src/requirements.txt (line 3)) (1.12.0)
Collecting bcrypt>=3.1.3
Downloading bcrypt-3.2.0-cp36-abi3-manylinux2010_x86_64.whl (63 kB)
Requirement already satisfied: cryptography>=2.5 in /usr/lib64/python3.8/site-packages (from paramiko->-r /tmp/src/requirements.txt (line 5)) (2.8)
Collecting pynacl>=1.0.1
Downloading PyNaCl-1.4.0-cp35-abi3-manylinux1_x86_64.whl (961 kB)
Collecting pyrsistent>=0.14.0
Downloading pyrsistent-0.18.0-cp38-cp38-manylinux1_x86_64.whl (118 kB)
Collecting attrs>=17.4.0
Downloading attrs-21.2.0-py2.py3-none-any.whl (53 kB)
Collecting future
Downloading future-0.18.2.tar.gz (829 kB)
Requirement already satisfied: cffi>=1.1 in /usr/lib64/python3.8/site-packages (from bcrypt>=3.1.3->paramiko->-r /tmp/src/requirements.txt (line 5)) (1.13.2)
Requirement already satisfied: pycparser in /usr/lib/python3.8/site-packages (from cffi>=1.1->bcrypt>=3.1.3->paramiko->-r /tmp/src/requirements.txt (line 5)) (2.19)
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
Collecting certifi>=2017.4.17
Downloading certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting charset-normalizer~=2.0.0
Downloading charset_normalizer-2.0.4-py3-none-any.whl (36 kB)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.8/site-packages (from requests>=2.18.4->pyvcloud==21.0.1->-r /tmp/src/requirements.txt (line 11)) (2.8)
Building wheels for collected packages: ncclient, ttp, future
Building wheel for ncclient (setup.py): started
Building wheel for ncclient (setup.py): finished with status 'done'
Created wheel for ncclient: filename=ncclient-0.6.12-py2.py3-none-any.whl size=83781 sha256=ab7ff67d84af8ee205b2127d84facfe7c3004ac2baf7f9044992d8611c1f9aba
Stored in directory: /output/wheels/wheels/b2/ea/95/9bdf798bf88d883a5ee9536d8a483042030d182ab252953b9d
Building wheel for ttp (setup.py): started
Building wheel for ttp (setup.py): finished with status 'done'
Created wheel for ttp: filename=ttp-0.7.2-py2.py3-none-any.whl size=82592 sha256=4128235c837b71ad65b52aeab39073636cba7aabdfe6e67aa0bf1822d56758d6
Stored in directory: /output/wheels/wheels/a5/e9/86/589e41ee5c74286a197095d4aabff1896eea950bb45ea593be
Building wheel for future (setup.py): started
Building wheel for future (setup.py): finished with status 'done'
Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491056 sha256=9aa6ce7d6e6150df9cfa35c0debb6e450d447eaec1789a03e34d9bc47084859a
Stored in directory: /output/wheels/wheels/8e/70/28/3d6ccd6e315f65f245da085482a2e1c7d14b90b30f239e2cf4
Successfully built ncclient ttp future
Installing collected packages: urllib3, pynacl, charset-normalizer, certifi, bcrypt, unittest-xml-reporting, requests, pyrsistent, pygments, paramiko, humanfriendly, future, attrs, xmltodict, ttp, textfsm, pyvcloud, netaddr, ncclient, jxmlease, jsonschema, jmespath, ansible-pylibssh
Successfully installed ansible-pylibssh-0.2.0 attrs-21.2.0 bcrypt-3.2.0 certifi-2021.5.30 charset-normalizer-2.0.4 future-0.18.2 humanfriendly-9.2 jmespath-0.9.4 jsonschema-3.2.0 jxmlease-1.0.3 ncclient-0.6.12 netaddr-0.7.19 paramiko-2.7.2 pygments-2.10.0 pynacl-1.4.0 pyrsistent-0.18.0 pyvcloud-21.0.1 requests-2.26.0 textfsm-1.1.2 ttp-0.7.2 unittest-xml-reporting-3.0.4 urllib3-1.26.6 xmltodict-0.12.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
+ cp /tmp/src/requirements.txt /output/requirements.txt
++ ls -1 '/output/wheels/*whl'
++ wc -l
+ '[' 0 -gt 0 ']'
++ get-extras-packages
+ /usr/bin/dnf clean all
38 files removed
+ rm -rf /var/cache/dnf /var/cache/yum
+ rm -rf /var/lib/dnf/history.sqlite /var/lib/dnf/history.sqlite-shm /var/lib/dnf/history.sqlite-wal
+ rm -rf /var/log/dnf.librepo.log /var/log/dnf.log /var/log/dnf.rpm.log /var/log/hawkey.log
+ rm -rf /tmp/venv
Removing intermediate container f55f696895c9
---> f52fd8437571
Step 15/22 : FROM $EE_BASE_IMAGE
---> bac3a63558ef
Step 16/22 : USER root
---> Running in fc6888e27374
Removing intermediate container fc6888e27374
---> ee14881aa582
Step 17/22 : RUN pip install pip --upgrade
---> Running in d7f03db5ab97
Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages (21.2.4)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Removing intermediate container d7f03db5ab97
---> 1b7904758bf0
Step 18/22 : RUN whoami
---> Running in 161168263f0f
root
Removing intermediate container 161168263f0f
---> 1e54d5ebed25
Step 19/22 : RUN cat /etc/os-release
---> Running in 8f2e3985f498
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
Removing intermediate container 8f2e3985f498
---> 7aa8d50dcc2b
Step 20/22 : COPY --from=galaxy /usr/share/ansible /usr/share/ansible
---> c1f18affa806
Step 21/22 : COPY --from=builder /output/ /output/
---> b237b7b29502
Step 22/22 : RUN /output/install-from-bindep && rm -rf /output/wheels
---> Running in 52b7c2a29525
+ PKGMGR=
+ PKGMGR_OPTS=
+ '[' -z ']'
+ PKGMGR=/usr/bin/dnf
+ '[' -f /usr/bin/microdnf ']'
+ /usr/bin/dnf update -y
CentOS Linux 8 - AppStream 4.1 MB/s | 8.8 MB 00:02
CentOS Linux 8 - BaseOS 7.0 MB/s | 5.6 MB 00:00
CentOS Linux 8 - Extras 13 kB/s | 10 kB 00:00
CentOS Linux 8 - PowerTools 3.0 MB/s | 2.3 MB 00:00
Extra Packages for Enterprise Linux Modular 8 - 512 kB/s | 939 kB 00:01
Last metadata expiration check: 0:00:01 ago on Wed Sep 8 06:33:45 2021.
Dependencies resolved.
Nothing to do.
Complete!
+ '[' -f /output/bindep/run.txt ']'
++ cat /output/bindep/run.txt
+ PACKAGES='python38-cffi
python38-cryptography
python38-lxml
python38-pycparser
python38-six'
+ '[' '!' -z 'python38-cffi
python38-cryptography
python38-lxml
python38-pycparser
python38-six' ']'
+ /usr/bin/dnf install -y python38-cffi python38-cryptography python38-lxml python38-pycparser python38-six
Last metadata expiration check: 0:00:04 ago on Wed Sep 8 06:33:45 2021.
Package python38-cffi-1.13.2-3.module_el8.4.0+647+0ba99ce8.x86_64 is already installed.
Package python38-cryptography-2.8-3.module_el8.4.0+647+0ba99ce8.x86_64 is already installed.
Package python38-lxml-4.4.1-5.module_el8.4.0+647+0ba99ce8.x86_64 is already installed.
Package python38-pycparser-2.19-3.module_el8.4.0+647+0ba99ce8.noarch is already installed.
Package python38-six-1.12.0-10.module_el8.4.0+647+0ba99ce8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
+ '[' -f /output/bindep/epel.txt ']'
++ cat /output/bindep/epel.txt
+ EPEL_PACKAGES=
+ '[' '!' -z '' ']'
+ '[' -f /output/upper-constraints.txt ']'
+ '[' -f /output/requirements.txt ']'
+ pip3 install --cache-dir=/output/wheels -r /output/requirements.txt
Collecting ansible-pylibssh>=0.2.0
Using cached ansible_pylibssh-0.2.0-cp38-cp38-manylinux2014_x86_64.whl (2.2 MB)
Collecting jxmlease
Using cached jxmlease-1.0.3-py2.py3-none-any.whl (37 kB)
Requirement already satisfied: ncclient in /usr/local/lib/python3.8/site-packages (from -r /output/requirements.txt (line 3)) (0.6.12)
Collecting netaddr==0.7.19
Using cached netaddr-0.7.19-py2.py3-none-any.whl (1.6 MB)
Requirement already satisfied: paramiko in /usr/local/lib/python3.8/site-packages (from -r /output/requirements.txt (line 5)) (2.7.2)
Requirement already satisfied: xmltodict in /usr/local/lib/python3.8/site-packages (from -r /output/requirements.txt (line 6)) (0.12.0)
Collecting jsonschema
Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting textfsm
Using cached textfsm-1.1.2-py2.py3-none-any.whl (44 kB)
Collecting ttp
Using cached ttp-0.7.2-py2.py3-none-any.whl
Collecting jmespath==0.9.4
Using cached jmespath-0.9.4-py2.py3-none-any.whl (24 kB)
Collecting pyvcloud==21.0.1
Using cached pyvcloud-21.0.1-py3-none-any.whl (204 kB)
Collecting unittest-xml-reporting>=2.2.1
Using cached unittest_xml_reporting-3.0.4-py2.py3-none-any.whl (19 kB)
Collecting pygments>=2.2.0
Using cached Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Requirement already satisfied: PyYAML>=4.2b1 in /usr/lib64/python3.8/site-packages (from pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (5.4.1)
Requirement already satisfied: lxml>=4.2.1 in /usr/lib64/python3.8/site-packages (from pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (4.4.1)
Collecting humanfriendly>=4.8
Using cached humanfriendly-9.2-py2.py3-none-any.whl (86 kB)
Requirement already satisfied: requests>=2.18.4 in /usr/lib/python3.8/site-packages (from pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (2.22.0)
Requirement already satisfied: six in /usr/lib/python3.8/site-packages (from ncclient->-r /output/requirements.txt (line 3)) (1.12.0)
Requirement already satisfied: setuptools>0.6 in /usr/lib/python3.8/site-packages (from ncclient->-r /output/requirements.txt (line 3)) (41.6.0)
Requirement already satisfied: pynacl>=1.0.1 in /usr/local/lib64/python3.8/site-packages (from paramiko->-r /output/requirements.txt (line 5)) (1.4.0)
Requirement already satisfied: bcrypt>=3.1.3 in /usr/local/lib64/python3.8/site-packages (from paramiko->-r /output/requirements.txt (line 5)) (3.2.0)
Requirement already satisfied: cryptography>=2.5 in /usr/lib64/python3.8/site-packages (from paramiko->-r /output/requirements.txt (line 5)) (2.8)
Collecting pyrsistent>=0.14.0
Using cached pyrsistent-0.18.0-cp38-cp38-manylinux1_x86_64.whl (118 kB)
Collecting attrs>=17.4.0
Using cached attrs-21.2.0-py2.py3-none-any.whl (53 kB)
Collecting future
Using cached future-0.18.2-py3-none-any.whl
Requirement already satisfied: cffi>=1.1 in /usr/lib64/python3.8/site-packages (from bcrypt>=3.1.3->paramiko->-r /output/requirements.txt (line 5)) (1.13.2)
Requirement already satisfied: pycparser in /usr/lib/python3.8/site-packages (from cffi>=1.1->bcrypt>=3.1.3->paramiko->-r /output/requirements.txt (line 5)) (2.19)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3.8/site-packages (from requests>=2.18.4->pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python3.8/site-packages (from requests>=2.18.4->pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (2.8)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/lib/python3.8/site-packages (from requests>=2.18.4->pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (1.25.7)
Installing collected packages: unittest-xml-reporting, pyrsistent, pygments, humanfriendly, future, attrs, ttp, textfsm, pyvcloud, netaddr, jxmlease, jsonschema, jmespath, ansible-pylibssh
Successfully installed ansible-pylibssh-0.2.0 attrs-21.2.0 future-0.18.2 humanfriendly-9.2 jmespath-0.9.4 jsonschema-3.2.0 jxmlease-1.0.3 netaddr-0.7.19 pygments-2.10.0 pyrsistent-0.18.0 pyvcloud-21.0.1 textfsm-1.1.2 ttp-0.7.2 unittest-xml-reporting-3.0.4
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
+ EXTRAS=
+ '[' -f /output/packages.txt ']'
++ ls -1 '/output/wheels/*whl'
++ wc -l
+ '[' 0 -gt 0 ']'
+ '[' '!' -z '' ']'
+ /usr/bin/dnf clean all
38 files removed
+ rm -rf /var/cache/dnf /var/cache/yum
+ rm -rf /var/lib/dnf/history.sqlite /var/lib/dnf/history.sqlite-shm /var/lib/dnf/history.sqlite-wal
+ rm -rf /var/log/dnf.librepo.log /var/log/dnf.log /var/log/dnf.rpm.log /var/log/hawkey.log
Removing intermediate container 52b7c2a29525
---> 546ab86ee4cb
Successfully built 546ab86ee4cb
Successfully tagged ee-vdc-provisioning:latest
Complete! The build context can be found at: /repo/awx/execution_environments/vdc_provisioning/context
确保添加 bindep.txt
文件:
python38-devel [platform:rpm compile]
subversion [platform:rpm]
subversion [platform:dpkg]
git-lfs [platform:rpm]
并将其添加到您的 execution-environment.yml
:
dependencies:
galaxy: requirements.yml
python: requirements.txt
system: bindep.txt
其他人必须解释系统级依赖项是什么,但这是文档所说的,lxml
没有它就无法工作:
The bindep requirements file specifies cross-platform requirements, if there are any. These get processed by bindep and then passed to dnf (other platforms are not yet supported as of the publication of this blog post)
当 运行 使用我的自定义执行环境的剧本时,即使安装了 lxml,我也会收到以下错误:
ModuleNotFoundError: No module named 'lxml'
如何确保 lxml 可用?
我构建执行环境的文件和过程...
execution-environment.yaml
:
---
version: 1
build_arg_defaults:
EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:stable-2.11-devel'
dependencies:
galaxy: requirements.yml
python: requirements.txt
additional_build_steps:
prepend:
- RUN pip install pip --upgrade
- RUN whoami
- RUN cat /etc/os-release
requirements.txt
:
jmespath==0.9.4
netaddr==0.7.19
pyvcloud==21.0.1
pyvcloud includes dependency for lxml
requirements.yml
:
---
collections:
- name: ansible.utils
version: 2.3.1
- name: community.general
- name: ansible.netcommon
构建图像日志:
ansible-builder build --tag=ee-vdc-provisioning -v3
Ansible Builder is building your execution environment image, "ee-vdc-provisioning".
File context/_build/requirements.yml is already up-to-date.
File context/_build/requirements.txt had modifications and will be rewritten
Rewriting Containerfile to capture collection requirements
Running command:
docker build -f context/Dockerfile -t ee-vdc-provisioning context
Sending build context to Docker daemon 5.12kB
Step 1/22 : ARG EE_BASE_IMAGE=quay.io/ansible/ansible-runner:stable-2.11-devel
Step 2/22 : ARG EE_BUILDER_IMAGE=quay.io/ansible/ansible-builder:latest
Step 3/22 : FROM $EE_BASE_IMAGE as galaxy
stable-2.11-devel: Pulling from ansible/ansible-runner
7a0437f04f83: Already exists
...
dea385bd2208: Pull complete
Digest: sha256:b5db8f78c5db830bd79589d926670cc6997a56e66ee1f4cf83f2d9600569489c
Status: Downloaded newer image for quay.io/ansible/ansible-runner:stable-2.11-devel
---> bac3a63558ef
Step 4/22 : ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=
---> Running in 4addc682993c
Removing intermediate container 4addc682993c
---> 76904e6db013
Step 5/22 : USER root
---> Running in c79b075ce2c1
Removing intermediate container c79b075ce2c1
---> b1e145b630fc
Step 6/22 : ADD _build /build
---> 0da78f554e57
Step 7/22 : WORKDIR /build
---> Running in d2d9e54e1deb
Removing intermediate container d2d9e54e1deb
---> b3eca50b6059
Step 8/22 : RUN ansible-galaxy role install -r requirements.yml --roles-path /usr/share/ansible/roles
---> Running in 65cb2c2993f6
Skipping install, no requirements found
Removing intermediate container 65cb2c2993f6
---> 7f9d44a54e1a
Step 9/22 : RUN ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path /usr/share/ansible/collections
---> Running in f3f2ae1f8933
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/download/ansible-utils-2.3.1.tar.gz to /home/runner/.ansible/tmp/ansible-local-1v97miv3n/tmpsqqgh1je/ansible-utils-2.3.1-7fqkmpu9
Installing 'ansible.utils:2.3.1' to '/usr/share/ansible/collections/ansible_collections/ansible/utils'
ansible.utils:2.3.1 was installed successfully
Downloading https://galaxy.ansible.com/download/ansible-netcommon-2.4.0.tar.gz to /home/runner/.ansible/tmp/ansible-local-1v97miv3n/tmpsqqgh1je/ansible-netcommon-2.4.0-lp5tkb63
Installing 'ansible.netcommon:2.4.0' to '/usr/share/ansible/collections/ansible_collections/ansible/netcommon'
ansible.netcommon:2.4.0 was installed successfully
Downloading https://galaxy.ansible.com/download/community-general-3.6.0.tar.gz to /home/runner/.ansible/tmp/ansible-local-1v97miv3n/tmpsqqgh1je/community-general-3.6.0-t9_6t8qg
Installing 'community.general:3.6.0' to '/usr/share/ansible/collections/ansible_collections/community/general'
community.general:3.6.0 was installed successfully
Removing intermediate container f3f2ae1f8933
---> b8af138c706f
Step 10/22 : FROM $EE_BUILDER_IMAGE as builder
---> b8aaf3766431
Step 11/22 : COPY --from=galaxy /usr/share/ansible /usr/share/ansible
---> Using cache
---> d0ae7f063c09
Step 12/22 : ADD _build/requirements.txt requirements.txt
---> b93f1b4efd85
Step 13/22 : RUN ansible-builder introspect --sanitize --user-pip=requirements.txt --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt
---> Running in ce1856981322
# Sanitized dependencies for /usr/share/ansible/collections
---
python:
- 'ansible-pylibssh>=0.2.0 # from collection ansible.netcommon'
- 'jxmlease # from collection ansible.netcommon'
- 'ncclient # from collection ansible.netcommon'
- 'netaddr==0.7.19 # from collection ansible.netcommon,user'
- 'paramiko # from collection ansible.netcommon'
- 'xmltodict # from collection ansible.netcommon,ansible.utils'
- 'jsonschema # from collection ansible.utils'
- 'textfsm # from collection ansible.utils'
- 'ttp # from collection ansible.utils'
- 'jmespath==0.9.4 # from collection user'
- 'pyvcloud==21.0.1 # from collection user'
system:
- 'gcc-c++ [doc test platform:rpm] # from collection ansible.netcommon, ansible.utils'
- 'libyaml-devel [test platform:rpm] # from collection ansible.netcommon'
- 'libyaml-dev [test platform:dpkg] # from collection ansible.netcommon'
- 'python3-devel [test platform:rpm] # from collection ansible.netcommon, ansible.utils'
- 'python3 [test platform:rpm] # from collection ansible.netcommon, ansible.utils'
- 'gcc [compile platform:centos-8 platform:rhel-8] # from collection ansible.netcommon,
ansible.netcommon'
- 'libssh-devel [compile platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-Cython [compile platform:centos-8 platform:rhel-8] # from collection
ansible.netcommon'
- 'python38-six [platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-lxml [platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'findutils [compile platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'make [compile platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-devel [compile platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-cffi [platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-cryptography [platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
- 'python38-pycparser [platform:centos-8 platform:rhel-8] # from collection ansible.netcommon'
Creating parent directory for /tmp/src/requirements.txt
Removing intermediate container ce1856981322
---> 4c6b34447822
Step 14/22 : RUN assemble
---> Running in f55f696895c9
++ source /etc/os-release
+++ NAME='CentOS Linux'
+++ VERSION=8
+++ ID=centos
+++ ID_LIKE='rhel fedora'
+++ VERSION_ID=8
+++ PLATFORM_ID=platform:el8
+++ PRETTY_NAME='CentOS Linux 8'
+++ ANSI_COLOR='0;31'
+++ CPE_NAME=cpe:/o:centos:centos:8
+++ HOME_URL=https://centos.org/
+++ BUG_REPORT_URL=https://bugs.centos.org/
+++ CENTOS_MANTISBT_PROJECT=CentOS-8
+++ CENTOS_MANTISBT_PROJECT_VERSION=8
++ echo centos
+ RELEASE=centos
+ PKGMGR=
+ PKGMGR_OPTS=
+ '[' -z ']'
+ PKGMGR=/usr/bin/dnf
+ '[' -f /usr/bin/microdnf ']'
+ mkdir -p /output/bindep
+ mkdir -p /output/wheels
+ mkdir -p /tmp/src
+ cd /tmp/src
+ /usr/bin/dnf update -y
CentOS Linux 8 - AppStream 3.3 MB/s | 8.8 MB 00:02
CentOS Linux 8 - BaseOS 10 MB/s | 5.6 MB 00:00
CentOS Linux 8 - Extras 4.6 kB/s | 10 kB 00:02
CentOS Linux 8 - PowerTools 2.2 MB/s | 2.3 MB 00:01
Extra Packages for Enterprise Linux Modular 8 - 561 kB/s | 939 kB 00:01
Dependencies resolved.
Nothing to do.
Complete!
+ PACKAGES=
+ PIP_OPTS=
+ install_bindep
+ '[' -f bindep.txt ']'
+ bindep -l newline
+ sort
+ '[' centos == centos ']'
+ bindep -l newline -b epel
+ sort
+ grep -Fxvf /output/bindep/run.txt /output/bindep/stage.txt
+ true
+ rm -rf /output/bindep/stage.txt
++ bindep -b compile
++ true
+ compile_packages='gcc
libssh-devel
make
python38-Cython
python38-cffi
python38-cryptography
python38-devel
python38-lxml
python38-pycparser
python38-six'
+ '[' '!' -z 'gcc
libssh-devel
make
python38-Cython
python38-cffi
python38-cryptography
python38-devel
python38-lxml
python38-pycparser
python38-six' ']'
+ /usr/bin/dnf install -y gcc libssh-devel make python38-Cython python38-cffi python38-cryptography python38-devel python38-lxml python38-pycparser python38-six
Last metadata expiration check: 0:00:10 ago on Wed Sep 8 06:32:08 2021.
Dependencies resolved.
Downloading Packages:
...
(15/29): python38-lxml-4.4.1-5.module_el8.4.0+6 4.0 MB/s | 1.5 MB 00:00
...
--------------------------------------------------------------------------------
Total 6.1 MB/s | 51 MB 00:08
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libmpc-1.1.0-9.1.el8.x86_64 1/29
Installing : cpp-8.4.1-1.el8.x86_64 2/29
...
Verifying : python38-lxml-4.4.1-5.module_el8.4.0+647+0ba99ce8. 13/29
...
Installed:
cmake-filesystem-3.18.2-11.el8_4.x86_64
cpp-8.4.1-1.el8.x86_64
gcc-8.4.1-1.el8.x86_64
....
python38-lxml-4.4.1-5.module_el8.4.0+647+0ba99ce8.x86_64
...
Complete!
+ python3 -m venv /tmp/venv --system-site-packages --without-pip
+ source /tmp/venv/bin/activate
++ deactivate nondestructive
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n /bin/bash -o -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/tmp/venv
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/tmp/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ export PATH
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ '[' 'x(venv) ' '!=' x ']'
++ PS1='(venv) '
++ export PS1
++ '[' -n /bin/bash -o -n '' ']'
++ hash -r
+ '[' -f /tmp/src/upper-constraints.txt ']'
+ [[ -n '' ]]
+ install_wheels
+ '[' -f /tmp/src/build-requirements.txt ']'
+ '[' -f setup.py ']'
+ '[' -f /tmp/src/requirements.txt ']'
+ '[' '!' -f /output/requirements.txt ']'
+ pip3 install --cache-dir=/output/wheels -r /tmp/src/requirements.txt
Collecting ansible-pylibssh>=0.2.0
Downloading ansible_pylibssh-0.2.0-cp38-cp38-manylinux2014_x86_64.whl (2.2 MB)
Collecting jxmlease
Downloading jxmlease-1.0.3-py2.py3-none-any.whl (37 kB)
Collecting ncclient
Downloading ncclient-0.6.12.tar.gz (106 kB)
Collecting netaddr==0.7.19
Downloading netaddr-0.7.19-py2.py3-none-any.whl (1.6 MB)
Collecting paramiko
Downloading paramiko-2.7.2-py2.py3-none-any.whl (206 kB)
Collecting xmltodict
Downloading xmltodict-0.12.0-py2.py3-none-any.whl (9.2 kB)
Collecting jsonschema
Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting textfsm
Downloading textfsm-1.1.2-py2.py3-none-any.whl (44 kB)
Collecting ttp
Downloading ttp-0.7.2.tar.gz (63 kB)
Collecting jmespath==0.9.4
Downloading jmespath-0.9.4-py2.py3-none-any.whl (24 kB)
Collecting pyvcloud==21.0.1
Downloading pyvcloud-21.0.1-py3-none-any.whl (204 kB)
Requirement already satisfied: lxml>=4.2.1 in /usr/lib64/python3.8/site-packages (from pyvcloud==21.0.1->-r /tmp/src/requirements.txt (line 11)) (4.4.1)
Collecting humanfriendly>=4.8
Downloading humanfriendly-9.2-py2.py3-none-any.whl (86 kB)
Collecting unittest-xml-reporting>=2.2.1
Downloading unittest_xml_reporting-3.0.4-py2.py3-none-any.whl (19 kB)
Collecting requests>=2.18.4
Downloading requests-2.26.0-py2.py3-none-any.whl (62 kB)
Requirement already satisfied: PyYAML>=4.2b1 in /usr/local/lib64/python3.8/site-packages (from pyvcloud==21.0.1->-r /tmp/src/requirements.txt (line 11)) (5.4.1)
Collecting pygments>=2.2.0
Downloading Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Requirement already satisfied: setuptools>0.6 in /usr/lib/python3.8/site-packages (from ncclient->-r /tmp/src/requirements.txt (line 3)) (41.6.0)
Requirement already satisfied: six in /usr/lib/python3.8/site-packages (from ncclient->-r /tmp/src/requirements.txt (line 3)) (1.12.0)
Collecting bcrypt>=3.1.3
Downloading bcrypt-3.2.0-cp36-abi3-manylinux2010_x86_64.whl (63 kB)
Requirement already satisfied: cryptography>=2.5 in /usr/lib64/python3.8/site-packages (from paramiko->-r /tmp/src/requirements.txt (line 5)) (2.8)
Collecting pynacl>=1.0.1
Downloading PyNaCl-1.4.0-cp35-abi3-manylinux1_x86_64.whl (961 kB)
Collecting pyrsistent>=0.14.0
Downloading pyrsistent-0.18.0-cp38-cp38-manylinux1_x86_64.whl (118 kB)
Collecting attrs>=17.4.0
Downloading attrs-21.2.0-py2.py3-none-any.whl (53 kB)
Collecting future
Downloading future-0.18.2.tar.gz (829 kB)
Requirement already satisfied: cffi>=1.1 in /usr/lib64/python3.8/site-packages (from bcrypt>=3.1.3->paramiko->-r /tmp/src/requirements.txt (line 5)) (1.13.2)
Requirement already satisfied: pycparser in /usr/lib/python3.8/site-packages (from cffi>=1.1->bcrypt>=3.1.3->paramiko->-r /tmp/src/requirements.txt (line 5)) (2.19)
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
Collecting certifi>=2017.4.17
Downloading certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting charset-normalizer~=2.0.0
Downloading charset_normalizer-2.0.4-py3-none-any.whl (36 kB)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.8/site-packages (from requests>=2.18.4->pyvcloud==21.0.1->-r /tmp/src/requirements.txt (line 11)) (2.8)
Building wheels for collected packages: ncclient, ttp, future
Building wheel for ncclient (setup.py): started
Building wheel for ncclient (setup.py): finished with status 'done'
Created wheel for ncclient: filename=ncclient-0.6.12-py2.py3-none-any.whl size=83781 sha256=ab7ff67d84af8ee205b2127d84facfe7c3004ac2baf7f9044992d8611c1f9aba
Stored in directory: /output/wheels/wheels/b2/ea/95/9bdf798bf88d883a5ee9536d8a483042030d182ab252953b9d
Building wheel for ttp (setup.py): started
Building wheel for ttp (setup.py): finished with status 'done'
Created wheel for ttp: filename=ttp-0.7.2-py2.py3-none-any.whl size=82592 sha256=4128235c837b71ad65b52aeab39073636cba7aabdfe6e67aa0bf1822d56758d6
Stored in directory: /output/wheels/wheels/a5/e9/86/589e41ee5c74286a197095d4aabff1896eea950bb45ea593be
Building wheel for future (setup.py): started
Building wheel for future (setup.py): finished with status 'done'
Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491056 sha256=9aa6ce7d6e6150df9cfa35c0debb6e450d447eaec1789a03e34d9bc47084859a
Stored in directory: /output/wheels/wheels/8e/70/28/3d6ccd6e315f65f245da085482a2e1c7d14b90b30f239e2cf4
Successfully built ncclient ttp future
Installing collected packages: urllib3, pynacl, charset-normalizer, certifi, bcrypt, unittest-xml-reporting, requests, pyrsistent, pygments, paramiko, humanfriendly, future, attrs, xmltodict, ttp, textfsm, pyvcloud, netaddr, ncclient, jxmlease, jsonschema, jmespath, ansible-pylibssh
Successfully installed ansible-pylibssh-0.2.0 attrs-21.2.0 bcrypt-3.2.0 certifi-2021.5.30 charset-normalizer-2.0.4 future-0.18.2 humanfriendly-9.2 jmespath-0.9.4 jsonschema-3.2.0 jxmlease-1.0.3 ncclient-0.6.12 netaddr-0.7.19 paramiko-2.7.2 pygments-2.10.0 pynacl-1.4.0 pyrsistent-0.18.0 pyvcloud-21.0.1 requests-2.26.0 textfsm-1.1.2 ttp-0.7.2 unittest-xml-reporting-3.0.4 urllib3-1.26.6 xmltodict-0.12.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
+ cp /tmp/src/requirements.txt /output/requirements.txt
++ ls -1 '/output/wheels/*whl'
++ wc -l
+ '[' 0 -gt 0 ']'
++ get-extras-packages
+ /usr/bin/dnf clean all
38 files removed
+ rm -rf /var/cache/dnf /var/cache/yum
+ rm -rf /var/lib/dnf/history.sqlite /var/lib/dnf/history.sqlite-shm /var/lib/dnf/history.sqlite-wal
+ rm -rf /var/log/dnf.librepo.log /var/log/dnf.log /var/log/dnf.rpm.log /var/log/hawkey.log
+ rm -rf /tmp/venv
Removing intermediate container f55f696895c9
---> f52fd8437571
Step 15/22 : FROM $EE_BASE_IMAGE
---> bac3a63558ef
Step 16/22 : USER root
---> Running in fc6888e27374
Removing intermediate container fc6888e27374
---> ee14881aa582
Step 17/22 : RUN pip install pip --upgrade
---> Running in d7f03db5ab97
Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages (21.2.4)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Removing intermediate container d7f03db5ab97
---> 1b7904758bf0
Step 18/22 : RUN whoami
---> Running in 161168263f0f
root
Removing intermediate container 161168263f0f
---> 1e54d5ebed25
Step 19/22 : RUN cat /etc/os-release
---> Running in 8f2e3985f498
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
Removing intermediate container 8f2e3985f498
---> 7aa8d50dcc2b
Step 20/22 : COPY --from=galaxy /usr/share/ansible /usr/share/ansible
---> c1f18affa806
Step 21/22 : COPY --from=builder /output/ /output/
---> b237b7b29502
Step 22/22 : RUN /output/install-from-bindep && rm -rf /output/wheels
---> Running in 52b7c2a29525
+ PKGMGR=
+ PKGMGR_OPTS=
+ '[' -z ']'
+ PKGMGR=/usr/bin/dnf
+ '[' -f /usr/bin/microdnf ']'
+ /usr/bin/dnf update -y
CentOS Linux 8 - AppStream 4.1 MB/s | 8.8 MB 00:02
CentOS Linux 8 - BaseOS 7.0 MB/s | 5.6 MB 00:00
CentOS Linux 8 - Extras 13 kB/s | 10 kB 00:00
CentOS Linux 8 - PowerTools 3.0 MB/s | 2.3 MB 00:00
Extra Packages for Enterprise Linux Modular 8 - 512 kB/s | 939 kB 00:01
Last metadata expiration check: 0:00:01 ago on Wed Sep 8 06:33:45 2021.
Dependencies resolved.
Nothing to do.
Complete!
+ '[' -f /output/bindep/run.txt ']'
++ cat /output/bindep/run.txt
+ PACKAGES='python38-cffi
python38-cryptography
python38-lxml
python38-pycparser
python38-six'
+ '[' '!' -z 'python38-cffi
python38-cryptography
python38-lxml
python38-pycparser
python38-six' ']'
+ /usr/bin/dnf install -y python38-cffi python38-cryptography python38-lxml python38-pycparser python38-six
Last metadata expiration check: 0:00:04 ago on Wed Sep 8 06:33:45 2021.
Package python38-cffi-1.13.2-3.module_el8.4.0+647+0ba99ce8.x86_64 is already installed.
Package python38-cryptography-2.8-3.module_el8.4.0+647+0ba99ce8.x86_64 is already installed.
Package python38-lxml-4.4.1-5.module_el8.4.0+647+0ba99ce8.x86_64 is already installed.
Package python38-pycparser-2.19-3.module_el8.4.0+647+0ba99ce8.noarch is already installed.
Package python38-six-1.12.0-10.module_el8.4.0+647+0ba99ce8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
+ '[' -f /output/bindep/epel.txt ']'
++ cat /output/bindep/epel.txt
+ EPEL_PACKAGES=
+ '[' '!' -z '' ']'
+ '[' -f /output/upper-constraints.txt ']'
+ '[' -f /output/requirements.txt ']'
+ pip3 install --cache-dir=/output/wheels -r /output/requirements.txt
Collecting ansible-pylibssh>=0.2.0
Using cached ansible_pylibssh-0.2.0-cp38-cp38-manylinux2014_x86_64.whl (2.2 MB)
Collecting jxmlease
Using cached jxmlease-1.0.3-py2.py3-none-any.whl (37 kB)
Requirement already satisfied: ncclient in /usr/local/lib/python3.8/site-packages (from -r /output/requirements.txt (line 3)) (0.6.12)
Collecting netaddr==0.7.19
Using cached netaddr-0.7.19-py2.py3-none-any.whl (1.6 MB)
Requirement already satisfied: paramiko in /usr/local/lib/python3.8/site-packages (from -r /output/requirements.txt (line 5)) (2.7.2)
Requirement already satisfied: xmltodict in /usr/local/lib/python3.8/site-packages (from -r /output/requirements.txt (line 6)) (0.12.0)
Collecting jsonschema
Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting textfsm
Using cached textfsm-1.1.2-py2.py3-none-any.whl (44 kB)
Collecting ttp
Using cached ttp-0.7.2-py2.py3-none-any.whl
Collecting jmespath==0.9.4
Using cached jmespath-0.9.4-py2.py3-none-any.whl (24 kB)
Collecting pyvcloud==21.0.1
Using cached pyvcloud-21.0.1-py3-none-any.whl (204 kB)
Collecting unittest-xml-reporting>=2.2.1
Using cached unittest_xml_reporting-3.0.4-py2.py3-none-any.whl (19 kB)
Collecting pygments>=2.2.0
Using cached Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Requirement already satisfied: PyYAML>=4.2b1 in /usr/lib64/python3.8/site-packages (from pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (5.4.1)
Requirement already satisfied: lxml>=4.2.1 in /usr/lib64/python3.8/site-packages (from pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (4.4.1)
Collecting humanfriendly>=4.8
Using cached humanfriendly-9.2-py2.py3-none-any.whl (86 kB)
Requirement already satisfied: requests>=2.18.4 in /usr/lib/python3.8/site-packages (from pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (2.22.0)
Requirement already satisfied: six in /usr/lib/python3.8/site-packages (from ncclient->-r /output/requirements.txt (line 3)) (1.12.0)
Requirement already satisfied: setuptools>0.6 in /usr/lib/python3.8/site-packages (from ncclient->-r /output/requirements.txt (line 3)) (41.6.0)
Requirement already satisfied: pynacl>=1.0.1 in /usr/local/lib64/python3.8/site-packages (from paramiko->-r /output/requirements.txt (line 5)) (1.4.0)
Requirement already satisfied: bcrypt>=3.1.3 in /usr/local/lib64/python3.8/site-packages (from paramiko->-r /output/requirements.txt (line 5)) (3.2.0)
Requirement already satisfied: cryptography>=2.5 in /usr/lib64/python3.8/site-packages (from paramiko->-r /output/requirements.txt (line 5)) (2.8)
Collecting pyrsistent>=0.14.0
Using cached pyrsistent-0.18.0-cp38-cp38-manylinux1_x86_64.whl (118 kB)
Collecting attrs>=17.4.0
Using cached attrs-21.2.0-py2.py3-none-any.whl (53 kB)
Collecting future
Using cached future-0.18.2-py3-none-any.whl
Requirement already satisfied: cffi>=1.1 in /usr/lib64/python3.8/site-packages (from bcrypt>=3.1.3->paramiko->-r /output/requirements.txt (line 5)) (1.13.2)
Requirement already satisfied: pycparser in /usr/lib/python3.8/site-packages (from cffi>=1.1->bcrypt>=3.1.3->paramiko->-r /output/requirements.txt (line 5)) (2.19)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3.8/site-packages (from requests>=2.18.4->pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python3.8/site-packages (from requests>=2.18.4->pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (2.8)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/lib/python3.8/site-packages (from requests>=2.18.4->pyvcloud==21.0.1->-r /output/requirements.txt (line 11)) (1.25.7)
Installing collected packages: unittest-xml-reporting, pyrsistent, pygments, humanfriendly, future, attrs, ttp, textfsm, pyvcloud, netaddr, jxmlease, jsonschema, jmespath, ansible-pylibssh
Successfully installed ansible-pylibssh-0.2.0 attrs-21.2.0 future-0.18.2 humanfriendly-9.2 jmespath-0.9.4 jsonschema-3.2.0 jxmlease-1.0.3 netaddr-0.7.19 pygments-2.10.0 pyrsistent-0.18.0 pyvcloud-21.0.1 textfsm-1.1.2 ttp-0.7.2 unittest-xml-reporting-3.0.4
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
+ EXTRAS=
+ '[' -f /output/packages.txt ']'
++ ls -1 '/output/wheels/*whl'
++ wc -l
+ '[' 0 -gt 0 ']'
+ '[' '!' -z '' ']'
+ /usr/bin/dnf clean all
38 files removed
+ rm -rf /var/cache/dnf /var/cache/yum
+ rm -rf /var/lib/dnf/history.sqlite /var/lib/dnf/history.sqlite-shm /var/lib/dnf/history.sqlite-wal
+ rm -rf /var/log/dnf.librepo.log /var/log/dnf.log /var/log/dnf.rpm.log /var/log/hawkey.log
Removing intermediate container 52b7c2a29525
---> 546ab86ee4cb
Successfully built 546ab86ee4cb
Successfully tagged ee-vdc-provisioning:latest
Complete! The build context can be found at: /repo/awx/execution_environments/vdc_provisioning/context
确保添加 bindep.txt
文件:
python38-devel [platform:rpm compile]
subversion [platform:rpm]
subversion [platform:dpkg]
git-lfs [platform:rpm]
并将其添加到您的 execution-environment.yml
:
dependencies:
galaxy: requirements.yml
python: requirements.txt
system: bindep.txt
其他人必须解释系统级依赖项是什么,但这是文档所说的,lxml
没有它就无法工作:
The bindep requirements file specifies cross-platform requirements, if there are any. These get processed by bindep and then passed to dnf (other platforms are not yet supported as of the publication of this blog post)