Architecture
Drona Workflow Engine is a React/Flask application that turns Drona Environments, which are defined in JSON, into dynamic forms for HPC job submission. This page describes how the major components fit together.
High-Level Overview
The frontend renders dynamic forms from schema.json, the backend processes form submissions through map.json and utils.py, and the resulting job scripts are submitted to the HPC scheduler.
Frontend
The frontend is a React application built with Webpack and Babel. Key components:
AppShell.js— Page frame: app bar, start page or workflow pane, and the import dialog. The start page and environment switcher are inenvironment/.JobComposer.js— The workflow pane. Manages form state and the job submission flow.schemaRendering/Composer.js— Readsschema.jsonand orchestrates form rendering.schemaRendering/FieldRenderer.js— Takes a field definition from the schema and renders the appropriate form component (text, select, checkbox, etc.).schemaRendering/schemaElements/— Individual form components (Text, Select, DynamicSelect, Module, Time, Uploader, etc.). See Form Components for the full reference.PreviewPanel.jsx— Displays generated job scripts in an editable preview window before submission.EnvironmentModal.js— Handles environment import from the configured repository.FormValuesContext.js— React context that provides form state to all components, enabling conditional visibility and dynamic field updates.
Data Flow
- User selects an environment on the start page or in the environment switcher
- Frontend fetches the environment's
schema.jsonfrom the backend Composerparses the schema andFieldRendererrenders each field- Dynamic fields (e.g.,
dynamicSelect) call retriever scripts via the backend to populate options - On preview, form values are sent to the backend for script generation
- Generated scripts are displayed in
PreviewPanelfor review and editing
Backend
The backend is a Flask application served through Passenger (in OOD deployments) or directly via app.py. Routes are organized into blueprints under views/:
job_composer.py— Main blueprint. Handles environment listing, form submission, job preview, and job submission.schema_routes.py— Serves schema files and processes$refreferences for decomposed schemas usingjsonref.file_utils.py— File operations for uploads, directory browsing, and job file management.socket_handler.py— WebSocket support via Flask-SocketIO for real-time communication.environments.py— Environment discovery and management (system and user environments).env_repo_manager.py— Handles cloning and managing the environment import repository.history_manager.py— Tracks workflow history: each submitted workflow and its jobs.job_routes.py— Job status and management endpoints.
Script Generation
When a user submits a form, the backend:
- Reads
map.jsonto determine how form values map to job variables - Performs direct substitutions (
$fieldName) and calls Python functions (!function_name($param)) defined in the environment'sutils.py - Processes the
driver.shtemplate with the resolved variables - Returns the generated scripts for preview
This processing is handled by machine_driver_scripts/engine.py and machine_driver_scripts/utils.py.
Drona Environment Files
Each Drona Environment is a self-contained directory. These are its main files; only schema.json, map.json and driver.sh are required:
MyEnvironment/
├── schema.json # Form definition
├── map.json # Variable mapping
├── driver.sh # Job script template
├── manifest.yml # Name, version, description, required Drona version
├── utils.py # Custom processing functions
└── retrievers/ # Dynamic data scripts
For details on each file, see the Environment Development section.
Environment Discovery
Drona loads system environments from environments/ in its installation directory, and user environments from the Drona root directory configured during first-time setup.
See First-Time Initialization for details.
Drona scans the environments/ subdirectory within that configured drona_dir for available user environments:
<drona_dir>/
└── environments/
The backend scans this directory on startup and when the environment list is refreshed. To change the root directory, update drona_dir in ~/.drona/config.json and restart Drona.
Workflow Execution Process
Configuration
Application configuration lives in config.yml at the project root, with separate development and production blocks. The app auto-detects which to use based on whether it's running from an OOD dev or sys directory. See Installation for configuration details.
Technology Stack
| Layer | Technology |
|---|---|
| Frontend | React, Webpack, Babel |
| Backend | Python, Flask, Flask-SocketIO |
| Schema Processing | JSON, jsonref |
| Real-time | WebSockets (eventlet) |
| App Server | Phusion Passenger (OOD) or standalone Flask |
| Job Scheduler | Slurm (via shell commands) |