Skip to content

Add . env Configuration Support and Validation #10

@cafe3310

Description

@cafe3310

Background

Configuration parameters (model paths, GPU settings, database credentials) are only passed via command line arguments. We need .env file support to centralize configuration management.

Tasks

1. Create .env.example Template

Include variables with comments, inlucding

  • MODEL_PATH: Path to model directory
  • N_GPUS: Number of GPUs to use
  • OUTPUT_DIR: Output directory path
  • DATA_DIR: Data directory path

and other arguments.

2. Create validate_config.py Script

Validate configuration by checking:

  • Required environment variables are set
  • File paths exist and are accessible
  • Integer values are valid (e.g., N_GPUS > 0)

and necessary other arguments.

3. Update requirements.txt

Add python-dotenv to the dependency list.

4. Update README.md

Add a "Configuration" section explaining:

  • How to copy .env.example to .env
  • What each environment variable means
  • How to run python validate_config.py

Definition of Done

  • .env.example created with all required variables
  • validate_config.py validates paths, integers, and database connection
  • requirements.txt updated
  • README.md has configuration instructions
  • Validation script tested with both valid and invalid configurations

Happy Hacking! This task is associated with "OceanBase Developer Carnival" event.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions