Ambari code checkout and build instructions are available in Ambari Development page.
Ambari design and architecture is detailed in Ambari Design page.
Understanding the architecture of Ambari is helpful in navigating code easily.
Ambari's source has the following layout
Major components of Ambari reside in their own sub-folders under the root folder, to maintain clean separation of code.
Component or purpose
Code for the main Ambari server which manages Hadoop through the agents installed on each node.
Code for the Ambari agents which run on each node that the server above manages.
Code for Ambari Web UI which interacts with the Ambari server above.
|Code for Ambari Views, the framework for extending the Ambari Web UI.|
Any common code between Ambari Server and Agents.
Code for any custom contributions Ambari makes to other third party software or libraries.
Basic Ambari documentation, including the Ambari REST API.
Ambari Server and Agents interact with each other via an internal JSON protocol.
Ambari Web UI interacts with Ambari Server through the documented Ambari REST APIs.
Folder or File
The main application code. This contains Ember's views, templates, controllers, models, routes, etc. for rendering Ambari UI
Brunch application builder configuration file
npm package manager configuration file
/ambari/ambari-web/public/ folder. This folder contains the
index.html which bootstraps the Ambari web application.
Developers while working should use the
command to launch Brunch in watch mode where it re-generates the final application on any change. Similarly
launches a HTTP server at http://localhost:3333 serving the final application. This is helpful in seeing UI with mock data, without the entire Ambari server deployed.
Note: see "Coding Guidelines for Ambari" for more details on building and running Ambari Web locally.
ambari-web/app/ folder is where developers spend a majority of time, the major files and their purpose is listed below.
Folder or File
Mock data under
The C in MVC. Ember controllers for the main application
Meta data for the application (UI metadata, server data metadata, etc.)
Classes which map server side JSON data structures into client side Ember models.
The M in MVC. Ember Data models used. Clusters, Services, Hosts, Alerts, etc. models are defined here
Ember routes defining the various page redirections in the application.
CSS stylesheets represented in the less format. This is compiled by Brunch into the
The V in MVC. Contains all the Ember views of the application. Main application views under
The HTML templates used by the views above. Generally a view will have a template file. Sometimes views define the template content in themselves as strings
The main Ember application
If a developer adds, removes, or renames a model, view, controller, template, route, they should update the corresponding entry in
models.js, views.js, controllers.js, templates.js, routes.js files.