From 91688d658d385794e0597864e64ef1516971cbb7 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 17 Sep 2024 16:26:56 -0500 Subject: [PATCH] FE-515: Consolidated backfills and runs UI (#23719) ## Summary & Motivation This is a work-in-progress, here's a loom video showing the updates so far: https://www.loom.com/share/6ca6625e4ae34463913c1bffd873f353 --------- Co-authored-by: bengotow Co-authored-by: Marco Salazar Co-authored-by: JamieDeMaria --- .../src/components/CursorControls.tsx | 9 +- .../ui-components/src/components/Icon.tsx | 2 + .../src/icon-svgs/run_with_subruns.svg | 15 + .../dagster-ui/packages/ui-core/client.json | 9 +- .../packages/ui-core/src/app/ContentRoot.tsx | 11 + .../instance/backfill/BackfillActionsMenu.tsx | 131 +++++---- ...b.tsx => BackfillAssetPartitionsTable.tsx} | 16 +- .../instance/backfill/BackfillFragments.tsx | 42 +++ .../src/instance/backfill/BackfillLogsTab.tsx | 2 +- .../backfill/BackfillOverviewDetails.tsx | 63 +++++ .../src/instance/backfill/BackfillPage.tsx | 197 +------------- .../src/instance/backfill/BackfillRow.tsx | 16 +- .../src/instance/backfill/BackfillRunsTab.tsx | 35 ++- .../backfill/BackfillStepStatusDialog.tsx | 18 +- .../src/instance/backfill/BackfillTable.tsx | 31 ++- .../backfill/BackfillTerminationDialog.tsx | 11 +- .../instance/backfill/ExecutionTimeline.tsx | 6 +- .../src/instance/backfill/LiveDuration.tsx | 37 +++ .../backfill/RunsFeedBackfillPage.tsx | 155 +++++++++++ .../__fixtures__/buildBackfillDetails.ts | 4 +- .../backfill/__tests__/BackfillPage.test.tsx | 3 +- ... => BackfillAssetPartitionsTable.types.ts} | 0 ...nu.types.ts => BackfillFragments.types.ts} | 24 ++ .../types/BackfillStepStatusDialog.types.ts | 19 -- .../backfill/types/BackfillTable.types.ts | 28 +- .../types/BackfillTerminationDialog.types.ts | 8 - ...es.ts => useBackfillDetailsQuery.types.ts} | 23 -- .../backfill/useBackfillDetailsQuery.tsx | 73 +++++ .../instance/types/InstanceBackfills.types.ts | 2 +- .../types/JobBackfillsTable.types.ts | 2 +- .../ui-core/src/runs/RunActionsMenu.tsx | 43 ++- .../packages/ui-core/src/runs/RunRoot.tsx | 39 ++- .../packages/ui-core/src/runs/RunRow.tsx | 12 +- .../packages/ui-core/src/runs/RunRowTags.tsx | 2 +- .../packages/ui-core/src/runs/RunTable.tsx | 2 - .../ui-core/src/runs/RunTargetLink.tsx | 5 +- .../ui-core/src/runs/RunsFeedRoot.tsx | 215 +++++++++++++++ .../packages/ui-core/src/runs/RunsFeedRow.tsx | 257 ++++++++++++++++++ .../src/runs/types/RunActionsMenu.types.ts | 25 ++ .../src/runs/types/RunsFeedRoot.types.ts | 98 +++++++ .../src/runs/types/RunsFeedRow.types.ts | 75 +++++ .../src/runs/useCursorAccumulatedQuery.tsx | 16 +- .../ui-core/src/runs/useResolveRunTarget.tsx | 4 +- .../src/ticks/InstigationEventLogTable.tsx | 2 +- node_modules/.yarn-integrity | 12 - 45 files changed, 1352 insertions(+), 447 deletions(-) create mode 100644 js_modules/dagster-ui/packages/ui-components/src/icon-svgs/run_with_subruns.svg rename js_modules/dagster-ui/packages/ui-core/src/instance/backfill/{BackfillPartitionsTab.tsx => BackfillAssetPartitionsTable.tsx} (97%) create mode 100644 js_modules/dagster-ui/packages/ui-core/src/instance/backfill/BackfillFragments.tsx create mode 100644 js_modules/dagster-ui/packages/ui-core/src/instance/backfill/BackfillOverviewDetails.tsx create mode 100644 js_modules/dagster-ui/packages/ui-core/src/instance/backfill/LiveDuration.tsx create mode 100644 js_modules/dagster-ui/packages/ui-core/src/instance/backfill/RunsFeedBackfillPage.tsx rename js_modules/dagster-ui/packages/ui-core/src/instance/backfill/types/{BackfillPartitionsTab.types.ts => BackfillAssetPartitionsTable.types.ts} (100%) rename js_modules/dagster-ui/packages/ui-core/src/instance/backfill/types/{BackfillActionsMenu.types.ts => BackfillFragments.types.ts} (51%) delete mode 100644 js_modules/dagster-ui/packages/ui-core/src/instance/backfill/types/BackfillStepStatusDialog.types.ts rename js_modules/dagster-ui/packages/ui-core/src/instance/backfill/types/{BackfillPage.types.ts => useBackfillDetailsQuery.types.ts} (85%) create mode 100644 js_modules/dagster-ui/packages/ui-core/src/instance/backfill/useBackfillDetailsQuery.tsx create mode 100644 js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedRoot.tsx create mode 100644 js_modules/dagster-ui/packages/ui-core/src/runs/RunsFeedRow.tsx create mode 100644 js_modules/dagster-ui/packages/ui-core/src/runs/types/RunsFeedRoot.types.ts create mode 100644 js_modules/dagster-ui/packages/ui-core/src/runs/types/RunsFeedRow.types.ts delete mode 100644 node_modules/.yarn-integrity diff --git a/js_modules/dagster-ui/packages/ui-components/src/components/CursorControls.tsx b/js_modules/dagster-ui/packages/ui-components/src/components/CursorControls.tsx index ae3214315f00b..06e85da63b8be 100644 --- a/js_modules/dagster-ui/packages/ui-components/src/components/CursorControls.tsx +++ b/js_modules/dagster-ui/packages/ui-components/src/components/CursorControls.tsx @@ -1,4 +1,4 @@ -import styled from 'styled-components'; +import styled, {CSSProperties} from 'styled-components'; import {Button} from './Button'; import {Icon} from './Icon'; @@ -9,6 +9,7 @@ export interface CursorPaginationProps { popCursor: () => void; advanceCursor: () => void; reset: () => void; + style?: CSSProperties; } export const CursorPaginationControls = ({ @@ -16,9 +17,10 @@ export const CursorPaginationControls = ({ hasNextCursor, popCursor, advanceCursor, + style, }: CursorPaginationProps) => { return ( - + @@ -38,9 +40,10 @@ export const CursorHistoryControls = ({ hasNextCursor, popCursor, advanceCursor, + style, }: CursorPaginationProps) => { return ( - + diff --git a/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx b/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx index 9246786b5c852..6ab98e61bed19 100644 --- a/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx +++ b/js_modules/dagster-ui/packages/ui-components/src/components/Icon.tsx @@ -213,6 +213,7 @@ import run_failed from '../icon-svgs/run_failed.svg'; import run_queued from '../icon-svgs/run_queued.svg'; import run_started from '../icon-svgs/run_started.svg'; import run_success from '../icon-svgs/run_success.svg'; +import run_with_subruns from '../icon-svgs/run_with_subruns.svg'; import schedule from '../icon-svgs/schedule.svg'; import schema from '../icon-svgs/schema.svg'; import scim_provision from '../icon-svgs/scim_provision.svg'; @@ -511,6 +512,7 @@ export const Icons = { rss, rule, run, + run_with_subruns, run_canceled, run_failed, run_queued, diff --git a/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/run_with_subruns.svg b/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/run_with_subruns.svg new file mode 100644 index 0000000000000..288410dd51954 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-components/src/icon-svgs/run_with_subruns.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/js_modules/dagster-ui/packages/ui-core/client.json b/js_modules/dagster-ui/packages/ui-core/client.json index 5ce787e4e13ff..e78aa7f5eb4c1 100644 --- a/js_modules/dagster-ui/packages/ui-core/client.json +++ b/js_modules/dagster-ui/packages/ui-core/client.json @@ -50,7 +50,7 @@ "ReportEventMutation": "80b4987cdf27ec8fac25eb6b98b996bd4fdeb4cbfff605d647da5d4bb8244cb0", "AssetWipeMutation": "accefb0c47b3d4a980d16965e8af565afed787a8a987a03570df876bd734dc8f", "RunGroupPanelQuery": "c454b4e4c3d881b2a78361c5868212f734c458291a3cb28be8ba4a63030eb004", - "InstanceBackfillsQuery": "944d836e7cc69aa542d893f9ab84f46e766fb370cfb63be15bd03d67e1b0cff9", + "InstanceBackfillsQuery": "d90a8ec6da1d9a32290e631d2dd0934aac4ba36c0ed78fed0aaa8bd94a15e0c6", "InstanceConcurrencyLimitsQuery": "eff036379500d5b400ba5a0d3f4f22fad1bd42efefbeeafa16b43ca8b160c312", "SetConcurrencyLimit": "758e6bfdb936dff3e4e38f8e1fb447548710a2b2c66fbcad9d4f264a10a61044", "DeleteConcurrencyLimit": "03397142bc71bc17649f43dd17aabf4ea771436ebc4ee1cb40eff2c2848d7b4d", @@ -62,13 +62,13 @@ "RunReExecutionQuery": "95f0a988be27f8d33377eec80eaac91bcbd709e73098e0b12f05f71c4f732077", "StepSummaryForRunQuery": "2890d0cd46c1f4d8b350a5fec57a0558ac3054e0ca93278998d66a54b2ebedbd", "SingleConcurrencyKeyQuery": "fd72bd62ac87f3c72ec589610c7c52398643740f1f2904b04e1e293b08daf763", - "BackfillLogsPageQuery": "f09a06b9d26011fa0d65199eb0dfc799216e28541f1c9c32bba6c93d2d856c91", - "BackfillStatusesByAsset": "f785cda54d7032605fd180e1d1641151836651e3da314fcf8393cf3c43ab9bb4", "BackfillPartitionsForAssetKey": "672b7141fd1dfb275a4ef6ae3e8fc1eaa0707270c1fd329ed6b66058e2376e55", + "BackfillLogsPageQuery": "f09a06b9d26011fa0d65199eb0dfc799216e28541f1c9c32bba6c93d2d856c91", "SingleBackfillQuery": "c2b27d4666926a1c0bfd0c7cfabf9840c67e33a0a374651ee8e52bdec395aa56", "CancelBackfill": "138f5ba5d38b0d939a6a0bf34769cf36c16bb99225204e28e5ab5fcd8baf3194", "resumeBackfill": "89327db4bc94c65ac484fa9b914f28b6c70f09dce91bbaab9aec8593188bdcbe", "LaunchPartitionBackfill": "12402e3e19e32ede40dbc04673d452c2d4b3e6a09509c80fdd065c92e3640daa", + "BackfillStatusesByAsset": "f785cda54d7032605fd180e1d1641151836651e3da314fcf8393cf3c43ab9bb4", "InstanceConfigHasInfo": "771982a9ee439781255f82986d55aa6a75ab2929d784f2cd27b40f537baf7f27", "InstanceWarningQuery": "7ead177b08f678cb85bfebac63b1b25fff6c60c50c862a3c3d20d8d701463823", "InstanceRunQueueConfig": "51de03303f49487cecbfbcd9a6624b8999779a88412c035aced402cb295e40c5", @@ -101,7 +101,7 @@ "DaemonNotRunningAlertQuery": "f016870739b8816036750fb916c536889c862b5d591bf7c552f5cdefde693539", "BackfillSelectorQuery": "715413ccaeb3a6d4b6d9b6ff9aa6cb98ab40e2d4ee1469a9883182f9d3f540b6", "AddDynamicPartitionMutation": "09fbfa963ad43c7fecfc8e4f780e1ca98ffcea9f0b04e916c78061667cb250eb", - "JobBackfillsQuery": "9faca72d06cc7e1fb5423ea3b7f71d6ade5645bcbbe03322e092811de3ba36bd", + "JobBackfillsQuery": "6e804c78aee886ce0b8cd8c8e1f9a004fa0bc6504dc411b5e32c290dd9ae923d", "PartitionsStatusQuery": "b51624d0ee6d3afd7bfd67307b3391318d53e7e3d977d3605f8a405d38c5969e", "PartitionRunListQuery": "a767fc2c778f8dc83fe1c265924cd6e5944e3e0daf6a94b14eda6f45a409f4ec", "PartitionStepStatusPipelineQuery": "d5ef608096052079835b7080ed72204eab4168a32953d065b398ae7de975c0fb", @@ -129,6 +129,7 @@ "Delete": "3c61c79b99122910e754a8863e80dc5ed479a0c23cc1a9d9878d91e603fc0dfe", "Terminate": "67acf403eb320a93c9a9aa07f675a1557e0887d499cd5598f1d5ff360afc15c0", "LaunchPipelineReexecution": "d21e4ecaf3d1d163c4772f1d847dbdcbdaa9a40e6de0808a064ae767adf0c311", + "RunsFeedRootQuery": "3dc4ec68d0d42dff05c4d66bbe5490b2251268c8b68abe84de6e48d64365fb75", "RunTagKeysQuery": "833a405f7cb8f30c0901bc8a272edb51ac5281ebdf563e3017eace5d6976b2a9", "RunTagValuesQuery": "0c0a9998c215bb801eb0adcd5449c0ac4cf1e8efbc6d0fcc5fb6d76fcc95cb92", "ScheduledRunsListQuery": "2650d8ebdfc444fe76fcf8acd9ff54f9ecacdb680b1d83e3f487cb71dd0c7eae", diff --git a/js_modules/dagster-ui/packages/ui-core/src/app/ContentRoot.tsx b/js_modules/dagster-ui/packages/ui-core/src/app/ContentRoot.tsx index 866e0b0847e72..c8c7133071de3 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/app/ContentRoot.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/app/ContentRoot.tsx @@ -5,6 +5,8 @@ import {AssetsOverviewRoot} from 'shared/assets/AssetsOverviewRoot.oss'; import {Route} from './Route'; import {AssetFeatureProvider} from '../assets/AssetFeatureContext'; +import {RunsFeedBackfillPage} from '../instance/backfill/RunsFeedBackfillPage'; +import RunsFeedRoot from '../runs/RunsFeedRoot'; import {lazy} from '../util/lazy'; const WorkspaceRoot = lazy(() => import('../workspace/WorkspaceRoot')); @@ -49,6 +51,15 @@ export const ContentRoot = memo(() => { /> + + + + + + + + + diff --git a/js_modules/dagster-ui/packages/ui-core/src/instance/backfill/BackfillActionsMenu.tsx b/js_modules/dagster-ui/packages/ui-core/src/instance/backfill/BackfillActionsMenu.tsx index f12d4de6515a4..ea7055eb71028 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/instance/backfill/BackfillActionsMenu.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/instance/backfill/BackfillActionsMenu.tsx @@ -1,25 +1,27 @@ -import {Button, Group, Icon, Menu, MenuItem, Popover} from '@dagster-io/ui-components'; +import { + Button, + Group, + Icon, + JoinedButtons, + Menu, + MenuItem, + Popover, +} from '@dagster-io/ui-components'; import {useState} from 'react'; import {useHistory} from 'react-router-dom'; -import { - BACKFILL_STEP_STATUS_DIALOG_BACKFILL_FRAGMENT, - BackfillStepStatusDialog, - backfillCanShowStepStatus, -} from './BackfillStepStatusDialog'; -import { - BACKFILL_TERMINATION_DIALOG_BACKFILL_FRAGMENT, - BackfillTerminationDialog, -} from './BackfillTerminationDialog'; +import {BackfillStepStatusDialog, backfillCanShowStepStatus} from './BackfillStepStatusDialog'; +import {BackfillTerminationDialog} from './BackfillTerminationDialog'; import {RESUME_BACKFILL_MUTATION} from './BackfillUtils'; -import {BackfillActionsBackfillFragment} from './types/BackfillActionsMenu.types'; +import {BackfillActionsBackfillFragment} from './types/BackfillFragments.types'; import {ResumeBackfillMutation, ResumeBackfillMutationVariables} from './types/BackfillUtils.types'; -import {gql, useMutation} from '../../apollo-client'; +import {useMutation} from '../../apollo-client'; import {showCustomAlert} from '../../app/CustomAlertProvider'; import {showSharedToaster} from '../../app/DomUtils'; import {PythonErrorInfo} from '../../app/PythonErrorInfo'; import {BulkActionStatus} from '../../graphql/types'; import {runsPathWithFilters} from '../../runs/RunsFilterInput'; +import {AnchorButton} from '../../ui/AnchorButton'; export function backfillCanCancelSubmission(backfill: { hasCancelPermission: boolean; @@ -60,10 +62,12 @@ export const BackfillActionsMenu = ({ backfill, canCancelRuns, refetch, + anchorLabel, }: { backfill: BackfillActionsBackfillFragment; canCancelRuns: boolean; refetch: () => void; + anchorLabel?: string; }) => { const history = useHistory(); const runsUrl = runsPathWithFilters([ @@ -114,47 +118,55 @@ export const BackfillActionsMenu = ({ const canCancelSubmission = backfillCanCancelSubmission(backfill); + const popover = ( + + history.push(runsUrl)} + /> + { + setShowStepStatus(true); + }} + /> + resume()} + /> + setShowTerminateDialog(true)} + /> + + } + > +