Skip to main content

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 in environment/.
  • JobComposer.js — The workflow pane. Manages form state and the job submission flow.
  • schemaRendering/Composer.js — Reads schema.json and 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​

  1. User selects an environment on the start page or in the environment switcher
  2. Frontend fetches the environment's schema.json from the backend
  3. Composer parses the schema and FieldRenderer renders each field
  4. Dynamic fields (e.g., dynamicSelect) call retriever scripts via the backend to populate options
  5. On preview, form values are sent to the backend for script generation
  6. Generated scripts are displayed in PreviewPanel for 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 $ref references for decomposed schemas using jsonref.
  • 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:

  1. Reads map.json to determine how form values map to job variables
  2. Performs direct substitutions ($fieldName) and calls Python functions (!function_name($param)) defined in the environment's utils.py
  3. Processes the driver.sh template with the resolved variables
  4. 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​

LayerTechnology
FrontendReact, Webpack, Babel
BackendPython, Flask, Flask-SocketIO
Schema ProcessingJSON, jsonref
Real-timeWebSockets (eventlet)
App ServerPhusion Passenger (OOD) or standalone Flask
Job SchedulerSlurm (via shell commands)