Skip to content

Commit

Permalink
add a pool info button in the run header on the run view (#26965)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
prha authored Jan 24, 2025
1 parent cf951d6 commit f46f14f
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 4 deletions.
4 changes: 2 additions & 2 deletions js_modules/dagster-ui/packages/ui-core/client.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const RUN_FRAGMENT = gql`
repositoryName
repositoryLocationName
}
allPools
hasReExecutePermission
hasTerminatePermission
hasDeletePermission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ 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';
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';
Expand All @@ -30,6 +32,7 @@ type VisibleDialog =
| 'queue-criteria'
| 'free_slots'
| 'metrics'
| 'pools'
| null;

export const RunHeaderActions = ({run, isJob}: {run: RunFragment; isJob: boolean}) => {
Expand All @@ -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
Expand Down Expand Up @@ -93,6 +97,11 @@ export const RunHeaderActions = ({run, isJob}: {run: RunFragment; isJob: boolean
<Button icon={<Icon name="tag" />} onClick={() => setVisibleDialog('config')}>
View tags and config
</Button>
{run.allPools && run.allPools.length ? (
<Tooltip content="View pools" position="top" targetTagName="div">
<Button icon={<Icon name="concurrency" />} onClick={() => setVisibleDialog('pools')} />
</Tooltip>
) : null}
<Popover
position="bottom-right"
content={
Expand Down Expand Up @@ -204,6 +213,13 @@ export const RunHeaderActions = ({run, isJob}: {run: RunFragment; isJob: boolean
selectedRuns={{[run.id]: run.canTerminate}}
/>
) : null}
{flagPoolUI && run.allPools && run.allPools.length ? (
<RunPoolsDialog
isOpen={visibleDialog === 'pools'}
pools={run.allPools}
onClose={() => setVisibleDialog(null)}
/>
) : null}
</div>
);
};
28 changes: 28 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/runs/RunPoolsDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {Box, Button, Dialog, DialogFooter} from '@dagster-io/ui-components';

import {PoolTag} from '../instance/PoolTag';

export const RunPoolsDialog = ({
isOpen,
onClose,
pools,
}: {
isOpen: boolean;
onClose: () => void;
pools: string[];
}) => {
return (
<Dialog isOpen={isOpen} onClose={onClose} canOutsideClickClose canEscapeKeyClose title="Pools">
<Box margin={{horizontal: 24, vertical: 12}} flex={{gap: 12}}>
{pools.map((pool) => (
<PoolTag key={pool} pool={pool} />
))}
</Box>
<DialogFooter topBorder>
<Button onClick={onClose} intent="primary">
Close
</Button>
</DialogFooter>
</Dialog>
);
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit f46f14f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-ksdrnrq80-elementl.vercel.app

Built with commit f46f14f.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.