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 9, 2025
1 parent 236d086 commit a013444
Show file tree
Hide file tree
Showing 20 changed files with 140 additions and 21 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,20 @@ export const AssetSidebarActivitySummary = ({
</>
)}

{pools.length ? (
<SidebarSection title={pools.length === 1 ? 'Pool' : 'Pools'}>
<Box margin={{horizontal: 24, vertical: 12}} flex={{gap: 12, alignItems: 'flex-start'}}>
<Body style={{flex: 1}}>
<Box flex={{gap: 4}}>
{pools.map((group, idx) => (
<PoolTag key={idx} groupName={group} />
))}
</Box>
</Body>
</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((group, idx) => (
<PoolTag key={idx} groupName={group} />
))}
</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 = ({groupName}: {groupName: string}) => {
const groupPath = `/deployment/concurrency/${groupName}`;
const {data} = useQuery<ConcurrencyKeyDetailsQuery, ConcurrencyKeyDetailsQueryVariables>(
CONCURRENCY_KEY_DETAILS_QUERY,
{
variables: {
concurrencyKey: groupName,
},
},
);

return (
<Tag>
<Box flex={{gap: 4, alignItems: 'center'}}>
<Icon name="dynamic_feed" />
<Link to={groupPath}>{groupName}</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.

Loading

0 comments on commit a013444

Please sign in to comment.