Rules
{ dispatch('dirty') if (e.detail) { if (!config) { config = { enabled: true, min_workers: 3, max_workers: 10, integration: { type: 'dryrun' } } } else { config.enabled = true } } else { config = { ...(config ?? { min_workers: 3, max_workers: 10, integration: { type: 'dryrun' } }), enabled: false } } }} />
Min # of Workers {#if config !== undefined}
dispatch('dirty')} type="number" bind:value={config.min_workers} /> {#if config.min_workers !== undefined && config.min_workers != undefined && config.min_workers > config.max_workers}
Minimum cannot be {'>'} to Maximum
{/if} {:else}
{/if}
Max # of Workers {#if config !== undefined}
dispatch('dirty')} type="number" bind:value={config.max_workers} /> {:else}
{/if}
Cooldown seconds after an incremental scale-in/out {#if config !== undefined}
dispatch('dirty')} type="number" step="1" min="30" placeholder="300" bind:value={config.cooldown_seconds} /> {:else}
{/if}
Cooldown seconds after a full scale out {#if config !== undefined}
dispatch('dirty')} type="number" step="1" min="30" placeholder="1500" bind:value={config.full_scale_cooldown_seconds} /> {:else}
{/if}
Num jobs waiting to trigger an incremental scale-out {#if config !== undefined}
dispatch('dirty')} type="number" bind:value={config.inc_scale_num_jobs_waiting} placeholder="1" /> {:else}
{/if}
Num jobs waiting to trigger a full scale out
Default: max_workers, full scale out = scale out to max workers
{#if config !== undefined}
dispatch('dirty')} type="number" placeholder="max workers" bind:value={config.full_scale_jobs_waiting} /> {:else}
{/if}
Occupancy rate % threshold to go below to trigger a scale-in (decrease)
Default: 25%, need to go below average of all of 15s, 5m and 30m occupancy rates
{#if config !== undefined}
dispatch('dirty')} type="number" step="1" min="0" max="100" placeholder="25" bind:value={config.dec_scale_occupancy_rate} /> {:else}
{/if}
Occupancy rate threshold to exceed to trigger an incremental scale-out (increase)
Default: 75%, need to exceed average of all of 15s, 5m and 30m occupancy rates
{#if config !== undefined}
dispatch('dirty')} type="number" step="1" min="0" max="100" placeholder="75" bind:value={config.inc_scale_occupancy_rate} /> {:else}
{/if}
Num workers to scale-in/out by when incremental
Default: (max_workers - min_workers) / 5
{#if config !== undefined}
dispatch('dirty')} type="number" step="1" min="1" placeholder="(max_workers - min_workers) / 5" bind:value={config.inc_num_workers} /> {:else}
{/if}
By default, autoscaling will apply to the tags the worker group is assigned to but you can override this here.
{#if config} {#if config.custom_tags}
{ console.log(e.detail.type, config?.custom_tags) if (e.detail && config?.custom_tags) { if (e.detail.type === 'add') { config.custom_tags = [ ...config.custom_tags, ...(e.detail.option ? [e.detail.option.toString()] : []) ] } else if (e.detail.type === 'remove') { config.custom_tags = config.custom_tags.filter((t) => t !== e.detail.option) if (config?.custom_tags && config.custom_tags.length == 0) { config.custom_tags = undefined } } else if (e.detail.type === 'removeAll') { config.custom_tags = undefined } else { console.error( `Priority tags multiselect - unknown event type: '${e.detail.type}'` ) } dispatch('dirty') } }} options={worker_tags ?? []} selectedOptionsDraggable={false} ulOptionsClass={'!bg-surface-secondary'} placeholder="Tags" /> {:else}
{ if (config) { config.custom_tags = [] dispatch('dirty') } }}>Add custom tags
{/if} {/if}
Integration
{#if config?.integration}
dispatch('dirty')} bind:selected={config.integration.type} class="mb-4 mt-2" let:item >
{#if config.integration.type === 'script'}
Script path on the 'admins' workspace
dispatch('dirty')} type="text" bind:value={config.integration.path} />
Custom tag for executing script (optional) {#if config.integration.tag}
dispatch('dirty')} type="text" bind:value={config.integration.tag} /> {:else}
{ if (config?.integration?.type === 'script') { config.integration.tag = 'bash' dispatch('dirty') } }}>Set tag
{/if}
Create from template
See jobs
Test scaling
workers
{/if} {:else}
Script path on the 'admins' workspace
{/if}