|
| 1 | +# Simple Sharetree Editor |
| 2 | + |
| 3 | +A web-based visualization and editing tool for Open Cluster |
| 4 | +Scheduler (OCS) and Gridware Cluster Scheduler (GCS) sharetree |
| 5 | +configurations. |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +Sharetree Editor provides a simple interface for creating, |
| 10 | +viewing, and modifying sharetree hierarchies used by the |
| 11 | +Open Cluster Scheduler (OCS) and Gridware Cluster Scheduler |
| 12 | +(GCS). This tool is designed to make managing complex |
| 13 | +sharetree structures more intuitive through a visual tree |
| 14 | +representation. |
| 15 | + |
| 16 | +> **Note:** This is a very basic share tree editor currently |
| 17 | +not making any interaction with Cluster Scheduler. Based on |
| 18 | +feedback, more functionalities are being added. |
| 19 | + |
| 20 | +## Features |
| 21 | + |
| 22 | +- Visual tree representation of sharetree structures |
| 23 | +- Create, edit, and delete sharetree nodes |
| 24 | +- Automatic calculation of level and total percentages |
| 25 | +- Support for both user and project node types |
| 26 | +- Upload and download sharetree configurations in SGE format |
| 27 | +- Real-time validation of sharetree structures |
| 28 | +- Temporary file storage for session persistence |
| 29 | + |
| 30 | +## Installation |
| 31 | + |
| 32 | +### Prerequisites |
| 33 | + |
| 34 | +- Go 1.23 or higher |
| 35 | +- Web browser with JavaScript enabled |
| 36 | + |
| 37 | +### Setup |
| 38 | + |
| 39 | +1. Clone the repository: |
| 40 | + |
| 41 | + ```bash |
| 42 | + git clone https://github.com/hpc-gridware/go-clusterscheduler.git |
| 43 | + ``` |
| 44 | + |
| 45 | +2. Build and run the application: |
| 46 | + |
| 47 | + ```bash |
| 48 | + cd go-clusterscheduler/cmd/sharetree |
| 49 | + go run main.go |
| 50 | + ``` |
| 51 | + |
| 52 | +3. Open your browser and navigate to: |
| 53 | + |
| 54 | + ``` |
| 55 | + http://localhost:8080 |
| 56 | + ``` |
| 57 | + |
| 58 | +## Usage |
| 59 | + |
| 60 | +### Creating a New Sharetree |
| 61 | + |
| 62 | +- Click "New Sharetree" to start with a clean Root node |
| 63 | +- Use the "Add Child Node" button to add nodes under the currently selected node |
| 64 | +- Use the "Add Sibling Node" to add nodes at the same level |
| 65 | + |
| 66 | +### Editing Nodes |
| 67 | + |
| 68 | +- Click on any node to select it and view its properties in the right panel |
| 69 | +- Modify node properties (name, type, shares) and click "Save Node" |
| 70 | + |
| 71 | +### Uploading and Downloading |
| 72 | + |
| 73 | +- Click "Upload" to import an existing SGE format sharetree file (`qconf -sstree > <sharetree_file>`) |
| 74 | +- Click "Download Sharetree" to export your current sharetree configuration |
| 75 | + (after storing the original sharetree configuration it can be applied |
| 76 | + with `qconf -Astree <sharetree_file>`) |
| 77 | + |
| 78 | +## Development |
| 79 | + |
| 80 | +### Project Structure |
| 81 | + |
| 82 | +- `/pkg/sharetree` - Core sharetree data structure and validation logic |
| 83 | +- `/pkg/app` - Application state management |
| 84 | +- `/pkg/api` - API handlers for the web interface |
| 85 | +- `/templates` - HTML templates for the web UI |
| 86 | +- `/static` - Static assets for the web UI |
| 87 | + |
| 88 | +### Running Tests |
| 89 | + |
| 90 | +```bash |
| 91 | +go test ./... |
| 92 | +``` |
| 93 | + |
| 94 | +### Possible Improvements |
| 95 | + |
| 96 | +- Load sharetree directly from Gridware Cluster Scheduler |
| 97 | +- Load users and projects from Gridware Cluster Scheduler. |
| 98 | +- Use $SGE_ROOT/utilbin/lx-amd64/sge_share_mon for retrieving the sharetree usage. |
| 99 | +- Semantic validation of the sharetree configuration. |
0 commit comments