Closed erikhjensen closed 1 year ago
Following up. When we comment out the whole python interpreter section it fails later in the build and also gives an error message about /usr/bin/dnf. In that case, its when the build process is trying to include the system packages in the resultant container.
section which we comment out
python_interpreter:
package_system: "python39"
python_path: "/usr/bin/python3.9"
Build fails later:
TASK [infra.ee_utilities.ee_builder : Run the Ansible Builder Program] *********
... lines omitted ...
"module_args": {
"_raw_params": "ansible-builder build -f\n ./execution_environment.yml\n -t cee-terraform-rhel8-eev3 --container-runtime=podman\n --prune-images --verbosity 2\n"
... lines omitted ...
"stdout_lines": [
"Running command:",
" podman build -f context/Containerfile -t cee-terraform-rhel8-eev3 context",
"...showing last 20 lines of output...",
... lines omitted ...
"+ /usr/bin/dnf install -y bind-utils dnf gcc krb5-devel libcurl-devel libssh-devel libxml2-devel make openssl-devel python3-devel python3-jmespath python3-lxml python3-netaddr python3-rpm python38-Cython python38-devel python38-lxml python38-pytz python38-pyyaml python38-requests python39-devel unzip wget",
"/output/scripts/assemble: line 75: /usr/bin/dnf: No such file or directory",
"Error: building at STEP \"RUN /output/scripts/assemble\": while running runtime: exit status 127"
My understanding is that this dnf command is being run either in the builder container or, the target-container whose base is ee-supported. Either way, if the natural disposition of the process is to use /usr/bin/dnf, I find it curious that tool cannot be found in those two OOTB images. this makes me feel my assumptions are not correct about the build-context.
As per: https://www.ansible.com/blog/unlocking-efficiency-harnessing-the-capabilities-of-ansible-builder-3.0
The microdnf package manager can configured in the execution-environment definition
options: package_manager_path: /usr/bin/microdnf
Summary
We're migrating to infra.ee_utilities.ee_builder latest from redhat_cop.ee_utilities.ee_builder and ansible-builder 1.2.
I have a new build server and both /bin/sh and /usr/bin/sh are confirmed to be present.
The build is failing here:
in this build context, is this command being run inside the container that's built-up or in the builder container? Either way, it seems to have an issue w/ /usr/bin/dnf. Is that your interpretation? See below for my follow up comment whereby we comment out the python_interpreter section of the ee-specification and it fails w/ a dnf-related error later in the podman build.
Issue Type
Ansible, Collection, Docker/Podman details
OS / ENVIRONMENT
Build Environment Rhel8 w/ active subscription. Ansible Automation Collection 2.4 repos enabled.
Desired Behavior
Desire to allow /usr/bin/dnf to not throw a file-not found error.
Actual Behavior
The RUN statement in Containerfile looks for shell at /bin/sh and dnf at /usr/bin/dnf and looks to error-out
Playbook - a playbook to build the Execution Environment An execution env compatible w/ V3 of builder
STEPS TO REPRODUCE