README 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. Welcome to the repository for Hue.
  2. *********************************************************************
  3. This is the development-oriented readme. If you want to write notes for
  4. end users, put them in dist/README!
  5. *********************************************************************
  6. File Layout
  7. ===========
  8. The "core" stuff is in desktop/core/, whereas installable apps live in apps/.
  9. Please place third-party dependencies in the app's ext-py/ directory.
  10. The typical directory structure for inside a component includes:
  11. src/, for Python code
  12. static/, for static HTML and js resources
  13. templates/, for data to be put through a template engine
  14. docs/, for helpful notes
  15. The python code is structured simply:
  16. module/package.py
  17. Where module may be "filebrowser" or "jobsub". Because it is unlikely that
  18. there are going to be huge conflicts, we're going without a deep nested
  19. hierarchy.
  20. URL Layout
  21. ==========
  22. core/src/desktop/urls.py contains the current layout for top-level URLs.
  23. For the URLs within your application, you should make your own urls.py which will
  24. be automatically rooted at /yourappname/ in the global namespace. See
  25. apps/hello/src/hello/urls.py for an example.
  26. Development Prerequisites
  27. ===========================
  28. 1) On your host system, you need to have the python "virtualenv" package installed.
  29. 2) Also, you'll need some library development packages installed on your system:
  30. Debian:
  31. gcc
  32. libldap2-dev
  33. libmysqlclient-dev
  34. libsasl2-dev
  35. libsqlite3-dev
  36. libssl-dev
  37. libxml2-dev
  38. libxslt-dev
  39. python-dev
  40. python-setuptools
  41. CentOS:
  42. cyrus-sasl-devel
  43. gcc
  44. libxml2-devel
  45. libxslt-devel
  46. mysql
  47. mysql-devel
  48. openldap-devel
  49. openssl
  50. python-devel
  51. python-setuptools
  52. sqlite-devel
  53. python-simplejson (for the crepo tool)
  54. MacOS (mac port):
  55. liblxml
  56. libxml2
  57. libxslt
  58. mysql5-devel
  59. simplejson (easy_install)
  60. sqlite3
  61. 3) You need to have crepo installed, and preferably on your path. If it is not
  62. on your path, set the environment variable CREPO to point to crepo.py from that
  63. distribution. You can clone crepo from git://github.com/cloudera/crepo.git somewhere
  64. else on your system.
  65. Getting Started
  66. ===============
  67. 1) git clone http://github.com/cloudera/hue.git ; cd hue
  68. [ you've assumedly already done this, since you're reading this file! ]
  69. 2) make apps
  70. 3) Start the server
  71. build/env/bin/desktop runserver_plus
  72. Setting up Hadoop
  73. =====================
  74. In order to start up a pseudodistributed cluster with the plugins enabled,
  75. run ./tools/scripts/configure-hadoop.sh all
  76. After doing so, running "jps" should show all the daemons running (NN, JT, TT, DN)
  77. and you should be able to see the web UI on http://localhost:50030/ and
  78. http://localhost:50070/
  79. FAQ
  80. ===
  81. Q: What does "Exception: no app!" mean?
  82. A: Your template has an error in it. Check for messages from
  83. the server that look like:
  84. INFO:root:Processing exception: Unclosed tag 'if'. Looking for one of: else, endif
  85. Q. What do I do if I get "There was an error launching ..."?
  86. A. Turn on debugging by issuing "dbug.cookie()" in a Firebug console.
  87. Django Conventions
  88. ==================
  89. If you need to name your urls
  90. (http://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns)
  91. because there's ambiguity in the view, be sure to prefix the name
  92. with the application name. The url name namespace is global. So "jobsub.list" is fine,
  93. but "list" is not.
  94. We recently moved to Django 1.1, which supports the notion of URL namespaces:
  95. http://docs.djangoproject.com/en/dev/topics/http/urls/#url-namespaces
  96. We have yet to move over our URLs to this construct. Brownie points for the developer
  97. who takes this on. (TODO)
  98. Using and Installing Thrift
  99. ===========================
  100. Thrift's runtime libraries are checked into thirdparty/,
  101. as appropriate. Right now, we check in the generated code.
  102. To generate the code, you'll need the thrift binary.
  103. We keep a private copy of the Thrift tree, because
  104. Thrift tends to be mired in a version-less morass.
  105. Compile it like so:
  106. 1) git clone http://github.com/dreiss/thrift.git
  107. 2) cd thrift
  108. 4) ./bootstrap.sh
  109. 5) ./configure --with-py=no --with-java=no --with-perl=no --prefix=$HOME/pub
  110. We exclude python, java, and perl because they don't like
  111. to install in prefix. If you look around at configure's --help,
  112. there are environment variables that determine where those
  113. runtime bindings are installed.
  114. 6) make && make install
  115. When preparing .thrift files, you can use she-bangs to generate
  116. the python bindings like so:
  117. #!/usr/bin/env thrift -r --gen py:new_style -o ../../../