Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should st2bootstrap-deb.sh require build-essential? #241

Open
codyaray opened this issue Mar 15, 2016 · 3 comments
Open

Should st2bootstrap-deb.sh require build-essential? #241

codyaray opened this issue Mar 15, 2016 · 3 comments

Comments

@codyaray
Copy link

Trying to install the virtualenv for a pack with native-extension requirements. This fails with

   configure: error: no acceptable C compiler found in $PATH

Not sure if we should automatically install build-essential or document that its needed for python-scripts with native extensions?

The full trace is

$ st2 run packs.setup_virtualenv packs=peak6...
id: 56e77bbcdac0076d67b4f30d
status: failed
parameters:
  packs:
  - peak6
result:
  exit_code: 1
  result: null
  stderr: "st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Setting up virtualenv for pack "peak6"
st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Removing virtualenv in "/opt/stackstorm/virtualenvs/peak6"
st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Creating virtualenv for pack "peak6" in "/opt/stackstorm/virtualenvs/peak6"
st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Creating virtualenv in "/opt/stackstorm/virtualenvs/peak6" using Python binary "/opt/stackstorm/st2/bin/python"
st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Running command "/alldata/opt/stackstorm/st2/bin/virtualenv -p /opt/stackstorm/st2/bin/python --always-copy /opt/stackstorm/virtualenvs/peak6" to create virtualenv.
st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Installing base requirements
st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Installing pack specific requirements from "/opt/stackstorm/packs/peak6/requirements.txt"
Traceback (most recent call last):
  File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/st2actions/runners/python_action_wrapper.py", line 116, in <module>
    obj.run()
  File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/st2actions/runners/python_action_wrapper.py", line 61, in run
    output = action.run(**self._parameters)
  File "/alldata/opt/stackstorm/packs/packs/actions/pack_mgmt/setup_virtualenv.py", line 60, in run
    self._setup_pack_virtualenv(pack_name=pack_name, update=update)
  File "/alldata/opt/stackstorm/packs/packs/actions/pack_mgmt/setup_virtualenv.py", line 117, in _setup_pack_virtualenv
    self._install_requirements(virtualenv_path, requirements_file_path)
  File "/alldata/opt/stackstorm/packs/packs/actions/pack_mgmt/setup_virtualenv.py", line 182, in _install_requirements
    (requirements_file_path, stdout))
Exception: Failed to install requirements from "/opt/stackstorm/packs/peak6/requirements.txt": Collecting fabric (from -r /opt/stackstorm/packs/peak6/requirements.txt (line 1))
  Using cached Fabric-1.10.2-py2-none-any.whl
Collecting requests (from -r /opt/stackstorm/packs/peak6/requirements.txt (line 2))
  Using cached requests-2.9.1-py2.py3-none-any.whl
Collecting pg8000 (from -r /opt/stackstorm/packs/peak6/requirements.txt (line 3))
  Using cached pg8000-1.10.5-py2.py3-none-any.whl
Collecting paramiko>=1.10 (from fabric->-r /opt/stackstorm/packs/peak6/requirements.txt (line 1))
  Using cached paramiko-1.16.0-py2.py3-none-any.whl
Requirement already up-to-date: six>=1.10.0 in /alldata/opt/stackstorm/virtualenvs/peak6/lib/python2.7/site-packages (from pg8000->-r /opt/stackstorm/packs/peak6/requirements.txt (line 3))
Collecting ecdsa>=0.11 (from paramiko>=1.10->fabric->-r /opt/stackstorm/packs/peak6/requirements.txt (line 1))
  Using cached ecdsa-0.13-py2.py3-none-any.whl
Collecting pycrypto!=2.4,>=2.1 (from paramiko>=1.10->fabric->-r /opt/stackstorm/packs/peak6/requirements.txt (line 1))
  Using cached pycrypto-2.6.1.tar.gz
