README.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. Welcome to the repository for Hue
  2. =================================
  3. .. note::
  4. This is the development-oriented readme. If you want to write notes for
  5. end users, please put them in ``dist/README``.
  6. Hue is both a Web UI for Hadoop and a framework to create interactive Web
  7. applications.
  8. It features a FileBrowser for accessing HDFS, JobSub and
  9. JobBrowser applications for submitting and viewing MapReduce jobs, a Beeswax
  10. application for executing Hive queries. On top of that, a SDK is available
  11. for creating new apps integrated with Hadoop.
  12. More documentation is available at http://cloudera.github.com/hue/.
  13. Getting Started
  14. ===============
  15. To build and get the core server running::
  16. $ git clone http://github.com/cloudera/hue.git
  17. $ cd hue
  18. $ make apps
  19. $ build/env/bin/hue runserver
  20. If using the Beeswax application, start the daemon::
  21. $ build/env/bin/hue beeswax_server
  22. Now Hue should be running on http://localhost:8000.
  23. The configuration in development mode is ``desktop/conf/pseudo-distributed.ini``.
  24. Note: to start all the servers in one command (but lose the automatic reloading after source modification)::
  25. $ build/env/bin/supervisor
  26. To run the tests::
  27. $ build/env/bin/hue test all
  28. $ build/env/bin/hue test specific filebrowser
  29. $ build/env/bin/hue test specific jobbrowser.tests:test_get_path
  30. Development Prerequisites
  31. ===========================
  32. You'll need these library development packages and tools installed on
  33. your system:
  34. Ubuntu:
  35. * ant
  36. * gcc
  37. * g++
  38. * libkrb5-dev
  39. * libmysqlclient-dev
  40. * libssl-dev
  41. * libsasl2-dev
  42. * libsasl2-modules-gssapi-mit
  43. * libsqlite3-dev
  44. * libtidy-0.99-0 (for unit tests only)
  45. * libxml2-dev
  46. * libxslt-dev
  47. * mvn (from ``maven2`` package or tarball)
  48. * openldap-dev / libldap2-dev
  49. * python-dev
  50. * python-simplejson
  51. * python-setuptools
  52. CentOS:
  53. * ant
  54. * asciidoc
  55. * cyrus-sasl-devel
  56. * cyrus-sasl-gssapi
  57. * gcc
  58. * gcc-c++
  59. * krb5-devel
  60. * libtidy (for unit tests only)
  61. * libxml2-devel
  62. * libxslt-devel
  63. * mvn (from ``maven2`` package or tarball)
  64. * mysql
  65. * mysql-devel
  66. * openldap-devel
  67. * python-devel
  68. * python-simplejson
  69. * sqlite-devel
  70. MacOS (mac port):
  71. * liblxml
  72. * libxml2
  73. * libxslt
  74. * mysql5-devel
  75. * simplejson (easy_install)
  76. * sqlite3
  77. File Layout
  78. ===========
  79. The "core" stuff is in ``desktop/core/``, whereas installable apps live in
  80. ``apps/``. Please place third-party dependencies in the app's ext-py/
  81. directory.
  82. The typical directory structure for inside an application includes:
  83. src/
  84. for Python code
  85. models.py
  86. urls.py
  87. views.py
  88. forms.py
  89. settings.py
  90. for Django code
  91. conf/
  92. for configuration (``.ini``) files to be installed
  93. static/
  94. for static HTML and js resources
  95. templates/
  96. for data to be put through a template engine
  97. docs/
  98. for helpful notes
  99. For the URLs within your application, you should make your own ``urls.py``
  100. which will be automatically rooted at ``/yourappname/`` in the global
  101. namespace. See ``apps/about/src/about/urls.py`` for an example.
  102. Main Stack
  103. ==========
  104. * Python 2.4 - 2.7
  105. * Django 1.2 https://docs.djangoproject.com/en/1.2/
  106. * Mako 0.7
  107. * jQuery 1.7
  108. * Bootstrap 2
  109. Using and Installing Thrift
  110. ===========================
  111. Right now, we check in the generated thrift code.
  112. To generate the code, you'll need the thrift binary version 0.7.0.
  113. Please download from http://thrift.apache.org/.
  114. The modules using ``Thrift`` have some helper scripts like ``regenerate_thrift.sh``
  115. for regenerating the code from the interfaces.
  116. Profiling Hue Apps
  117. ==================
  118. Hue has a profiling system built in, which can be used to analyze server-side
  119. performance of applications. To enable profiling::
  120. $ build/env/bin/hue runprofileserver
  121. Then, access the page that you want to profile. This will create files like
  122. /tmp/useradmin.users.000072ms.2011-02-21T13:03:39.745851.prof. The format for
  123. the file names is /tmp/<app_module>.<page_url>.<time_taken>.<timestamp>.prof.
  124. Hue uses the hotshot profiling library for instrumentation. The documentation
  125. for this library is located at: http://docs.python.org/library/hotshot.html.
  126. You can use kcachegrind to view the profiled data graphically::
  127. $ hotshot2calltree /tmp/xyz.prof > /tmp/xyz.trace
  128. $ kcachegrind /tmp/xyz.trace
  129. More generally, you can programmatically inspect a trace::
  130. #!/usr/bin/python
  131. import hotshot.stats
  132. import sys
  133. stats = hotshot.stats.load(sys.argv[1])
  134. stats.sort_stats('cumulative', 'calls')
  135. stats.print_stats(100)
  136. This script takes in a .prof file, and orders function calls by the cumulative
  137. time spent in that function, followed by the number of times the function was
  138. called, and then prints out the top 100 time-wasters. For information on the
  139. other stats available, take a look at this website:
  140. http://docs.python.org/library/profile.html#pstats.Stats
  141. Internationalization
  142. ====================
  143. How to update all the messages and compile them::
  144. $ make locales
  145. How to update and compile the messages of one app::
  146. $ cd apps/beeswax
  147. $ make compile-locale
  148. How to create a new locale for an app::
  149. $ cd $APP_ROOT/src/$APP_NAME/locale
  150. $ $HUE_ROOT/build/env/bin/pybabel init -D django -i en_US.pot -d . -l fr
  151. License
  152. =======
  153. Apache License, Version 2.0
  154. http://www.apache.org/licenses/LICENSE-2.0