hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/README.md
A modern React-based web interface for managing and configuring the YARN Capacity Scheduler.
The YARN Capacity Scheduler UI provides an intuitive graphical interface for:
Build the UI as part of the YARN build using the yarn-ui profile:
# From hadoop-yarn directory
cd hadoop-yarn-project/hadoop-yarn
mvn clean package -Pyarn-ui
# From hadoop-yarn-capacity-scheduler-ui directory
cd hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui
mvn clean package -Pyarn-ui
This will:
target/webapp/node/target/hadoop-yarn-capacity-scheduler-ui-*.warThe build creates:
target/webapp/build/client/ - Built React application (static files)target/hadoop-yarn-capacity-scheduler-ui-*.war - Deployable WAR filecd src/main/webapp
# Install dependencies
npm install
# Start development server
npm run dev
The development server runs at http://localhost:5173 with hot module replacement.
Create a .env file in src/main/webapp/ based on .env.example:
# Mock mode: "static" (use mock data), "cluster" (proxy to real cluster), "off" (no mocking)
VITE_API_MOCK_MODE=static
# YARN ResourceManager URL (required when VITE_API_MOCK_MODE=cluster)
VITE_CLUSTER_PROXY_TARGET=http://localhost:8088
# Development flags
VITE_READONLY_MODE=false
VITE_YARN_USER_NAME=admin
npm run dev # Start development server
npm run build # Production build
npm run start # Preview production build
npm run test # Run tests
npm run test:ui # Run tests with UI
npm run test:coverage # Generate test coverage report
npm run lint # Lint code
npm run lint:fix # Fix linting issues
npm run format # Format code with Prettier
# Run all tests
npm test
# Run tests in watch mode
npm run test
# Run tests with coverage
npm run test:coverage
# Run tests with UI
npm run test:ui
The built WAR file can be deployed to a servlet container (Tomcat, Jetty, etc.) or integrated into the YARN ResourceManager web application.
The UI requires access to the following YARN ResourceManager REST API endpoints:
GET /ws/v1/cluster/scheduler - Get scheduler configurationPUT /ws/v1/cluster/scheduler-conf - Update scheduler configurationGET /ws/v1/cluster/scheduler-conf - Get mutable configurationGET /ws/v1/cluster/nodes - Get cluster nodesGET /conf - Get Hadoop configurationWhen deployed alongside the ResourceManager, the UI can access these endpoints directly. The web.xml includes SPA routing configuration to handle client-side routing.
src/main/webapp/
├── src/
│ ├── app/ # React Router application setup
│ ├── components/ # Reusable UI components
│ ├── config/ # Scheduler configuration schemas
│ ├── contexts/ # React contexts
│ ├── features/ # Feature modules
│ │ ├── global-settings/
│ │ ├── node-labels/
│ │ ├── placement-rules/
│ │ ├── property-editor/
│ │ ├── queue-management/
│ │ ├── staged-changes/
│ │ ├── template-config/
│ │ └── validation/
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # API client, utilities
│ ├── stores/ # Zustand stores
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Helper functions
├── public/ # Static assets
└── WEB-INF/ # Web application descriptor
The application uses Zustand for global state management with the following stores:
packagingType: WAR when profile is active, POM otherwisewebappDir: Build directory (${basedir}/target/webapp)nodeExecutable: Path to locally installed Node.jskeepUIBuildCache: Set to true to preserve node_modules between buildsThis module follows Apache Hadoop's contribution guidelines. All source files must include the Apache License header.
Detailed guides for extending and customizing the UI:
Licensed under the Apache License, Version 2.0. See the LICENSE file in the Hadoop root directory.