Building wheels for collected packages: pycrypto
  Running setup.py bdist_wheel for pycrypto
  Complete output from command /opt/stackstorm/virtualenvs/peak6/bin/python -c "import setuptools;__file__='/tmp/pip-build-7uMw8d/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpXZ5hdVpip-wheel-:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/Crypto
  copying lib/Crypto/pct_warnings.py -> build/lib.linux-x86_64-2.7/Crypto
  copying lib/Crypto/__init__.py -> build/lib.linux-x86_64-2.7/Crypto
  creating build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/MD4.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/SHA.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/HMAC.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/MD2.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/MD5.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/SHA224.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/SHA384.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/RIPEMD.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/hashalgo.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/SHA512.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  copying lib/Crypto/Hash/SHA256.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
  creating build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/ARC4.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/PKCS1_OAEP.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/XOR.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/ARC2.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/CAST.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/DES3.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/PKCS1_v1_5.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/blockalgo.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/AES.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/Blowfish.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  copying lib/Crypto/Cipher/DES.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
  creating build/lib.linux-x86_64-2.7/Crypto/Util
  copying lib/Crypto/Util/number.py -> build/lib.linux-x86_64-2.7/Crypto/Util
  copying lib/Crypto/Util/py3compat.py -> build/lib.linux-x86_64-2.7/Crypto/Util
  copying lib/Crypto/Util/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Util
  copying lib/Crypto/Util/py21compat.py -> build/lib.linux-x86_64-2.7/Crypto/Util
  copying lib/Crypto/Util/winrandom.py -> build/lib.linux-x86_64-2.7/Crypto/Util
  copying lib/Crypto/Util/randpool.py -> build/lib.linux-x86_64-2.7/Crypto/Util
  copying lib/Crypto/Util/Counter.py -> build/lib.linux-x86_64-2.7/Crypto/Util
  copying lib/Crypto/Util/_number_new.py -> build/lib.linux-x86_64-2.7/Crypto/Util
  copying lib/Crypto/Util/asn1.py -> build/lib.linux-x86_64-2.7/Crypto/Util
  copying lib/Crypto/Util/RFC1751.py -> build/lib.linux-x86_64-2.7/Crypto/Util
  creating build/lib.linux-x86_64-2.7/Crypto/Random
  copying lib/Crypto/Random/random.py -> build/lib.linux-x86_64-2.7/Crypto/Random
  copying lib/Crypto/Random/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Random
  copying lib/Crypto/Random/_UserFriendlyRNG.py -> build/lib.linux-x86_64-2.7/Crypto/Random
  creating build/lib.linux-x86_64-2.7/Crypto/Random/Fortuna
  copying lib/Crypto/Random/Fortuna/FortunaGenerator.py -> build/lib.linux-x86_64-2.7/Crypto/Random/Fortuna
  copying lib/Crypto/Random/Fortuna/SHAd256.py -> build/lib.linux-x86_64-2.7/Crypto/Random/Fortuna
  copying lib/Crypto/Random/Fortuna/FortunaAccumulator.py -> build/lib.linux-x86_64-2.7/Crypto/Random/Fortuna
  copying lib/Crypto/Random/Fortuna/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Random/Fortuna
  creating build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
  copying lib/Crypto/Random/OSRNG/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
  copying lib/Crypto/Random/OSRNG/nt.py -> build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
  copying lib/Crypto/Random/OSRNG/fallback.py -> build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
  copying lib/Crypto/Random/OSRNG/posix.py -> build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
  copying lib/Crypto/Random/OSRNG/rng_base.py -> build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
  creating build/lib.linux-x86_64-2.7/Crypto/SelfTest
  copying lib/Crypto/SelfTest/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest
  copying lib/Crypto/SelfTest/st_common.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest
  creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/common.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/test_Blowfish.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/test_CAST.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/test_AES.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/test_ARC2.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/test_XOR.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/test_pkcs1_15.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/test_DES.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/test_DES3.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  copying lib/Crypto/SelfTest/Cipher/test_ARC4.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
  creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/common.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/test_MD5.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/test_SHA.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/test_MD4.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/test_MD2.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/test_RIPEMD.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/test_SHA512.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/test_SHA224.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/test_SHA256.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/test_SHA384.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  copying lib/Crypto/SelfTest/Hash/test_HMAC.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
  creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Protocol
  copying lib/Crypto/SelfTest/Protocol/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Protocol
  copying lib/Crypto/SelfTest/Protocol/test_KDF.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Protocol
  copying lib/Crypto/SelfTest/Protocol/test_chaffing.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Protocol
  copying lib/Crypto/SelfTest/Protocol/test_AllOrNothing.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Protocol
  copying lib/Crypto/SelfTest/Protocol/test_rfc1751.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Protocol
  creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
  copying lib/Crypto/SelfTest/PublicKey/test_ElGamal.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
  copying lib/Crypto/SelfTest/PublicKey/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
  copying lib/Crypto/SelfTest/PublicKey/test_importKey.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
  copying lib/Crypto/SelfTest/PublicKey/test_DSA.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
  copying lib/Crypto/SelfTest/PublicKey/test_RSA.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
  creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random
  copying lib/Crypto/SelfTest/Random/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random
  copying lib/Crypto/SelfTest/Random/test_rpoolcompat.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random
  copying lib/Crypto/SelfTest/Random/test__UserFriendlyRNG.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random
  copying lib/Crypto/SelfTest/Random/test_random.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random
  creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/Fortuna
  copying lib/Crypto/SelfTest/Random/Fortuna/test_FortunaAccumulator.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/Fortuna
  copying lib/Crypto/SelfTest/Random/Fortuna/test_SHAd256.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/Fortuna
  copying lib/Crypto/SelfTest/Random/Fortuna/test_FortunaGenerator.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/Fortuna
  copying lib/Crypto/SelfTest/Random/Fortuna/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/Fortuna
  creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
  copying lib/Crypto/SelfTest/Random/OSRNG/test_generic.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
  copying lib/Crypto/SelfTest/Random/OSRNG/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
  copying lib/Crypto/SelfTest/Random/OSRNG/test_fallback.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
  copying lib/Crypto/SelfTest/Random/OSRNG/test_nt.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
  copying lib/Crypto/SelfTest/Random/OSRNG/test_winrandom.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
  copying lib/Crypto/SelfTest/Random/OSRNG/test_posix.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
  creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
  copying lib/Crypto/SelfTest/Util/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
  copying lib/Crypto/SelfTest/Util/test_Counter.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
  copying lib/Crypto/SelfTest/Util/test_number.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
  copying lib/Crypto/SelfTest/Util/test_asn1.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
  copying lib/Crypto/SelfTest/Util/test_winrandom.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
  creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Signature
  copying lib/Crypto/SelfTest/Signature/test_pkcs1_pss.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Signature
  copying lib/Crypto/SelfTest/Signature/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Signature
  copying lib/Crypto/SelfTest/Signature/test_pkcs1_15.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Signature
  creating build/lib.linux-x86_64-2.7/Crypto/Protocol
  copying lib/Crypto/Protocol/KDF.py -> build/lib.linux-x86_64-2.7/Crypto/Protocol
  copying lib/Crypto/Protocol/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Protocol
  copying lib/Crypto/Protocol/AllOrNothing.py -> build/lib.linux-x86_64-2.7/Crypto/Protocol
  copying lib/Crypto/Protocol/Chaffing.py -> build/lib.linux-x86_64-2.7/Crypto/Protocol
  creating build/lib.linux-x86_64-2.7/Crypto/PublicKey
  copying lib/Crypto/PublicKey/_RSA.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
  copying lib/Crypto/PublicKey/DSA.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
  copying lib/Crypto/PublicKey/_DSA.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
  copying lib/Crypto/PublicKey/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
  copying lib/Crypto/PublicKey/pubkey.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
  copying lib/Crypto/PublicKey/RSA.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
  copying lib/Crypto/PublicKey/ElGamal.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
  copying lib/Crypto/PublicKey/_slowmath.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
  creating build/lib.linux-x86_64-2.7/Crypto/Signature
  copying lib/Crypto/Signature/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Signature
  copying lib/Crypto/Signature/PKCS1_PSS.py -> build/lib.linux-x86_64-2.7/Crypto/Signature
  copying lib/Crypto/Signature/PKCS1_v1_5.py -> build/lib.linux-x86_64-2.7/Crypto/Signature
  running build_ext
  running build_configure
  checking for gcc... no
  checking for cc... no
  checking for cl.exe... no
  configure: error: in `/tmp/pip-build-7uMw8d/pycrypto':
  configure: error: no acceptable C compiler found in $PATH
  See `config.log' for more details
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-7uMw8d/pycrypto/setup.py", line 456, in <module>
      core.setup(**kw)
    File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
      dist.run_commands()
    File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/opt/stackstorm/virtualenvs/peak6/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 175, in run
      self.run_command('build')
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
      self.run_command(cmd_name)
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-7uMw8d/pycrypto/setup.py", line 251, in run
      self.run_command(cmd_name)
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-7uMw8d/pycrypto/setup.py", line 278, in run
      raise RuntimeError("autoconf error")
  RuntimeError: autoconf error

  ----------------------------------------
