Skip to content

Commit

Permalink
UI references to pools
Browse files Browse the repository at this point in the history
  • Loading branch information
prha committed Jan 10, 2025
1 parent 8961b32 commit 9eacecf
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 20 deletions.
18 changes: 9 additions & 9 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 @@ -274,6 +274,7 @@ const SIDEBAR_ASSET_FRAGMENT = gql`
backfillPolicy {
description
}
pools
partitionDefinition {
description
}
Expand Down

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 @@ -313,6 +313,7 @@ export const ASSET_NODE_DEFINITION_FRAGMENT = gql`
jobNames
isMaterializable
isExecutable
pools
tags {
key
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {useGroupedEvents} from './groupByPartition';
import {RecentAssetEvents} from './useRecentAssetEvents';
import {LiveDataForNodeWithStaleData} from '../asset-graph/Utils';
import {SidebarAssetFragment} from '../asset-graph/types/SidebarAssetInfo.types';
import {PoolTag} from '../instance/PoolTag';
import {SidebarSection} from '../pipelines/SidebarComponents';

interface Props {
Expand Down Expand Up @@ -42,6 +43,7 @@ export const AssetSidebarActivitySummary = ({

const grouped = useGroupedEvents(xAxis, materializations, observations, loadedPartitionKeys);
const displayedEvent = isObservable ? observations[0] : materializations[0];
const pools = asset.pools || [];

useEffect(() => {
refetch();
Expand All @@ -60,6 +62,16 @@ export const AssetSidebarActivitySummary = ({
</>
)}

{pools.length ? (
<SidebarSection title={pools.length === 1 ? 'Pool' : 'Pools'}>
<Box margin={{horizontal: 24, vertical: 12}} flex={{gap: 4}}>
{pools.map((pool, idx) => (
<PoolTag key={idx} pool={pool} />
))}
</Box>
</SidebarSection>
) : null}

{asset.freshnessPolicy && (
<SidebarSection title="Freshness policy">
<Box margin={{horizontal: 24, vertical: 12}} flex={{gap: 12, alignItems: 'flex-start'}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const ASSET_TABLE_DEFINITION_FRAGMENT = gql`
key
value
}
pools
jobNames
kinds
repository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {AttributeAndValue, SectionSkeleton} from './Common';
import {showCustomAlert} from '../../app/CustomAlertProvider';
import {COMMON_COLLATOR} from '../../app/Util';
import {DagsterTypeSummary} from '../../dagstertype/DagsterType';
import {PoolTag} from '../../instance/PoolTag';
import {RepoAddress} from '../../workspace/types';
import {workspacePathFromAddress} from '../../workspace/workspacePath';
import {UnderlyingOpsOrGraph} from '../UnderlyingOpsOrGraph';
Expand All @@ -25,6 +26,7 @@ export const ComputeDetailsSection = ({
const {assetType} = metadataForAssetNode(assetNode);
const configType = assetNode?.configField?.configType;
const assetConfigSchema = configType && configType.key !== 'Any' ? configType : null;
const pools = assetNode.pools || [];

return (
<Box flex={{direction: 'column', gap: 12}}>
Expand All @@ -38,6 +40,16 @@ export const ComputeDetailsSection = ({
</Tag>
</AttributeAndValue>

<AttributeAndValue label={pools.length > 1 ? 'Pools' : 'Pool'}>
{pools.length > 0 ? (
<Box flex={{gap: 4}}>
{pools.map((pool, idx) => (
<PoolTag key={idx} pool={pool} />
))}
</Box>
) : null}
</AttributeAndValue>

<AttributeAndValue label="Code version">{assetNode.opVersion}</AttributeAndValue>

<AttributeAndValue label="Resources">
Expand Down

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.

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 @@ -962,6 +962,7 @@ const CONCURRENCY_STEP_FRAGMENT = gql`
const CONCURRENCY_LIMIT_FRAGMENT = gql`
fragment ConcurrencyLimitFragment on ConcurrencyKeyInfo {
concurrencyKey
configuredLimit
slotCount
claimedSlots {
runId
Expand Down Expand Up @@ -1019,7 +1020,7 @@ export const FREE_CONCURRENCY_SLOTS_MUTATION = gql`
}
`;

const CONCURRENCY_KEY_DETAILS_QUERY = gql`
export const CONCURRENCY_KEY_DETAILS_QUERY = gql`
query ConcurrencyKeyDetailsQuery($concurrencyKey: String!) {
instance {
id
Expand Down
39 changes: 39 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/instance/PoolTag.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {Box, Icon, Tag, Tooltip} from '@dagster-io/ui-components';
import {Link} from 'react-router-dom';

import {CONCURRENCY_KEY_DETAILS_QUERY} from './InstanceConcurrency';
import {useQuery} from '../apollo-client';
import {
ConcurrencyKeyDetailsQuery,
ConcurrencyKeyDetailsQueryVariables,
} from './types/InstanceConcurrency.types';

export const PoolTag = ({pool}: {pool: string}) => {
const path = `/deployment/concurrency/${pool}`;
const {data} = useQuery<ConcurrencyKeyDetailsQuery, ConcurrencyKeyDetailsQueryVariables>(
CONCURRENCY_KEY_DETAILS_QUERY,
{
variables: {
concurrencyKey: pool,
},
},
);

return (
<Tag>
<Box flex={{gap: 4, alignItems: 'center'}}>
<Icon name="dynamic_feed" />
<Link to={path}>{pool}</Link>
{data?.instance.concurrencyLimit &&
data.instance.concurrencyLimit.configuredLimit === null ? (
<Tooltip
placement="top"
content="This pool currently does not have any slots configured."
>
<Icon name="check_warning" />
</Tooltip>
) : null}
</Box>
</Tag>
);
};

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.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Box, Colors, NonIdealState} from '@dagster-io/ui-components';

import {ExplorerPath} from './PipelinePathUtils';
import {SidebarSection} from './SidebarComponents';
import {SIDEBAR_OP_DEFINITION_FRAGMENT, SidebarOpDefinition} from './SidebarOpDefinition';
import {SidebarOpExecutionGraphs} from './SidebarOpExecutionGraphs';
import {SIDEBAR_OP_INVOCATION_FRAGMENT, SidebarOpInvocation} from './SidebarOpInvocation';
Expand All @@ -12,6 +13,7 @@ import {
SidebarPipelineOpQuery,
SidebarPipelineOpQueryVariables,
} from './types/SidebarOp.types';
import {PoolTag} from '../instance/PoolTag';
import {OpNameOrPath} from '../ops/OpNameOrPath';
import {LoadingSpinner} from '../ui/Loading';
import {RepoAddress} from '../workspace/types';
Expand Down Expand Up @@ -120,7 +122,7 @@ export const SidebarOp = ({
</Box>
);
}

const pools = solidContainer!.solidHandle!.solid.definition.pools;
return (
<>
<SidebarOpInvocation
Expand All @@ -132,6 +134,17 @@ export const SidebarOp = ({
: undefined
}
/>

{!!pools.length && (
<SidebarSection title={isGraph ? 'Pools' : 'Pool'}>
<Box margin={{horizontal: 24, vertical: 12}} flex={{gap: 4}}>
{pools.map((pool) => (
<PoolTag key={pool} pool={pool} />
))}
</Box>
</SidebarSection>
)}

{!isGraph && repoAddress && (
<SidebarOpExecutionGraphs
key={`${handleID}-graphs`}
Expand Down
Loading

0 comments on commit 9eacecf

Please sign in to comment.