1
0

esky.rst 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. .. _tutorial-esky:
  2. ======================================
  3. Automatic Updates / Frozen Deployments
  4. ======================================
  5. .. versionadded:: 0.10.3.d
  6. Salt has support for the
  7. `Esky <https://github.com/cloudmatrix/esky>`_ application freezing and update
  8. tool. This tool allows one to build a complete zipfile out of the salt scripts
  9. and all their dependencies - including shared objects / DLLs.
  10. Getting Started
  11. ===============
  12. To build frozen applications, suitable build environment will be needed for
  13. each platform. You should probably set up a virtualenv in order to limit the
  14. scope of Q/A.
  15. This process does work on Windows. Directions are available at
  16. `<https://github.com/saltstack/salt-windows-install>`_ for details on
  17. installing Salt in Windows. Only the 32-bit Python and dependencies have been
  18. tested, but they have been tested on 64-bit Windows.
  19. Install ``bbfreeze``, and then ``esky`` from PyPI in order to enable the
  20. ``bdist_esky`` command in ``setup.py``. Salt itself must also be installed, in
  21. addition to its dependencies.
  22. Building and Freezing
  23. =====================
  24. Once you have your tools installed and the environment configured, use
  25. ``setup.py`` to prepare the distribution files.
  26. .. code-block:: bash
  27. python setup.py sdist
  28. python setup.py bdist
  29. Once the distribution files are in place, Esky can be used traverse the module
  30. tree and pack all the scripts up into a redistributable.
  31. .. code-block:: bash
  32. python setup.py bdist_esky
  33. There will be an appropriately versioned ``salt-VERSION.zip`` in ``dist/`` if
  34. everything went smoothly.
  35. Windows
  36. -------
  37. ``C:\Python27\lib\site-packages\zmq`` will need to be added to the PATH
  38. variable. This helps bbfreeze find the zmq DLL so it can pack it up.
  39. Using the Frozen Build
  40. ======================
  41. Unpack the zip file in the desired install location. Scripts like
  42. ``salt-minion`` and ``salt-call`` will be in the root of the zip file. The
  43. associated libraries and bootstrapping will be in the directories at the same
  44. level. (Check the `Esky <https://github.com/cloudmatrix/esky>`_ documentation
  45. for more information)
  46. To support updating your minions in the wild, put the builds on a web server
  47. that the minions can reach. :py:func:`salt.modules.saltutil.update` will
  48. trigger an update and (optionally) a restart of the minion service under the
  49. new version.
  50. Troubleshooting
  51. ===============
  52. A Windows minion isn't responding
  53. ---------------------------------
  54. The process dispatch on Windows is slower than it is on \*nix. It may be
  55. necessary to add '-t 15' to salt commands to give minions plenty of time to
  56. return.
  57. Windows and the Visual Studio Redist
  58. ------------------------------------
  59. The Visual C++ 2008 32-bit redistributable will need to be installed on all
  60. Windows minions. Esky has an option to pack the library into the zipfile,
  61. but OpenSSL does not seem to acknowledge the new location. If a
  62. ``no OPENSSL_Applink`` error appears on the console when trying to start a
  63. frozen minion, the redistributable is not installed.
  64. Mixed Linux environments and Yum
  65. --------------------------------
  66. The Yum Python module doesn't appear to be available on any of the standard
  67. Python package mirrors. If RHEL/CentOS systems need to be supported, the frozen
  68. build should created on that platform to support all the Linux nodes. Remember
  69. to build the virtualenv with ``--system-site-packages`` so that the ``yum``
  70. module is included.
  71. Automatic (Python) module discovery
  72. -----------------------------------
  73. Automatic (Python) module discovery does not work with the late-loaded scheme
  74. that Salt uses for (Salt) modules. Any misbehaving modules will need to be
  75. explicitly added to the ``freezer_includes`` in Salt's ``setup.py``. Always
  76. check the zipped application to make sure that the necessary modules were
  77. included.