fix: stabilize sub2api codex pool operations
This commit is contained in:
@@ -100,15 +100,22 @@ export interface CodexPoolSentinelManifestOptions {
|
||||
}
|
||||
|
||||
export function codexPoolSentinelRuntimeImage(config: CodexPoolSentinelConfig): CodexPoolSentinelImageTarget {
|
||||
const [repository, tag = "latest"] = config.image.split(":");
|
||||
const tag = sentinelRuntimeImageTag(config.image, config.sdk.openaiPythonVersion);
|
||||
return {
|
||||
baseImage: config.image,
|
||||
runtimeImage: config.image,
|
||||
repository: repository ?? config.image,
|
||||
runtimeImage: `127.0.0.1:5000/platform-infra/sub2api-account-sentinel:${tag}`,
|
||||
repository: "127.0.0.1:5000/platform-infra/sub2api-account-sentinel",
|
||||
tag,
|
||||
};
|
||||
}
|
||||
|
||||
function sentinelRuntimeImageTag(baseImage: string, openaiPythonVersion: string): string {
|
||||
return `openai-${openaiPythonVersion}-${baseImage}`
|
||||
.replace(/[^A-Za-z0-9_.-]+/gu, "-")
|
||||
.replace(/^-+/u, "")
|
||||
.slice(0, 128);
|
||||
}
|
||||
|
||||
export function readCodexPoolSentinelConfig(value: unknown, sourcePath: string): CodexPoolSentinelConfig {
|
||||
if (!isRecord(value)) throw new Error(`${sourcePath}.sentinel must be a YAML object`);
|
||||
const monitor = readRequiredRecord(valueAt(value, "monitor"), `${sourcePath}.sentinel.monitor`);
|
||||
|
||||
Reference in New Issue
Block a user