Skip to content

Getting error when building custom image with 'ansible' pack added. #31

@dhexnatheo

Description

@dhexnatheo
  • I'm trying to build custom pack image with 'ansible' pack added. But keep getting this error message:
Building wheels for collected packages: pykerberos
  Building wheel for pykerberos (setup.py): started
  Building wheel for pykerberos (setup.py): finished with status 'error'
  Running setup.py clean for pykerberos
Failed to build pykerberos
Installing collected packages: pycparser, urllib3, idna, charset-normalizer, cffi, certifi, requests, pyparsing, ntlm-auth, MarkupSafe, cryptography, xmltodict, resolvelib, requests-ntlm, PyYAML, pyspnego, packaging, jinja2, requests-credssp, pywinrm, pykerberos, ansible-core, netaddr, ansible
    Running setup.py install for pykerberos: started
    Running setup.py install for pykerberos: finished with status 'error'
 (stderr:   ERROR: Command errored out with exit status 1:
   command: /opt/stackstorm/virtualenvs/ansible/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-iyp_di66
       cwd: /tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/
  Complete output (10 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'kerberos' extension
  creating build
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/src
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/opt/stackstorm/virtualenvs/ansible/include -I/usr/include/python3.8 -c src/kerberos.c -o build/temp.linux-x86_64-3.8/src/kerberos.o
  unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pykerberos
    ERROR: Command errored out with exit status 1:
     command: /opt/stackstorm/virtualenvs/ansible/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-uqi43b55/install-record.txt --single-version-externally-managed --compile --install-headers /opt/stackstorm/virtualenvs/ansible/include/site/python3.8/pykerberos
         cwd: /tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/
    Complete output (10 lines):
    running install
    running build
    running build_ext
    building 'kerberos' extension
    creating build
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/src
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/opt/stackstorm/virtualenvs/ansible/include -I/usr/include/python3.8 -c src/kerberos.c -o build/temp.linux-x86_64-3.8/src/kerberos.o
    unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/stackstorm/virtualenvs/ansible/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-uqi43b55/install-record.txt --single-version-externally-managed --compile --install-headers /opt/stackstorm/virtualenvs/ansible/include/site/python3.8/pykerberos Check the logs for full command output.
  • After some diggin' around, i've found this issue and begin to suspect that there was some missing dependencies here. I was right, libkrb5-dev gcc python3-dev python-dev were missing.
  • I did some simple, temporary workaround for this. What i did was add those missing dependencies directly into the builder Dockerfile using sed.
    sed -i "2i RUN apt update && apt install -y libkrb5-dev gcc python3-dev python-dev && rm -rf /var/lib/apt/lists/*" ./st2packs-image/Dockerfile
  • And then proceed to build the image as the docs says. Summary for everything i've did:
$ git clone [email protected]:stackstorm/st2packs-dockerfiles
$ cd st2packs-dockerfiles
$ sed -i "2i RUN apt update && apt install -y libkrb5-dev gcc python3-dev python-dev && rm -rf /var/lib/apt/lists/*" ./st2packs-image/Dockerfile
$ docker build --build-arg PACKS="ansible" -t ${DOCKER_REGISTRY}/st2packs:<version_number> st2packs-image
  • I hope this could help and if anyone has better idea/way feel free to add. I'd really appreciate it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions