Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
359 views
in Technique[技术] by (71.8m points)

ansible awx - AWX docker image build NPM errors

I have been trying to build AWX docker images instead of using those hosted on docker hub as we need to add few additional tools to the image and other changes required per internal policies.

I am running into following error even though I left use_container_for_build=true to use an intermediate container build AWX images. We have NPM, NodeJs and other dependencies installed as well on the server where I am building/running Ansible tasks that are building AWX images.

Using AWX with latest version which is 16.0.0 and minimal change to inventory file to use Kubernetes context and docker registry section to push built images to an internal private registry.

Appreciate any clue or workaround as I spent hours trying different options but none of them worked so far.

TASK [image_build : Build AWX distribution using container] *******************************************************************
task path: /AWXSB/AnsibleAWX/awx/installer/roles/image_build/tasks/main.yml:65
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: myadmin
<localhost> EXEC /bin/sh -c 'echo ~myadmin && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/myadmin/.ansible/tmp `"&& mkdir "` echo /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835 `" && echo ansible-tmp-1609796097.03-19495-93975508577835="` echo /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835 `" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/docker/docker_container.py
<localhost> PUT /home/myadmin/.ansible/tmp/ansible-local-18837byydxr/tmpFA92wC TO /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/AnsiballZ_docker_container.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/ /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/AnsiballZ_docker_container.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/AnsiballZ_docker_container.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/myadmin/.ansible/tmp/ansible-tmp-1609796097.03-19495-93975508577835/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "api_version": "auto",
            "auto_remove": false,
            "blkio_weight": null,
            "ca_cert": null,
            "cap_drop": null,
            "capabilities": null,
            "cleanup": false,
            "client_cert": null,
            "client_key": null,
            "command": null,
            "comparisons": null,
            "cpu_period": null,
            "cpu_quota": null,
            "cpu_shares": null,
            "cpuset_cpus": null,
            "cpuset_mems": null,
            "debug": false,
            "detach": false,
            "device_read_bps": null,
            "device_read_iops": null,
            "device_write_bps": null,
            "device_write_iops": null,
            "devices": null,
            "dns_opts": null,
            "dns_search_domains": null,
            "dns_servers": null,
            "docker_host": "unix://var/run/docker.sock",
            "domainname": null,
            "entrypoint": null,
            "env": {
                "http_proxy": "",
                "https_proxy": "",
                "no_proxy": ""
            },
            "env_file": null,
            "etc_hosts": null,
            "exposed_ports": null,
            "force_kill": false,
            "groups": null,
            "healthcheck": null,
            "hostname": null,
            "ignore_image": false,
            "image": "awx_sdist_builder:16.0.0",
            "init": false,
            "interactive": false,
            "ipc_mode": null,
            "keep_volumes": true,
            "kernel_memory": null,
            "kill_signal": null,
            "labels": null,
            "links": null,
            "log_driver": null,
            "log_options": null,
            "mac_address": null,
            "memory": "0",
            "memory_reservation": null,
            "memory_swap": null,
            "memory_swappiness": null,
            "mounts": null,
            "name": "awx_sdist_builder",
            "network_mode": null,
            "networks": null,
            "networks_cli_compatible": null,
            "oom_killer": null,
            "oom_score_adj": null,
            "output_logs": false,
            "paused": false,
            "pid_mode": null,
            "pids_limit": null,
            "privileged": false,
            "published_ports": null,
            "pull": false,
            "purge_networks": false,
            "read_only": false,
            "recreate": false,
            "restart": false,
            "restart_policy": null,
            "restart_retries": null,
            "runtime": null,
            "security_opts": null,
            "shm_size": null,
            "ssl_version": null,
            "state": "started",
            "stop_signal": null,
            "stop_timeout": null,
            "sysctls": null,
            "timeout": 60,
            "tls": false,
            "tls_hostname": "localhost",
            "tmpfs": null,
            "trust_image_content": false,
            "tty": false,
            "ulimits": null,
            "user": "446",
            "userns_mode": null,
            "uts": null,
            "validate_certs": false,
            "volume_driver": null,
            "volumes": [
                "../:/awx:Z"
            ],
            "volumes_from": null,
            "working_dir": null
        }
    },
    "msg": "npm --prefix awx/ui_next --loglevel warn --ignore-scripts install
npm WARN tar EACCES: permission denied, fchown
npm WARN tar EACCES: permission denied, lchown '/awx/awx/ui_next/node_modules/.staging/semver-96a41615/bin'
npm WARN tar EACCES: permission denied, fchown
npm WARN tar EACCES: permission denied, fchown
npm WARN tar EACCES: permission denied, lchown '/awx/awx/ui_next/node_modules/.staging/debug-aeec2e21/src'
npm WARN tar EACCES: permission denied, fchown
npm WARN tar EACCES: permission denied, lchown '/awx/awx/ui_next/node_modules/.staging/@babel/plugin-syntax-async-generators-9ca6456e/lib'
npm WARN tar EACCES: permission denied, lchown '/awx/awx/ui_next/node_modules/.staging/@babel/helper-validator-option-02f16958/lib'
npm WARN tar EACCES: permission denied, fchown
npm WARN tar EACCES: permission denied, fchown
npm WARN tar EACCES: permission denied, fchown
npm WARN tar EACCES: permission denied, fchown
npm WARN tar EACCES: permission denied, fchown

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...