mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-20 16:03:21 +00:00
fix: warn when an autoscaled worker group has no tags to count (#11859)
* fix: warn when an autoscaled worker group has no tags to count Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: drop warning autoscaling events when rolling the migration back Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: drop the autoscaling warning event and its migration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: tell agent groups to match custom tags to their token tags Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: update ee-repo-ref to a673d2e3fe12927921be86c3a52bd9c956759c65 This commit updates the EE repository reference after PR #898 was merged in windmill-ee-private. Previous ee-repo-ref: bbb21dad8a18f0593a2e1a2f2930b427f44404cd New ee-repo-ref: a673d2e3fe12927921be86c3a52bd9c956759c65 Automated by sync-ee-ref workflow. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
windmill-internal-app[bot]
parent
be23abb360
commit
8b14a78822
@@ -15,15 +15,27 @@
|
||||
import Select from './select/Select.svelte'
|
||||
import ScriptPicker from './ScriptPicker.svelte'
|
||||
import { sendUserToast } from '$lib/toast'
|
||||
import { untrack } from 'svelte'
|
||||
|
||||
interface Props {
|
||||
config: AutoscalingConfig | undefined
|
||||
worker_tags: string[] | undefined
|
||||
/** Whether the draft config gives the group any tags (worker_tags or dedicated workers). */
|
||||
group_has_tags: boolean
|
||||
/** Tags reported by the group's live workers, which for agent workers come from their token. */
|
||||
reported_tags: string[]
|
||||
disabled: boolean
|
||||
eeOnly?: boolean
|
||||
}
|
||||
|
||||
let { config = $bindable(), worker_tags, disabled, eeOnly = false }: Props = $props()
|
||||
let {
|
||||
config = $bindable(),
|
||||
worker_tags,
|
||||
group_has_tags,
|
||||
reported_tags,
|
||||
disabled,
|
||||
eeOnly = false
|
||||
}: Props = $props()
|
||||
let test_input: number = $state(3)
|
||||
let healthCheckLoading: boolean = $state(false)
|
||||
let healthCheckResult: { success: boolean; error?: string } | null = $state(null)
|
||||
@@ -54,7 +66,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
let collapsed: boolean = $state(true)
|
||||
let noTagsToCount = $derived(!!config?.enabled && !group_has_tags && !config.custom_tags?.length)
|
||||
|
||||
let collapsed: boolean = $state(untrack(() => !noTagsToCount))
|
||||
</script>
|
||||
|
||||
<Section
|
||||
@@ -99,6 +113,29 @@
|
||||
</div>
|
||||
{/snippet}
|
||||
|
||||
{#if noTagsToCount}
|
||||
<Alert
|
||||
type="warning"
|
||||
size="xs"
|
||||
title="Autoscaling has no tags to count queued jobs for"
|
||||
actions={reported_tags.length && !disabled
|
||||
? [
|
||||
{
|
||||
label: `Use the tags these workers report: ${reported_tags.join(', ')}`,
|
||||
onClick: () => {
|
||||
if (config) config.custom_tags = [...reported_tags]
|
||||
}
|
||||
}
|
||||
]
|
||||
: []}
|
||||
>
|
||||
This group has no worker tags and no custom tags to autoscale on, so queued jobs never trigger
|
||||
a scale-out. Set custom tags under Advanced. For agent workers, set them to the tags in the
|
||||
agents' token: agents take their tags from it, not from this config, so only jobs on matching
|
||||
custom tags trigger a scale-out.
|
||||
</Alert>
|
||||
{/if}
|
||||
|
||||
<div class="flex flex-row gap-4">
|
||||
<Label label="Min # of workers" disabled={config === undefined} class="grow min-w-0">
|
||||
<span class="text-xs text-secondary">The minimum number of workers to scale down to</span>
|
||||
|
||||
@@ -371,6 +371,15 @@
|
||||
|
||||
let drawer: Drawer | undefined = $state()
|
||||
let vcpus_memory = $derived(computeVCpuAndMemory(workers))
|
||||
let reportedTags = $derived(
|
||||
[
|
||||
...new Set(
|
||||
workers.flatMap(([_, pings]) =>
|
||||
pings.filter((p) => (p.last_ping ?? Infinity) < 60).flatMap((p) => p.custom_tags ?? [])
|
||||
)
|
||||
)
|
||||
].sort()
|
||||
)
|
||||
let selected = $derived(
|
||||
nconfig?.dedicated_worker != undefined || nconfig?.dedicated_workers != undefined
|
||||
? 'dedicated'
|
||||
@@ -1043,6 +1052,10 @@
|
||||
|
||||
<AutoscalingConfigEditor
|
||||
worker_tags={config?.worker_tags}
|
||||
group_has_tags={nconfig.worker_tags !== undefined
|
||||
? nconfig.worker_tags.length > 0
|
||||
: (nconfig.dedicated_workers?.length ?? 0) > 0 || nconfig.dedicated_worker !== undefined}
|
||||
reported_tags={reportedTags}
|
||||
bind:config={nconfig.autoscaling}
|
||||
disabled={!canEditEEConfig}
|
||||
eeOnly={!hasEnterpriseFeatures}
|
||||
@@ -1494,7 +1507,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{#if !isAgent}
|
||||
{#if !isAgent || config}
|
||||
<div class="flex gap-4 items-center justify-end flex-row">
|
||||
{#if canEditConfig}
|
||||
{#if width > 1000}
|
||||
@@ -1644,7 +1657,12 @@
|
||||
<div class="mt-4">
|
||||
<Alert type="info" title="Agent Worker Group" size="xs">
|
||||
{#snippet children()}
|
||||
This group is formed with agent workers, there is no associated config. {#if $superadmin || $devopsRole}
|
||||
{#if config}
|
||||
This group is formed with agent workers, which ignore its config except for autoscaling.
|
||||
{:else}
|
||||
This group is formed with agent workers, there is no associated config.
|
||||
{/if}
|
||||
{#if $superadmin || $devopsRole}
|
||||
To modify the tags, generate a new <a
|
||||
href="https://www.windmill.dev/docs/core_concepts/agent_workers#quickstart"
|
||||
target="_blank"
|
||||
|
||||
@@ -1347,8 +1347,8 @@
|
||||
{/if}
|
||||
</div>
|
||||
<div class="pb-8"></div>
|
||||
<!-- Agent worker groups don't have autoscaling -->
|
||||
{#if worker_group?.[2] === false}
|
||||
<!-- An agent worker group is only autoscaled when it has a config row -->
|
||||
{#if worker_group?.[2] === false || (workerGroups ?? {})[selectedTab]}
|
||||
<AutoscalingEvents worker_group={selectedTab} />
|
||||
{/if}
|
||||
{:else}
|
||||
|
||||
Reference in New Issue
Block a user