Skip to content

Environment & Config Refactor#387

Merged
EvanDietzMorris merged 14 commits intomasterfrom
environment-config-refactor
Apr 7, 2026
Merged

Environment & Config Refactor#387
EvanDietzMorris merged 14 commits intomasterfrom
environment-config-refactor

Conversation

@EvanDietzMorris
Copy link
Copy Markdown
Contributor

Refactors ORION's environment configuration from a manual dotenv_values + os.environ dict to a typed https://docs.pydantic.dev/latest/concepts/pydantic_settings/ BaseSettings class, and modernizes logging, Docker configuration, and documentation.

Configuration

  • Replaced the config dict (dotenv_values + os.environ) with a Config(BaseSettings) class providing typed fields, defaults, and validation
  • All settings are now centralized with sensible defaults, only ORION_STORAGE and ORION_GRAPHS are required for operation
  • Added a field_validator that automatically strips trailing slashes from all _URL fields, preventing inconsistent URL construction
  • Renamed EDGE_NORMALIZATION_ENDPOINT and NODE_NORMALIZATION_ENDPOINT to EDGE_NORMALIZATION_URL and NODE_NORMALIZATION_URL for consistency (also fixed in helm templates)
  • Replaced committed .env file (which contained fake credentials) with a documented .env.example
  • Every os.environ.get() / os.getenv() / CONFIG["..."] call across the codebase replaced with config.ATTRIBUTE access

Logging

  • Replaced the LoggingUtil class in utils.py with a standalone get_orion_logger() function in a new orion/logging.py module
  • Logging settings centralized, no more passing log paths and levels on a module level
  • All modules now use module-level loggers (except loader_interface.py which needs dynamic names per ingest)
  • Logger names shortened from ORION.orion.xxx to orion.xxx

Docker

  • Simplified docker-compose.yml and docker-compose-worker.yml to use env_file directive instead of explicitly declaring env vars
  • Container-specific path overrides (volume mount points) remain as explicit environment: entries
  • Removed persistent log volume mount from the docker compose file (logs go to stdout by default), can still be mounted in helm charts or for other docker usage

Build & CI

  • Updated release.yml to use current action versions (docker/login-action@v3, docker/metadata-action@v5, docker/build-push-action@v6), added permissions block, removed deprecated set-output step
  • Added .dockerignore

Other

  • Renamed set_up_test_env.sh to set_up_dev_env.sh, simplified it
  • Updated README.md to document .env file configuration, set_up_dev_env.sh, and pydantic-settings
  • Bumped robokop-genetics dependency to make logging optional there

@EvanDietzMorris EvanDietzMorris merged commit 15ce5d6 into master Apr 7, 2026
2 checks passed
@EvanDietzMorris EvanDietzMorris deleted the environment-config-refactor branch April 7, 2026 04:58
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.

1 participant