Failed to build pycrypto
Installing collected packages: ecdsa, pycrypto, paramiko, fabric, requests, pg8000
  Running setup.py install for pycrypto
    Complete output from command /opt/stackstorm/virtualenvs/peak6/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-7uMw8d/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-K9VkOg-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/stackstorm/virtualenvs/peak6/include/site/python2.7/pycrypto:
    running install
    running build
    running build_py
    running build_ext
    running build_configure
    checking for gcc... no
    checking for cc... no
    checking for cl.exe... no
    configure: error: in `/tmp/pip-build-7uMw8d/pycrypto':
   configure: error: no acceptable C compiler found in $PATH
    See `config.log' for more details
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-7uMw8d/pycrypto/setup.py", line 456, in <module>
        core.setup(**kw)
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/opt/stackstorm/virtualenvs/peak6/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
        self.run_command('build')
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
        self.run_command(cmd_name)
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-7uMw8d/pycrypto/setup.py", line 251, in run
        self.run_command(cmd_name)
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-7uMw8d/pycrypto/setup.py", line 278, in run
        raise RuntimeError("autoconf error")
    RuntimeError: autoconf error

    ----------------------------------------

"
  stdout: ''

Installing build-essential fixed this for me.

cray@svlchi6pstack2:~$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  auth-client-config ldap-auth-config libmpdec2
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  binutils cpp-4.8 dpkg-dev g++ g++-4.8 gcc gcc-4.8 gcc-4.8-base libasan0
  libatomic1 libdpkg-perl libgcc-4.8-dev libgomp1 libitm1 libquadmath0
  libstdc++-4.8-dev libstdc++6 libtsan0
