Skip to content

Refactor air traffic simulator settings and streamline configuration#126

Merged
RomanPszonka merged 5 commits into
mainfrom
dockerize
Apr 25, 2026
Merged

Refactor air traffic simulator settings and streamline configuration#126
RomanPszonka merged 5 commits into
mainfrom
dockerize

Conversation

@RomanPszonka

Copy link
Copy Markdown
Contributor

This pull request introduces significant improvements to the OpenUTM Verification project's development, deployment, and configuration workflows. The main changes include a major overhaul of the Docker build and runtime setup, simplification and consolidation of configuration files, improved local and Docker-based development workflows, and enhanced documentation. These updates make the system easier to configure, develop, and deploy, especially in GUI mode.

Docker and Deployment Workflow Improvements:

  • Replaces multi-stage and development Dockerfiles with a single, streamlined Dockerfile that builds both the backend (FastAPI) and frontend (React) into a single image, and serves both on port 8989. The runtime image is now based on a plain Python image for reduced size and security. The healthcheck is improved to check the actual API endpoint. The Dockerfile.dev and related development/test Compose services are removed, simplifying the setup. [1] [2] [3]

  • Updates .env.example with clearer documentation, environment variable explanations, and improved defaults for Docker Compose, including paths and host mappings for cross-platform compatibility.

Configuration and Defaults Simplification:

  • Simplifies config/default.yaml and config/pull_request.yaml by consolidating air traffic simulator settings under a single section, removing redundant or legacy configuration blocks for BlueSky and Bayesian simulators, and updating default file paths to use the config/bern/ directory for geo-fences. [1] [2] [3]

Development Workflow Enhancements:

  • Adds a comprehensive Makefile with targets for installing dependencies, running tests, linting, formatting, cleaning, running the GUI in Docker, and running backend/frontend locally in development mode with hot-reload.

  • Updates pre-commit hooks to the latest versions for improved linting and code quality tools. [1] [2]

Documentation Improvements:

  • Introduces a new GUI_QUICKSTART.md guide that explains how to run the tool in GUI mode, both via Docker and locally, how to configure the system, manage reports, troubleshoot common issues, and find further documentation.

Most important changes:

1. Docker and Deployment Workflow

  • Major overhaul of the Dockerfile to produce a single image that serves both the FastAPI backend and built React frontend, with improved healthchecks, smaller runtime image, and clearer environment variable usage. Removes Dockerfile.dev and related Compose overrides for a simpler, unified workflow. [1] [2] [3]
  • Updates .env.example for better documentation, Docker Compose compatibility, and easier configuration.

2. Configuration Simplification

  • Consolidates simulator configuration in config/default.yaml and config/pull_request.yaml, removing redundant simulator blocks and updating geo-fence paths for consistency. [1] [2] [3]

3. Developer Experience

  • Adds a new Makefile with targets for common development, test, lint, and GUI workflows, supporting both Docker and hot-reload local development.
  • Updates pre-commit hook versions for better linting and formatting. [1] [2]

4. Documentation

  • Adds GUI_QUICKSTART.md, a detailed guide for running and configuring the GUI, including Docker and local development instructions, troubleshooting, and links to further documentation.

Copilot AI review requested due to automatic review settings April 25, 2026 15:24
RomanPszonka and others added 5 commits April 25, 2026 16:29
- Simplified cleanup script to focus on stopping containers and removing resources.
- Updated run script to streamline options and improve usage clarity.
- Enhanced error handling and validation in configuration management.
- Improved handling of YAML configuration file updates and validation.
- Updated dependencies in lock file to latest versions.
- Added utility function to handle numeric input parsing in the ConfigEditor component.

Co-authored-by: Copilot <copilot@github.com>
… component

- Updated the default values for the AMQP configuration in ConfigScreen to align with backend model.
- Removed the ConfigEditor component, which included configuration settings for Flight Blender, data files, and air traffic simulator.

Co-authored-by: Copilot <copilot@github.com>
…single-user server

Co-authored-by: Copilot <copilot@github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors configuration handling for the OpenUTM Verification tool by moving GUI-driven settings to server-managed YAML, simplifying simulator configuration, and consolidating Docker/dev workflows into a single-image deployment with improved docs.

Changes:

  • Introduces a GUI “Settings” screen backed by new /api/config GET/PUT endpoints and hot-reload support.
  • Consolidates air traffic simulator settings into a single config section and updates related steps, clients, and tests.
  • Streamlines Docker/Compose/scripts and adds Makefile targets and updated documentation for GUI + local dev workflows.

Reviewed changes

