README.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. It features a FileBrowser for accessing HDFS, JobSub and
  8. JobBrowser applications for submitting and viewing MapReduce jobs, a Beeswax
  9. application for interacting with Hive. On top of that, the web frontend
  10. is mostly built from declarative widgets that require no JavaScript and are
  11. easy to learn.
  12. File Layout
  13. ===========
  14. The "core" stuff is in ``desktop/core/``, whereas installable apps live in
  15. ``apps/``. Please place third-party dependencies in the app's ext-py/
  16. directory.
  17. The typical directory structure for inside an application includes:
  18. src/
  19. for Python code
  20. conf/
  21. for configuration (``.ini``) files to be installed
  22. static/
  23. for static HTML and js resources
  24. templates/
  25. for data to be put through a template engine
  26. docs/
  27. for helpful notes
  28. The python code is structured simply as
  29. ``module/package.py``,
  30. where module may be "filebrowser" or "jobsub". Because it is unlikely that
  31. there are going to be huge conflicts, we're going without a deep nested
  32. hierarchy.
  33. URL Layout
  34. ==========
  35. ``core/src/desktop/urls.py`` contains the current layout for top-level URLs.
  36. For the URLs within your application, you should make your own ``urls.py``
  37. which will be automatically rooted at ``/yourappname/`` in the global
  38. namespace. See ``apps/hello/src/hello/urls.py`` for an example.
  39. Development Prerequisites
  40. ===========================
  41. 1. On your host system, you need to have the python "virtualenv" package
  42. installed.
  43. 2. Also, you'll need these library development packages installed on your
  44. system:
  45. Debian:
  46. * gcc
  47. * libldap2-dev
  48. * libmysqlclient-dev
  49. * libsasl2-dev
  50. * libsqlite3-dev
  51. * libssl-dev
  52. * libxml2-dev
  53. * libxslt-dev
  54. * python-dev
  55. * python-setuptools
  56. CentOS:
  57. * cyrus-sasl-devel
  58. * gcc
  59. * libxml2-devel
  60. * libxslt-devel
  61. * mysql
  62. * mysql-devel
  63. * openldap-devel
  64. * openssl
  65. * python-devel
  66. * python-setuptools
  67. * sqlite-devel
  68. * python-simplejson (for the crepo tool)
  69. MacOS (mac port):
  70. * liblxml
  71. * libxml2
  72. * libxslt
  73. * mysql5-devel
  74. * simplejson (easy_install)
  75. * sqlite3
  76. 3. You need to have crepo installed, and preferably on your path. If it is not
  77. on your path, set the environment variable ``CREPO`` to point to ``crepo.py``
  78. from that distribution. You can clone crepo from
  79. http://github.com/cloudera/crepo.git somewhere else on your system.
  80. Getting Started
  81. ===============
  82. To build and get the core server running (without any helper daemons)::
  83. $ export HADOOP_HOME=<path-to-hadoop-home>
  84. $ git clone http://github.com/cloudera/hue.git
  85. $ cd hue
  86. $ make apps
  87. $ build/env/bin/desktop runserver_plus
  88. Now Hue should be running on http://localhost:8000.
  89. Setting up Hadoop
  90. =================
  91. In order to start up a pseudodistributed cluster with the plugins enabled,
  92. run::
  93. $ ./tools/scripts/configure-hadoop.sh all
  94. After doing so, running ``jps`` should show all the daemons running (NN, JT,
  95. TT, DN) and you should be able to see the web UI on http://localhost:50030/ and
  96. http://localhost:50070/.
  97. FAQ
  98. ===
  99. 1: What does "Exception: no app!" mean?
  100. Your template has an error in it. Check for messages from the server that
  101. look like::
  102. INFO:root:Processing exception: Unclosed tag 'if'. Looking for one of: else, endif
  103. 2: What do I do if I get "There was an error launching ..."?
  104. Turn on debugging by issuing ``dbug.cookie()`` in a Firebug console.
  105. Django Conventions
  106. ==================
  107. If you need to name your urls
  108. (http://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns)
  109. because there's ambiguity in the view, be sure to prefix the name
  110. with the application name. The url name namespace is global. So
  111. ``jobsub.list`` is fine, but ``list`` is not.
  112. Hue is using Django 1.1, which supports the notion of URL namespaces:
  113. http://docs.djangoproject.com/en/dev/topics/http/urls/#url-namespaces.
  114. We have yet to move over our URLs to this construct. Brownie points for the
  115. developer who takes this on.
  116. Using and Installing Thrift
  117. ===========================
  118. Right now, we check in the generated thrift code.
  119. To generate the code, you'll need the thrift binary.
  120. Compile it like so::
  121. $ git clone http://github.com/dreiss/thrift.git
  122. $ cd thrift
  123. $ ./bootstrap.sh
  124. $ ./configure --with-py=no --with-java=no --with-perl=no --prefix=$HOME/pub
  125. We exclude python, java, and perl because they don't like
  126. to install in prefix. If you look around at configure's --help,
  127. there are environment variables that determine where those
  128. runtime bindings are installed.
  129. ::
  130. $ make && make install
  131. When preparing ``.thrift`` files, you can use she-bangs to generate
  132. the python bindings like so::
  133. #!/usr/bin/env thrift -r --gen py:new_style -o ../../../
  134. .. note::
  135. This file is in reStructuredText. You may run
  136. ``rst2html README.rst > README.html`` to produce a HTML.