Suggested packages:
  binutils-doc gcc-4.8-locales debian-keyring g++-multilib g++-4.8-multilib
  gcc-4.8-doc libstdc++6-4.8-dbg gcc-multilib autoconf automake1.9 libtool
  flex bison gcc-doc gcc-4.8-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg
  libatomic1-dbg libasan0-dbg libtsan0-dbg libquadmath0-dbg libstdc++-4.8-doc
Recommended packages:
  fakeroot libalgorithm-merge-perl libfile-fcntllock-perl
The following NEW packages will be installed:
  binutils build-essential dpkg-dev g++ g++-4.8 gcc gcc-4.8 libasan0
  libatomic1 libgcc-4.8-dev libitm1 libquadmath0 libstdc++-4.8-dev libtsan0
The following packages will be upgraded:
  cpp-4.8 gcc-4.8-base libdpkg-perl libgomp1 libstdc++6
5 upgraded, 14 newly installed, 0 to remove and 76 not upgraded.
Need to get 34.1 MB of archives.
After this operation, 76.2 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://prd.aptly.peak6.net/ubuntu/ trusty/main libgomp1 amd64 4.8.4-2ubuntu1~14.04.1 [23.1 kB]
Get:2 http://prd.aptly.peak6.net/ubuntu/ trusty/main cpp-4.8 amd64 4.8.4-2ubuntu1~14.04.1 [4,595 kB]
Get:3 http://prd.aptly.peak6.net/ubuntu/ trusty/main gcc-4.8-base amd64 4.8.4-2ubuntu1~14.04.1 [16.0 kB]
Get:4 http://prd.aptly.peak6.net/ubuntu/ trusty/main libstdc++6 amd64 4.8.4-2ubuntu1~14.04.1 [259 kB]
Get:5 http://prd.aptly.peak6.net/ubuntu/ trusty/main libasan0 amd64 4.8.4-2ubuntu1~14.04.1 [63.1 kB]
Get:6 http://prd.aptly.peak6.net/ubuntu/ trusty/main libatomic1 amd64 4.8.4-2ubuntu1~14.04.1 [8,640 B]
Get:7 http://prd.aptly.peak6.net/ubuntu/ trusty/main libitm1 amd64 4.8.4-2ubuntu1~14.04.1 [28.5 kB]
Get:8 http://prd.aptly.peak6.net/ubuntu/ trusty/main libquadmath0 amd64 4.8.4-2ubuntu1~14.04.1 [126 kB]
Get:9 http://prd.aptly.peak6.net/ubuntu/ trusty/main libtsan0 amd64 4.8.4-2ubuntu1~14.04.1 [94.9 kB]
Get:10 http://prd.aptly.peak6.net/ubuntu/ trusty/main binutils amd64 2.24-5ubuntu14 [2,076 kB]
Get:11 http://prd.aptly.peak6.net/ubuntu/ trusty/main libgcc-4.8-dev amd64 4.8.4-2ubuntu1~14.04.1 [1,688 kB]
Get:12 http://prd.aptly.peak6.net/ubuntu/ trusty/main gcc-4.8 amd64 4.8.4-2ubuntu1~14.04.1 [5,056 kB]
Get:13 http://prd.aptly.peak6.net/ubuntu/ trusty/main gcc amd64 4:4.8.2-1ubuntu6 [5,098 B]
Get:14 http://prd.aptly.peak6.net/ubuntu/ trusty/main libstdc++-4.8-dev amd64 4.8.4-2ubuntu1~14.04.1 [1,051 kB]
Get:15 http://prd.aptly.peak6.net/ubuntu/ trusty/main g++-4.8 amd64 4.8.4-2ubuntu1~14.04.1 [18.1 MB]
Get:16 http://prd.aptly.peak6.net/ubuntu/ trusty/main g++ amd64 4:4.8.2-1ubuntu6 [1,490 B]
Get:17 http://prd.aptly.peak6.net/ubuntu/ trusty/main libdpkg-perl all 1.17.5ubuntu5.5 [179 kB]
Get:18 http://prd.aptly.peak6.net/ubuntu/ trusty/main dpkg-dev all 1.17.5ubuntu5.5 [726 kB]
Get:19 http://prd.aptly.peak6.net/ubuntu/ trusty/main build-essential amd64 11.6ubuntu6 [4,838 B]
Fetched 34.1 MB in 2s (13.7 MB/s)
(Reading database ... 90619 files and directories currently installed.)
Preparing to unpack .../libgomp1_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libgomp1:amd64 (4.8.4-2ubuntu1~14.04.1) over (4.8.4-2ubuntu1~14.04) ...
Preparing to unpack .../cpp-4.8_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking cpp-4.8 (4.8.4-2ubuntu1~14.04.1) over (4.8.4-2ubuntu1~14.04) ...
Preparing to unpack .../gcc-4.8-base_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking gcc-4.8-base:amd64 (4.8.4-2ubuntu1~14.04.1) over (4.8.4-2ubuntu1~14.04) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up gcc-4.8-base:amd64 (4.8.4-2ubuntu1~14.04.1) ...
(Reading database ... 90619 files and directories currently installed.)
Preparing to unpack .../libstdc++6_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libstdc++6:amd64 (4.8.4-2ubuntu1~14.04.1) over (4.8.4-2ubuntu1~14.04) ...
Setting up libstdc++6:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Selecting previously unselected package libasan0:amd64.
(Reading database ... 90619 files and directories currently installed.)
Preparing to unpack .../libasan0_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libasan0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package libatomic1:amd64.
Preparing to unpack .../libatomic1_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libatomic1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package libitm1:amd64.
Preparing to unpack .../libitm1_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libitm1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package libquadmath0:amd64.
Preparing to unpack .../libquadmath0_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package libtsan0:amd64.
Preparing to unpack .../libtsan0_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libtsan0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package binutils.
Preparing to unpack .../binutils_2.24-5ubuntu14_amd64.deb ...
Unpacking binutils (2.24-5ubuntu14) ...
Selecting previously unselected package libgcc-4.8-dev:amd64.
Preparing to unpack .../libgcc-4.8-dev_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package gcc-4.8.
Preparing to unpack .../gcc-4.8_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking gcc-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package gcc.
Preparing to unpack .../gcc_4%3a4.8.2-1ubuntu6_amd64.deb ...
Unpacking gcc (4:4.8.2-1ubuntu6) ...
Selecting previously unselected package libstdc++-4.8-dev:amd64.
Preparing to unpack .../libstdc++-4.8-dev_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package g++-4.8.
Preparing to unpack .../g++-4.8_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking g++-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package g++.
Preparing to unpack .../g++_4%3a4.8.2-1ubuntu6_amd64.deb ...
Unpacking g++ (4:4.8.2-1ubuntu6) ...
Preparing to unpack .../libdpkg-perl_1.17.5ubuntu5.5_all.deb ...
Unpacking libdpkg-perl (1.17.5ubuntu5.5) over (1.17.5ubuntu5.4) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../dpkg-dev_1.17.5ubuntu5.5_all.deb ...
Unpacking dpkg-dev (1.17.5ubuntu5.5) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../build-essential_11.6ubuntu6_amd64.deb ...
Unpacking build-essential (11.6ubuntu6) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up libgomp1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up cpp-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libasan0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libatomic1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libitm1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libtsan0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up binutils (2.24-5ubuntu14) ...
Setting up libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up gcc-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Setting up gcc (4:4.8.2-1ubuntu6) ...
Setting up libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up g++-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Setting up g++ (4:4.8.2-1ubuntu6) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up libdpkg-perl (1.17.5ubuntu5.5) ...
Setting up dpkg-dev (1.17.5ubuntu5.5) ...
Setting up build-essential (11.6ubuntu6) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
cray@svlchi6pstack2:~$ st2 run packs.setup_virtualenv packs=peak6
.......
id: 56e77c4bdac0076d67b4f310
status: succeeded
parameters:
  packs:
  - peak6