Copilot reviewed 48 out of 50 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
web-editor/src/types/scenario.ts Removes legacy per-simulator config types; makes air_traffic_simulator_settings optional.
web-editor/src/hooks/useScenarioRunner.ts Stops sending per-scenario config overrides to /session/reset.
web-editor/src/hooks/tests/useScenarioRunner.test.ts Updates test to assert no per-scenario config is sent on reset.
web-editor/src/hooks/tests/useScenarioFile.test.ts Updates scenario config fixture to match consolidated settings.
web-editor/src/components/ScenarioEditor/ScenarioInfoPanel.tsx Removes embedded per-scenario config editor from the info panel.
web-editor/src/components/ScenarioEditor/PropertiesPanel.tsx Improves enum <select> handling to normalize YAML enum name/value forms.
web-editor/src/components/ScenarioEditor/Header.tsx Adds a Settings button that routes to the new config screen.
web-editor/src/components/ScenarioEditor/ConfigEditor.tsx Deletes the old in-editor config UI.
web-editor/src/components/ScenarioEditor.tsx Replaces hard-coded defaults with an “empty config skeleton”; removes passing config into run flow.
web-editor/src/components/ConfigScreen.tsx Adds a new GUI screen to view/edit server YAML config via /api/config.
web-editor/src/App.tsx Adds hash-based routing between editor and config screen.
web-editor/async_implementation_guide.md Updates examples to use the unified “Stream Air Traffic” step naming.
web-editor/README_GROUPS.md Updates group examples to use “Stream Air Traffic” workflow and naming.
tests/test_suite_scenario_merge.py Adjusts path-layout assumptions for config resolution in tests.
tests/test_reporting_output.py Removes BlueSky/Bayesian simulator settings from reporting config test setup.
tests/test_client_settings.py Updates config model usage for BlueSky settings tests to the unified simulator settings model.
src/openutm_verification/server/runner.py Adds reload_config() and guards empty-scenario execution result handling.
src/openutm_verification/server/main.py Adds /api/config GET/PUT endpoints for config editing + reload; retains session reset API.
src/openutm_verification/scenarios/common.py Removes now-unused get_geo_fence_path helper.
src/openutm_verification/core/steps/air_traffic_step.py Consolidates default application of simulator settings; centralizes config_path resolution from data_files.
src/openutm_verification/core/execution/scenario_runner.py Adds internal_step() decorator to avoid registering internal-only steps in the UI registry.
src/openutm_verification/core/execution/config_models.py Removes BlueSky/Bayesian-specific config models; makes simulator settings optional; improves path resolution semantics.
src/openutm_verification/core/clients/opensky/opensky_client.py Marks OpenSky fetch step as internal-only (not UI/YAML exposed).
src/openutm_verification/core/clients/air_traffic/blue_sky_client.py Marks BlueSky generator steps as internal-only (not UI/YAML exposed).
src/openutm_verification/core/clients/air_traffic/bayesian_air_traffic_client.py Marks Bayesian generator steps as internal-only (not UI/YAML exposed).
src/openutm_verification/core/clients/air_traffic/base_client.py Unifies config type used by simulator settings factory methods.
src/openutm_verification/core/clients/air_traffic/air_traffic_client.py Marks legacy geojson-based generator steps as internal-only (not UI/YAML exposed).
scripts/run.sh Simplifies to “start GUI via compose” wrapper (aligns with make gui).
scripts/cleanup.sh Simplifies cleanup to compose down / remove all / prune dangling.
scripts/build.sh Simplifies build script to build the single “latest” image.
scenarios/airtraffic-simulations/stream_air_traffic_example.yaml Removes the example YAML scenario file.
scenarios/README.md Updates scenario authoring example to use “Stream Air Traffic” instead of groups example.
pyproject.toml Bumps version to 0.2.0 and adds ruamel-yaml dependency for comment-preserving YAML edits.
docs/scenarios/sdsp-f3623/verify_sdsp_metrics.md Updates SDSP metrics scenario docs to the unified “Stream Air Traffic” step.
docs/scenarios/sdsp-f3623/sdsp_track.md Updates SDSP track docs to use “Stream Air Traffic” background task.
docs/scenarios/airtraffic-simulations/openutm_sim_air_traffic_data.md Updates docs to reflect unified “Stream Air Traffic” step.
docs/daa_scenario_authoring_guide.md Updates DAA authoring examples to use “Stream Air Traffic” for BlueSky provider.
docker-compose.yml Converts to a single-service, single-image GUI compose with safer default localhost bind and improved healthcheck.
docker-compose.override.yml Removes dev override compose file.
config/pull_request.yaml Simplifies simulator config and updates geo-fence path to config/bern/.
config/default.yaml Consolidates simulator settings; updates geo-fence and formatting; adjusts suite scenario indentation.
config/bern/geo_fence.geojson Adds a new geo-fence sample under config/bern/.
README.md Overhauls docs to describe GUI mode, local CLI/dev flows, and consolidated docker workflow.
Makefile Adds targets for install/test/lint/format/coverage and GUI/dev workflows.
GUI_QUICKSTART.md Adds a dedicated guide for running the GUI in Docker and locally, with config editing instructions.
Dockerfile.dev Removes development Dockerfile.
Dockerfile Builds a single image (backend + built frontend) and serves via uvicorn; improves build layers and runtime footprint.
.pre-commit-config.yaml Updates hook versions (ruff, codespell, etc.).
.env.example Expands and clarifies environment variable documentation and defaults for Docker usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +132 to +134
} catch (err) {
setMessage({ kind: 'err', text: `Failed to load config: ${err}` });
} finally {

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message uses string interpolation on the caught err value (... ${err}), which often renders as [object Object] and isn’t very actionable. Prefer err instanceof Error ? err.message : String(err) (and optionally log err separately) so the UI shows a useful message.

Copilot uses AI. Check for mistakes.
Comment on lines +205 to +218
const updateATS = (patch: Partial<AirTrafficSim>) =>
setConfig({
...config,
air_traffic_simulator_settings: {
...(config.air_traffic_simulator_settings ?? {
number_of_aircraft: 0,
simulation_duration: 0,
single_or_multiple_sensors: 'single',
sensor_ids: [],
session_ids: [],
}),
...patch,
},
});

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateATS seeds missing air_traffic_simulator_settings with 0 values, and the numeric fields use Number.parseInt(v, 10) || 0. Saving 0 for number_of_aircraft / simulation_duration is problematic because downstream code treats 0 as falsy and silently falls back to defaults (e.g., providers use number_of_aircraft or 2), so the saved config won’t actually take effect. Consider enforcing a minimum of 1 in the UI, and treat an empty input as undefined/null (or make the whole section null) rather than persisting 0.

Copilot uses AI. Check for mistakes.
Comment on lines +53 to +58
// Empty config skeleton. Real values are hydrated from the server's
// /api/config endpoint (which reflects the YAML config). We deliberately
// avoid hard-coded URLs / file paths / sensor IDs here so the GUI never
// ships invented defaults that could overwrite the operator's config on
// /session/reset.
const getEmptyConfig = (): ScenarioConfig => ({

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment claims the scenario config is "hydrated from the server's /api/config endpoint", but this component never fetches /api/config (it only checks /health and fetches /operations). As written, the initial config comes from sessionStorage/defaults or scenario YAML load. Either implement the /api/config hydration here, or adjust the comment to match the actual behavior to avoid confusion.

Copilot uses AI. Check for mistakes.
Comment on lines 12 to 14
4. **Start SDSP Session** - Initiate and terminate SDSP sessions to simulate real-world usage patterns, allowing for the measurement of session-related metrics such as active session count and data volume.
5. **Verify Reported Metrics in Flight Blender** - Check the Flight Blender dashboard and logs to confirm that the metrics for active SDSP sessions, data volume, and update frequency are accurately reported based on the actions performed in the previous steps.
5. **Stop SDSP Session** - Terminate the SDSP sessions to ensure that the system correctly updates the metrics to reflect the cessation of data streams and session activity.

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step list numbering is inconsistent after the edit (1, then 4, then 5, then 5). Please renumber the list so the execution flow is clear and unambiguous.

Suggested change
4. **Start SDSP Session** - Initiate and terminate SDSP sessions to simulate real-world usage patterns, allowing for the measurement of session-related metrics such as active session count and data volume.
5. **Verify Reported Metrics in Flight Blender** - Check the Flight Blender dashboard and logs to confirm that the metrics for active SDSP sessions, data volume, and update frequency are accurately reported based on the actions performed in the previous steps.
5. **Stop SDSP Session** - Terminate the SDSP sessions to ensure that the system correctly updates the metrics to reflect the cessation of data streams and session activity.
2. **Start SDSP Session** - Initiate and terminate SDSP sessions to simulate real-world usage patterns, allowing for the measurement of session-related metrics such as active session count and data volume.
3. **Verify Reported Metrics in Flight Blender** - Check the Flight Blender dashboard and logs to confirm that the metrics for active SDSP sessions, data volume, and update frequency are accurately reported based on the actions performed in the previous steps.
4. **Stop SDSP Session** - Terminate the SDSP sessions to ensure that the system correctly updates the metrics to reflect the cessation of data streams and session activity.

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +62
const labelStyle: React.CSSProperties = {
display: 'block',
fontSize: '12px',
fontWeight: 500,
marginBottom: '4px',
color: 'var(--text-secondary)',
};

const inputStyle: React.CSSProperties = {

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React.CSSProperties is used for style objects, but React isn’t imported in this file (only hooks are). With the automatic JSX runtime this still causes a type error (Cannot find name 'React'). Import type { CSSProperties } from react and use CSSProperties directly, or import React as a type/value so React.CSSProperties is defined.

Copilot uses AI. Check for mistakes.
@RomanPszonka
RomanPszonka merged commit 25412b2 into main Apr 25, 2026
1 of 2 checks passed
@RomanPszonka
RomanPszonka deleted the dockerize branch April 25, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants