feat: add yaml config option to standalone AI gateway - #28258
Conversation
ssncferreira
left a comment
There was a problem hiding this comment.
LGTM, just a few suggestions
| defer stop() | ||
|
|
||
| if vals.Config != "" { | ||
| cliui.Warnf(inv.Stderr, "YAML support is experimental and offers no compatibility guarantees.") |
There was a problem hiding this comment.
Is this under an experimental flag? 🤔 or is it just to say that "we reserve the right to change the YAML schema without keeping backward compatibility"
There was a problem hiding this comment.
This is copied from coder server:
Lines 424 to 426 in 1fbd029
My understanding is that YAML configuration was added some time ago but never "matured" out of experimental status when it was added.
| // Fake coderd that answers 503 so the daemon keeps retrying to connect. | ||
| coderURL := startUnreachableCoderd(t) | ||
| configFile := filepath.Join(t.TempDir(), "config.yaml") | ||
| err := os.WriteFile(configFile, []byte( |
There was a problem hiding this comment.
nit: should we add a test where the config contains an invalid schema? I assume the CLI will fail in that case, saying it is an unknown field or something like that
6170905 to
f36230c
Compare
f36230c to
c4ed2fb
Compare
Summary
coder ai-gateway startnow accepts a--config/-cflag (andCODER_CONFIG_PATH) to load configuration from a YAML file, matchingcoder server.Details
Config Pathoption (--config/CODER_CONFIG_PATH) into the standalone AI Gateway command, so YAML config is loaded and applied by serpent.coder serveruses when a config file is set.TestAIGatewayStart_InheritedOptionsto include theConfiggroup.TestAIGatewayStart_ConfigYAML, an end-to-end test that enables the Prometheus listener via YAML and verifies it comes up.startUnreachableCoderdtest helper.