result:
  exit_code: 0
  result: 'Successfuly set up virtualenv for the following packs: peak6'
  stderr: 'st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Setting up virtualenv for pack "peak6"

    st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Removing virtualenv in "/opt/stackstorm/virtualenvs/peak6"

    st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Creating virtualenv for pack "peak6" in "/opt/stackstorm/virtualenvs/peak6"

    st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Creating virtualenv in "/opt/stackstorm/virtualenvs/peak6" using Python binary "/opt/stackstorm/st2/bin/python"

    st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Running command "/alldata/opt/stackstorm/st2/bin/virtualenv -p /opt/stackstorm/st2/bin/python --always-copy /opt/stackstorm/virtualenvs/peak6" to create virtualenv.

    st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Installing base requirements

    st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Installing pack specific requirements from "/opt/stackstorm/packs/peak6/requirements.txt"

    st2.actions.python.SetupVirtualEnvironmentAction: DEBUG    Virtualenv for pack "peak6" successfully created in "/opt/stackstorm/virtualenvs/peak6"

    '
  stdout: ''
@dennybaa
Copy link
Contributor

@codyaray Hey there.

In my opinion it shouldn't, since we tend to keep st2 package dependencies list small. In fact st2 doesn't require build-essential and many packs which do not rely on pip modules with dynamic libs, can do packs.install without any issues. So we leave this to pack owner to provide sufficient details on the pack prerequisites at the moment.
Unfortunately our packs management/dependencies flow neither ideal nor fully formed yet.

@lakshmi-kannan
Copy link
Contributor

I second @dennybaa's thoughts here. This is an OS dependency coming from a pack installation. Until we solve pack level OS deps, this will be an issue. Thanks for the report.

@codyaray
Copy link
Author

codyaray commented May 5, 2016

Ah, I forgot about this issue! I'll dive into my solution in case its helpful insight for the StackStorm team or community. :)

I've solved pack-level OS deps for myself in my own "content management" story. Might be a good idea to include something like this in the official content management best practices. :)

Here's how my stackstorm repo is currently setup. For this particular issue, deploy/provision.yaml and deploy/pack-deps/<pack>.yaml are most relevant.

cray@macbook:stackstorm (master>)$ tree
.
|-- README.md
|-- configs                 # custom config yaml for each pack (don't modify default config.yaml in packs)
|   |-- github.yaml
|   |-- jira.yaml
|   `-- mssql.yaml
|-- deploy                  # ansible deployment scripts. (the tool may change but the idea remains)
|   |-- etc
|   |   `-- st2             # static contents of /etc/st2/
|   |-- inventory           # ansible inventory file defining [stackstorm] nodes and [controller] node
|   |-- pack-deps           # one file per pack with OS dependencies
|   |   |-- analytics.yaml
|   |   `-- mssql.yaml
|   |-- packs.yml           #  playbook deploys the packs to each node
|   |-- provision.yml       #  playbook installs from pack-deps and St2 config files to each node
|   |-- rbac.yml            #  playbook deploys RBAC configs to each node
|   |-- stackstorm.yml      # "master" playbook which includes provision, packs, and rbac
|   `-- templates           # dynamic contents of /etc/st2/ (template for per-host variables like timer.enable)
|       `-- st2.conf.j2
|-- packs                   # contents of /opt/stackstorm/packs with custom & subtree'd st2/st2contrib packs
|   |-- analytics                # custom packs
|   |-- core                     # st2-bundled packs
|   |-- check_mk                 # my st2contrib packs
|   |-- github                   # third-party st2contrib packs
|   |-- <snip>
|-- rbac                    # contents of /opt/stackstorm/rbac
|   `-- assignments
|       |-- cray.yaml
|       |-- <snip>

The ansible provision.yml script which installs the pack-deps look like:

---
- name: Install Pack Dependencies
  hosts: stackstorm
  tasks:
  - name: Find pack dependencies
    find: path="pack-deps" pattern="*.yaml"
    run_once: true
    delegate_to: localhost
    register: deps
  - name: Install OS dependencies
    include: "{{ item }}"
    with_items: "{{ deps.files | map(attribute='path') | list }}"
    become: true

Here's the contents of deploy/pack-deps/analytics.yaml as an example. These are actually the dependencies that led us to create this issue. :)

---
  - name: Install Build Tools
    apt: name=build-essential state=present
  - name: Install PostgreSQL dependencies
    apt: name=libpq-dev state=present

This may not be best practice for some reason, but so far its working okay for me. Its definitely still evolving though (refactored the deploy scripts yesterday) so I'd love to hear feedback. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants