feat: add runner failover policies and traces
This commit is contained in:
+16
-5
@@ -8,6 +8,7 @@ import type {
|
||||
GatewayApiKey,
|
||||
GatewayAuditLog,
|
||||
GatewayNetworkProxyConfig,
|
||||
GatewayRunnerPolicy,
|
||||
GatewayTenantUpsertRequest,
|
||||
GatewayTask,
|
||||
GatewayUserUpsertRequest,
|
||||
@@ -43,6 +44,7 @@ import {
|
||||
deleteUserGroup,
|
||||
getHealth,
|
||||
getNetworkProxyConfig,
|
||||
getRunnerPolicy,
|
||||
getTask,
|
||||
getWalletSummary,
|
||||
listAccessRules,
|
||||
@@ -58,11 +60,11 @@ import {
|
||||
listPlatforms,
|
||||
listPricingRules,
|
||||
listPricingRuleSets,
|
||||
listPublicBaseModels,
|
||||
listPublicCatalogProviders,
|
||||
listRuntimePolicySets,
|
||||
listTasks,
|
||||
listWalletTransactions,
|
||||
listPublicBaseModels,
|
||||
listPublicCatalogProviders,
|
||||
listRateLimitWindows,
|
||||
listTenants,
|
||||
listUserGroups,
|
||||
@@ -135,6 +137,7 @@ type DataKey =
|
||||
| 'baseModels'
|
||||
| 'pricingRules'
|
||||
| 'pricingRuleSets'
|
||||
| 'runnerPolicy'
|
||||
| 'runtimePolicySets'
|
||||
| 'rateLimitWindows'
|
||||
| 'tenants'
|
||||
@@ -175,6 +178,7 @@ export function App() {
|
||||
const [baseModels, setBaseModels] = useState<BaseModelCatalogItem[]>([]);
|
||||
const [pricingRules, setPricingRules] = useState<PricingRule[]>([]);
|
||||
const [pricingRuleSets, setPricingRuleSets] = useState<PricingRuleSet[]>([]);
|
||||
const [runnerPolicy, setRunnerPolicy] = useState<GatewayRunnerPolicy | null>(null);
|
||||
const [runtimePolicySets, setRuntimePolicySets] = useState<RuntimePolicySet[]>([]);
|
||||
const [accessRules, setAccessRules] = useState<GatewayAccessRule[]>([]);
|
||||
const [auditLogs, setAuditLogs] = useState<GatewayAuditLog[]>([]);
|
||||
@@ -217,9 +221,10 @@ export function App() {
|
||||
setPricingRuleSets,
|
||||
token,
|
||||
});
|
||||
const { removeRuntimePolicySet, saveRuntimePolicySet } = useRuntimePolicySetOperations({
|
||||
const { removeRuntimePolicySet, saveRunnerPolicy, saveRuntimePolicySet } = useRuntimePolicySetOperations({
|
||||
setCoreMessage,
|
||||
setCoreState,
|
||||
setRunnerPolicy,
|
||||
setRuntimePolicySets,
|
||||
token,
|
||||
});
|
||||
@@ -269,6 +274,7 @@ export function App() {
|
||||
modelCatalog,
|
||||
models,
|
||||
networkProxyConfig,
|
||||
runnerPolicy,
|
||||
platforms,
|
||||
pricingRules,
|
||||
pricingRuleSets,
|
||||
@@ -282,7 +288,7 @@ export function App() {
|
||||
users,
|
||||
walletAccounts,
|
||||
walletTransactions,
|
||||
}), [accessRules, apiKeys, auditLogs, baseModels, modelCatalog, models, networkProxyConfig, platforms, pricingRuleSets, pricingRules, providers, rateLimitWindows, runtimePolicySets, taskResult, tasks, tenants, userGroups, users, walletAccounts, walletTransactions]);
|
||||
}), [accessRules, apiKeys, auditLogs, baseModels, modelCatalog, models, networkProxyConfig, platforms, pricingRuleSets, pricingRules, providers, rateLimitWindows, runnerPolicy, runtimePolicySets, taskResult, tasks, tenants, userGroups, users, walletAccounts, walletTransactions]);
|
||||
|
||||
async function refresh(nextToken = token) {
|
||||
await ensureRouteData(nextToken, true);
|
||||
@@ -377,6 +383,9 @@ export function App() {
|
||||
case 'pricingRuleSets':
|
||||
setPricingRuleSets((await listPricingRuleSets(nextToken)).items);
|
||||
return;
|
||||
case 'runnerPolicy':
|
||||
setRunnerPolicy(await getRunnerPolicy(nextToken));
|
||||
return;
|
||||
case 'runtimePolicySets':
|
||||
setRuntimePolicySets((await listRuntimePolicySets(nextToken)).items);
|
||||
return;
|
||||
@@ -774,6 +783,7 @@ export function App() {
|
||||
setBaseModels([]);
|
||||
setPricingRules([]);
|
||||
setPricingRuleSets([]);
|
||||
setRunnerPolicy(null);
|
||||
setRuntimePolicySets([]);
|
||||
setAccessRules([]);
|
||||
setAuditLogs([]);
|
||||
@@ -948,6 +958,7 @@ export function App() {
|
||||
onSavePlatform={savePlatformWithModels}
|
||||
onSaveProvider={saveProvider}
|
||||
onSavePricingRuleSet={savePricingRuleSet}
|
||||
onSaveRunnerPolicy={saveRunnerPolicy}
|
||||
onSaveRuntimePolicySet={saveRuntimePolicySet}
|
||||
onBatchAccessRules={batchSaveAccessRules}
|
||||
onSaveAccessRule={saveAccessRule}
|
||||
@@ -1127,7 +1138,7 @@ function dataKeysForRoute(
|
||||
case 'pricing':
|
||||
return ['pricingRuleSets'];
|
||||
case 'runtime':
|
||||
return ['runtimePolicySets'];
|
||||
return ['runtimePolicySets', 'runnerPolicy'];
|
||||
case 'baseModels':
|
||||
return ['baseModels', 'providers', 'pricingRuleSets', 'runtimePolicySets'];
|
||||
case 'platforms':
|
||||
|
||||
Reference in New Issue
Block a user