From f46f14fc8bad7e5684da59f25928bd153378179a Mon Sep 17 00:00:00 2001 From: prha <1040172+prha@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:25:25 -0800 Subject: [PATCH] add a pool info button in the run header on the run view (#26965) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary & Motivation Adds pool information to the run header to help with debugging. Uploading Screen Recording 2025-01-23 at 11.20.29 AM.mov… ## How I Tested These Changes Inspection, saw present on new pool-limited runs. --- .../dagster-ui/packages/ui-core/client.json | 4 +-- .../ui-core/src/runs/RunFragments.tsx | 1 + .../ui-core/src/runs/RunHeaderActions.tsx | 16 +++++++++++ .../ui-core/src/runs/RunPoolsDialog.tsx | 28 +++++++++++++++++++ .../types/RunActionButtonsTestQuery.types.ts | 3 +- .../src/runs/types/RunFragments.types.ts | 2 ++ .../ui-core/src/runs/types/RunRoot.types.ts | 3 +- 7 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 js_modules/dagster-ui/packages/ui-core/src/runs/RunPoolsDialog.tsx diff --git a/js_modules/dagster-ui/packages/ui-core/client.json b/js_modules/dagster-ui/packages/ui-core/client.json index de577a868466b..1be0aff4337a6 100644 --- a/js_modules/dagster-ui/packages/ui-core/client.json +++ b/js_modules/dagster-ui/packages/ui-core/client.json @@ -128,7 +128,7 @@ "RunAssetsQuery": "53c1e7814d451dfd58fb2427dcb326a1e9628c8bbc91b3b9c76f8d6c7b75e278", "RunTabsCountQuery": "5fe1760a3bf0494fb98e3c09f31add5138f9f31d59507a8b25186e2103bebbb4", "RunStepStatsQuery": "77d73353a4aea095bfa241903122abf14eb38341c5869a9688b70c0d53f5a167", - "RunRootQuery": "4f2633b31ddc71c08d3a985be30dc1bf21fbc462287554f165060c51a3554beb", + "RunRootQuery": "2446401f3cc2a0c9275f72528032b89c40dffc88ec7713d41100f458632ccdb5", "RunStatsQuery": "75e80f740a79607de9e1152f9b7074d319197fbc219784c767c1abd5553e9a49", "LaunchPipelineExecution": "292088c4a697aca6be1d3bbc0cfc45d8a13cdb2e75cfedc64b68c6245ea34f89", "LaunchMultipleRuns": "a56d9efdb35e71e0fd1744dd768129248943bc5b23e717458b82c46829661763", @@ -140,7 +140,7 @@ "RunTagValuesQuery": "0c0a9998c215bb801eb0adcd5449c0ac4cf1e8efbc6d0fcc5fb6d76fcc95cb92", "ScheduledRunsListQuery": "2650d8ebdfc444fe76fcf8acd9ff54f9ecacdb680b1d83e3f487cb71dd0c7eae", "TerminateRunIdsQuery": "d38573af47f3ab2f2b11d90cb85ce8426307e2384e67a5b20e2bf67d5c1054bb", - "RunActionButtonsTestQuery": "5d358c3360e683549b885108c3dbb7c1d21d8afd790a5ee963e6e9640ccdbfe8", + "RunActionButtonsTestQuery": "786248dea3d03c174137e2d4334bb6d81d13b1296be8dc9f92de12bb81c133b9", "RunsRootQuery": "091646e47ecea81ba4765a3f2cead18880b09ee400d1d7e9dcb6e194ee364e51", "RunsFeedRootQuery": "5aac6e9b29b52642fec8a45ca86d183a0d7b2d4e092c27a107f37bf5ec4fdfc4", "OngoingRunTimelineQuery": "055420e85ba799b294bab52c01d3f4a4470580606a40483031c35777d88d527f", diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/RunFragments.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/RunFragments.tsx index b34d76e07dab3..4393fd59a50e6 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/RunFragments.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/RunFragments.tsx @@ -14,6 +14,7 @@ export const RUN_FRAGMENT = gql` repositoryName repositoryLocationName } + allPools hasReExecutePermission hasTerminatePermission hasDeletePermission diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/RunHeaderActions.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/RunHeaderActions.tsx index 884b6da11e932..4d25839835bde 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/RunHeaderActions.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/RunHeaderActions.tsx @@ -6,6 +6,7 @@ import {RunMetricsDialog} from 'shared/runs/RunMetricsDialog.oss'; import {DeletionDialog} from './DeletionDialog'; import {QueuedRunCriteriaDialog} from './QueuedRunCriteriaDialog'; import {RunConfigDialog} from './RunConfigDialog'; +import {RunPoolsDialog} from './RunPoolsDialog'; import {doneStatuses} from './RunStatuses'; import {RunsQueryRefetchContext} from './RunUtils'; import {TerminationDialog} from './TerminationDialog'; @@ -13,6 +14,7 @@ import {useMutation} from '../apollo-client'; import {RunFragment} from './types/RunFragments.types'; import {AppContext} from '../app/AppContext'; import {showSharedToaster} from '../app/DomUtils'; +import {useFeatureFlags} from '../app/Flags'; import {useCopyToClipboard} from '../app/browser'; import {RunStatus} from '../graphql/types'; import {FREE_CONCURRENCY_SLOTS_MUTATION} from '../instance/InstanceConcurrency'; @@ -30,6 +32,7 @@ type VisibleDialog = | 'queue-criteria' | 'free_slots' | 'metrics' + | 'pools' | null; export const RunHeaderActions = ({run, isJob}: {run: RunFragment; isJob: boolean}) => { @@ -44,6 +47,7 @@ export const RunHeaderActions = ({run, isJob}: {run: RunFragment; isJob: boolean const copy = useCopyToClipboard(); const history = useHistory(); + const {flagPoolUI} = useFeatureFlags(); const [freeSlots] = useMutation< FreeConcurrencySlotsMutation, FreeConcurrencySlotsMutationVariables @@ -93,6 +97,11 @@ export const RunHeaderActions = ({run, isJob}: {run: RunFragment; isJob: boolean + {run.allPools && run.allPools.length ? ( + + + + + ); +}; diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/__tests__/types/RunActionButtonsTestQuery.types.ts b/js_modules/dagster-ui/packages/ui-core/src/runs/__tests__/types/RunActionButtonsTestQuery.types.ts index cc5a89e67c1fb..138d2493d2160 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/__tests__/types/RunActionButtonsTestQuery.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/__tests__/types/RunActionButtonsTestQuery.types.ts @@ -14,6 +14,7 @@ export type RunActionButtonsTestQuery = { parentPipelineSnapshotId: string | null; runConfigYaml: string; canTerminate: boolean; + allPools: Array | null; hasReExecutePermission: boolean; hasTerminatePermission: boolean; hasDeletePermission: boolean; @@ -60,4 +61,4 @@ export type RunActionButtonsTestQuery = { | {__typename: 'RunNotFoundError'}; }; -export const RunActionButtonsTestQueryVersion = '5d358c3360e683549b885108c3dbb7c1d21d8afd790a5ee963e6e9640ccdbfe8'; +export const RunActionButtonsTestQueryVersion = '786248dea3d03c174137e2d4334bb6d81d13b1296be8dc9f92de12bb81c133b9'; diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/types/RunFragments.types.ts b/js_modules/dagster-ui/packages/ui-core/src/runs/types/RunFragments.types.ts index a54637cd59ee7..5dad25453e428 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/types/RunFragments.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/types/RunFragments.types.ts @@ -7,6 +7,7 @@ export type RunFragment = { id: string; runConfigYaml: string; canTerminate: boolean; + allPools: Array | null; hasReExecutePermission: boolean; hasTerminatePermission: boolean; hasDeletePermission: boolean; @@ -3140,6 +3141,7 @@ export type RunPageFragment = { parentPipelineSnapshotId: string | null; runConfigYaml: string; canTerminate: boolean; + allPools: Array | null; hasReExecutePermission: boolean; hasTerminatePermission: boolean; hasDeletePermission: boolean; diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/types/RunRoot.types.ts b/js_modules/dagster-ui/packages/ui-core/src/runs/types/RunRoot.types.ts index 8c196998cc90a..1c82f2d90e5f2 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/types/RunRoot.types.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/types/RunRoot.types.ts @@ -16,6 +16,7 @@ export type RunRootQuery = { parentPipelineSnapshotId: string | null; runConfigYaml: string; canTerminate: boolean; + allPools: Array | null; hasReExecutePermission: boolean; hasTerminatePermission: boolean; hasDeletePermission: boolean; @@ -62,4 +63,4 @@ export type RunRootQuery = { | {__typename: 'RunNotFoundError'}; }; -export const RunRootQueryVersion = '4f2633b31ddc71c08d3a985be30dc1bf21fbc462287554f165060c51a3554beb'; +export const RunRootQueryVersion = '2446401f3cc2a0c9275f72528032b89c40dffc88ec7713d41100f458632ccdb5';