lablup / lablup/backend.ai

[duplicate] Agent: Migrate Agent server configuration validation to standard Pydantic validators

Open
#6,570 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

Duplicate of [https://lablup.atlassian.net/browse/BA-2619](https://lablup.atlassian.net/browse/BA-2619) (was debugging Github Issue syncing issue)

## ~~Motivation~~

- ~~in~~ `ai.backend.agent.server.main()` ~~(~~[~~Github permalink~~](https://github.com/lablup/backend.ai/blob/main/src/ai/backend/agent/server.py#L1471-L1521)~~) there area configuration validation checks that are currently done outside of Pydantic pipeline which could be implemented using Pydantic’s~~ `@field_validator` ~~and~~ `@model_validator`
- ~~This is helpful in implementing~~ [https://lablup.atlassian.net/browse/BA-2606](https://lablup.atlassian.net/browse/BA-2606) ~~as extending agent configuration becomes easier if we limit the exposure of agent config in other files and functions.~~

## ~~Required Features~~

- ~~All validation checks for agent server must be done with Pydantic’s validation annotations.~~
- ~~Identify places where config validation checks are done (most should be in the main function)~~
- ~~Replace validation checks currently found outside of the model definition in~~ `agent/config/unified.py` ~~with Pydantic’s validation checks embedded in the model definition.~~

## ~~Impact~~

- ~~This change should not modify the functionality of the agent server.~~

## ~~Testing Scenarios~~

- ~~Manual tests should be done to ensure that the config validation checks remain the same.~~

JIRA Issue: BA-2627

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.