You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
I'd recommend considering the Dockerfile for building your packs as an infrastructure-as-code artifact, keep it in the repo so you can just do default docker build anytime without specifying the CLI parameters:
Dockerfile:
# list of packs to be installedARG PACKS="ansible"FROM stackstorm/st2packs:builder AS builder
# custom dependenciesRUN apt update && apt install -y libkrb5-dev gcc python3-dev python-dev
RUN /opt/stackstorm/st2/bin/st2-pack-install ${PACKS}
FROM stackstorm/st2packs:runtime
that'll technically do the same. Choose the approach suitable for situation.
libkrb5-dev gcc python3-dev python-dev
were missing.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
The text was updated successfully, but these errors were encountered: