-
Notifications
You must be signed in to change notification settings - Fork 0
Scripts_stories
US CLI Application for Running AI/ML Jobs : Scripts for the CLI application
-
US CLI Application for Running AI/ML Jobs : Scripts for the CLI application
- classes relations
-
User Stories: CLI Application Management
- 1. User Story: Parse Command-Line Arguments
- 2. User Story: Display Settings Schema
- 3. User Story: Read Configuration Files
- 4. User Story: Merge Configuration Settings
- 5. User Story: Validate Configuration Settings
- 6. User Story: Execute the Job
- 7. User Story: Handle No Configuration Provided
- Common Acceptance Criteria
- Definition of Done (DoD):
- Code location
- Test location
classDiagram
direction LR
class Main {
+main(argv: list[str] | None = None) int
}
class ArgumentParser {
+parse_args(argv: list[str] | None) Namespace
}
class MainSettings {
+model_json_schema() dict
+model_validate(object_: dict) MainSettings
+job: Job
}
class Configs {
+parse_file(file: str) dict
+parse_string(string: str) dict
+merge_configs(configs: list[dict]) dict
+to_object(config: dict) Any
}
class Job {
+run()
}
Main --> ArgumentParser : "uses"
Main --> MainSettings : "validates"
Main --> Configs : "parses"
MainSettings --> Job : "contains"
Job --> Main : "executes run()"
Title:
As a user, I want to provide job configuration files and options via command-line arguments, so that I can execute AI/ML jobs conveniently from the terminal.
Description:
The CLI script parses command-line arguments to take in configuration files and other options.
Acceptance Criteria:
- The script successfully retrieves job configuration files and additional strings from the command-line input.
- Help instructions are clearly available when required by the user.
Title:
As a developer, I want to view the settings schema, so that I can understand the structure and requirements of configuration files.
Description:
The CLI application can output the settings schema as JSON when the --schema flag is used.
Acceptance Criteria:
- The schema is printed in JSON format with correct indentation when invoked.
- The application exits successfully after displaying the schema.
Title:
As a user, I want the application to read configuration files in YAML or JSON, so that I can specify my job settings in a structured format.
Description:
The CLI script reads specified configuration files and parses their contents to configure the job properly.
Acceptance Criteria:
- The script can read and parse configuration files without errors.
- The settings gathered from files are stored correctly for further processing.
Title:
As a user, I want to combine settings from both files and command-line strings, so that I can customize my job configurations more flexibly.
Description:
The CLI application merges configurations from multiple sources (files and strings) into a single config object.
Acceptance Criteria:
- The merging process combines settings appropriately without conflicts.
- The final configuration object accurately reflects the merged settings.
Title:
As a user, I want to validate my configuration settings, so I can ensure they conform to the expected structure before running a job.
Description:
The application validates the combined configuration settings against a predefined model.
Acceptance Criteria:
- The settings are validated, and any discrepancies trigger clear error messages.
- Proper messages are presented if validation is successful.
Title:
As a user, I want the application to execute the AI/ML job based on the provided configurations, so that I can carry out the intended operations.
Description:
The CLI invokes the job runner, executing the task as described by the gathered configurations.
Acceptance Criteria:
- The job is executed successfully when appropriate configurations are provided.
- Log messages indicate progress and completion of the job.
Title:
As a user, I want clear feedback if no configurations are provided, so that I can correct my input and try again.
Description:
The application checks if any configurations have been provided and raises an error if none are present.
Acceptance Criteria:
- A RuntimeError is raised when both configuration files and command-line strings are absent.
- The error message clearly informs the user of the missing configurations.
-
Implementation Requirements:
- The CLI application parses arguments correctly, handles files, and executes tasks.
- Clear help instructions are provided as part of the command-line interface.
-
Error Handling:
- Meaningful error messages guide the user in case of issues like missing configurations or validation errors.
-
Testing:
- Unit tests validate command-line parsing, configuration reading, merging, validation, and job execution.
- Tests ensure effective handling of edge cases related to configurations.
-
Documentation:
- Clear and comprehensive docstrings are included for each method and class.
- Users are provided with examples to understand how to use the command-line interface effectively.
- The CLI script is fully functional, allowing for the running of AI/ML jobs with various configurations.
- All user stories are tested, and acceptance criteria are met.
- Documentation is complete and easy to follow.
Powered by MLOps Factory