Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update ml system UI #12334

Merged
merged 57 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
7008a23
[wip] update ui changes
yoonhyejin Jan 14, 2025
6148597
fix typo
yoonhyejin Jan 14, 2025
bbcc2d4
add mlmodellineageinfo
yoonhyejin Jan 14, 2025
963b060
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin Jan 14, 2025
8dd3c25
update mapper for lineageinfo and add uni tests
yoonhyejin Jan 15, 2025
2046691
[wip] add script for creating mlmodel
yoonhyejin Jan 15, 2025
a5f9a3f
spotlessapply
yoonhyejin Jan 15, 2025
054bc1f
feat(graphql/versioning): Add versioning support to graphql; mutation…
asikowitz Jan 15, 2025
06bc8c1
add back fragments.graphql
yoonhyejin Jan 15, 2025
5a6923c
fix tests
RyanHolstien Jan 16, 2025
69da53a
Merge remote-tracking branch 'andrew-fork/versioning-graphql' into fe…
yoonhyejin Jan 16, 2025
314b869
fix fragments.graphql
yoonhyejin Jan 16, 2025
43e3d07
[wip] fix ui bugs
yoonhyejin Jan 16, 2025
e365b06
fix rendering issues
yoonhyejin Jan 17, 2025
88db564
add run event in script
yoonhyejin Jan 17, 2025
b62ef19
update script and add islinegae:True back
yoonhyejin Jan 17, 2025
b5066c6
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin Jan 17, 2025
d4dc426
add mlModel to DPIinput relationships entityTypes
yoonhyejin Jan 20, 2025
31dd659
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin Jan 20, 2025
3c1c3b7
fix container dpi preview
yoonhyejin Jan 21, 2025
cdc23a8
spotlessapply
yoonhyejin Jan 21, 2025
8a92827
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin Jan 21, 2025
0209b7e
fix prefect test
yoonhyejin Jan 21, 2025
2adba1d
fix linting
yoonhyejin Jan 21, 2025
fe1e9cd
fix linting
yoonhyejin Jan 21, 2025
757b914
fix yarn lint
yoonhyejin Jan 21, 2025
c4999be
fix ruff check
yoonhyejin Jan 21, 2025
7a3bdf5
[wip] fix linting
yoonhyejin Jan 21, 2025
f7336bc
fix linting
yoonhyejin Jan 21, 2025
a4c600c
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin Jan 22, 2025
da7aee9
update golden files for dbt & fivetran
yoonhyejin Jan 22, 2025
534e3b4
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin Jan 22, 2025
01f17c3
update golden files for airflow
yoonhyejin Jan 22, 2025
24a9070
update golden files for dags
yoonhyejin Jan 22, 2025
28359e3
fix airflow tests to include dataplatforminstance
yoonhyejin Jan 22, 2025
43fe5e2
fix linitng
yoonhyejin Jan 22, 2025
0501a2b
hacky fix for search filters test
shirshanka Jan 22, 2025
398450c
fix searchfilters cypress test
shirshanka Jan 22, 2025
8cdc27d
some golden file updates
shirshanka Jan 23, 2025
c52a462
Add argparser for token (#6)
ryota-cloud Jan 23, 2025
b198047
update goldens
shirshanka Jan 23, 2025
e48a7a6
fix preview entity
yoonhyejin Jan 23, 2025
426d80c
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin Jan 23, 2025
0d99464
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin Jan 24, 2025
2f4aaea
remove commented out code
yoonhyejin Jan 24, 2025
9f7f298
fix empty ml model message
yoonhyejin Jan 24, 2025
946854c
remove console logs
yoonhyejin Jan 24, 2025
fa713df
pr feedback pair programming
asikowitz Jan 28, 2025
a1d48c2
revert metadata-ingestion/ & metadata-ingestion-modules/ files to head
yoonhyejin Jan 28, 2025
8a42b7e
revert some of the changes manually
yoonhyejin Jan 28, 2025
a33ef73
revert some of the changes manually
yoonhyejin Jan 28, 2025
d4af718
update stylings
yoonhyejin Jan 28, 2025
07adba4
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin Jan 28, 2025
e43ed52
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin Jan 28, 2025
a1c0125
revert search filters
asikowitz Jan 28, 2025
dfd66bf
fix properties.name mapping
yoonhyejin Jan 28, 2025
2b9a418
fix yarnlint
yoonhyejin Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions datahub-graphql-core/src/main/resources/entity.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -9885,6 +9885,21 @@ type MLModelGroup implements EntityWithRelationships & Entity & BrowsableEntity
privileges: EntityPrivileges
}

"""
Represents lineage information for ML entities.
"""
type MLModelLineageInfo {
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved
"""
List of jobs or processes used to train the model.
"""
trainingJobs: [String!]

"""
List of jobs or processes that use this model.
"""
downstreamJobs: [String!]
}

"""
Properties describing a group of related ML models
"""
Expand Down Expand Up @@ -9919,6 +9934,11 @@ type MLModelGroupProperties {
"""
customProperties: [CustomPropertiesEntry!]

"""
Information related to lineage to this model group
"""
mlModelLineageInfo: MLModelLineageInfo

"""
Deprecated creation timestamp
@deprecated Use the 'created' field instead
Expand Down Expand Up @@ -10155,6 +10175,11 @@ type MLModelProperties {
"""
customProperties: [CustomPropertiesEntry!]

"""
Information related to lineage to this model
"""
mlModelLineageInfo: MLModelLineageInfo

"""
URL to view this model in external system
"""
Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/app/entity/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const EntityPage = ({ entityType }: Props) => {
entityType === EntityType.MlfeatureTable ||
entityType === EntityType.MlmodelGroup ||
entityType === EntityType.GlossaryTerm ||
entityType === EntityType.DataProcessInstance ||
entityType === EntityType.GlossaryNode;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,10 @@ import { EntityMenuItems } from '../shared/EntityDropdown/EntityDropdown';
import { capitalizeFirstLetterOnly } from '../../shared/textUtil';
import DataProductSection from '../shared/containers/profile/sidebar/DataProduct/DataProductSection';
import { getDataProduct } from '../shared/utils';
// import SummaryTab from './profile/DataProcessInstaceSummary';

// const getProcessPlatformName = (data?: DataProcessInstance): string => {
// return (
// data?.dataPlatformInstance?.platform?.properties?.displayName ||
// capitalizeFirstLetterOnly(data?.dataPlatformInstance?.platform?.name) ||
// ''
// );
// };
import SummaryTab from './profile/DataProcessInstanceSummary';

const getParentEntities = (data: DataProcessInstance): GeneratedEntity[] => {

const parentEntity = data?.relationships?.relationships?.find(
(rel) => rel.type === 'InstanceOf' && rel.entity?.type === EntityType.DataJob,
);
Expand Down Expand Up @@ -105,10 +98,10 @@ export class DataProcessInstanceEntity implements Entity<DataProcessInstance> {
// name: 'Documentation',
// component: DocumentationTab,
// },
// {
// name: 'Summary',
// component: SummaryTab,
// },
{
name: 'Summary',
component: SummaryTab,
},
{
name: 'Lineage',
component: LineageTab,
Expand All @@ -117,14 +110,6 @@ export class DataProcessInstanceEntity implements Entity<DataProcessInstance> {
name: 'Properties',
component: PropertiesTab,
},
// {
// name: 'Incidents',
// component: IncidentTab,
// getDynamicName: (_, processInstance) => {
// const activeIncidentCount = processInstance?.dataProcessInstance?.activeIncidents.total;
// return `Incidents${(activeIncidentCount && ` (${activeIncidentCount})`) || ''}`;
// },
// },
]}
sidebarSections={this.getSidebarSections()}
/>
Expand Down Expand Up @@ -217,9 +202,9 @@ export class DataProcessInstanceEntity implements Entity<DataProcessInstance> {
parentContainers={data.parentContainers}
parentEntities={parentEntities}
container={data.container || undefined}
// duration={data?.state?.[0]?.durationMillis}
// status={data?.state?.[0]?.result?.resultType}
// startTime={data?.state?.[0]?.timestampMillis}
duration={data?.state[0]?.durationMillis}
status={data?.state[0]?.result?.resultType}
startTime={data?.state[0]?.timestampMillis}
// health={data.health}
/>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import styled from 'styled-components';
import { Space, Table, Typography } from 'antd';
import { MlHyperParam, MlMetric, EntityType } from '../../../../types.generated';
import { useBaseEntity } from '../../shared/EntityContext';
import { InfoItem } from '../../shared/components/styled/InfoItem';
import { GetDataProcessInstanceQuery, useGetDataProcessInstanceQuery } from '../../../../graphql/dataProcessInstance.generated';
import { Pill } from '../../../../alchemy-components/components/Pills';
import { formatDetailedDuration } from '@src/app/shared/time/timeUtils';
import { capitalize } from 'lodash';

const TabContent = styled.div`
padding: 16px;
`;

const InfoItemContainer = styled.div<{ justifyContent }>`
display: flex;
position: relative;
justify-content: ${(props) => props.justifyContent};
padding: 0px 2px;
`;

const InfoItemContent = styled.div`
padding-top: 8px;
width: 100px;
`;

const propertyTableColumns = [
{
title: 'Name',
dataIndex: 'name',
width: 450,
},
{
title: 'Value',
dataIndex: 'value',
},
];


export default function MLModelSummary() {
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved
const baseEntity = useBaseEntity<GetDataProcessInstanceQuery>();
const dpi = baseEntity?.dataProcessInstance;

print("dpi TRP", dpi?.mlTrainingRunProperties);

const formatDate = (timestamp?: number) => {
if (!timestamp) return '-';
const milliseconds = timestamp < 10000000000 ? timestamp * 1000 : timestamp;
return new Date(milliseconds).toISOString().slice(0, 19).replace('T', ' ');
};
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved

const formatStatus = (state) => {
if (!state || state.length === 0) return "-";
const result = state[0]?.result?.resultType;
const statusColor = result === "SUCCESS" ? "green" : "red";
return (
<Pill label={capitalize(result)} colorScheme={statusColor}></Pill>
);
};

const formatDuration = (state) => {
if (!state || state.length === 0) return "-";
return formatDetailedDuration(state[0]?.durationMillis);
};

return (
<TabContent>
<Space direction="vertical" style={{ width: '100%' }} size="large">
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved
<Typography.Title level={3}>Details</Typography.Title>
<InfoItemContainer justifyContent="left">
<InfoItem title="Created At">
<InfoItemContent>{formatDate(dpi?.properties?.created?.time)}</InfoItemContent>
</InfoItem>
<InfoItem title="Created By">
<InfoItemContent>{dpi?.properties?.created?.actor}</InfoItemContent>
</InfoItem>
<InfoItem title="Status">
<InfoItemContent>{formatStatus(dpi?.state)}</InfoItemContent>
</InfoItem>
<InfoItem title="Duration">
<InfoItemContent>{formatDuration(dpi?.state)}</InfoItemContent>
</InfoItem>
<InfoItem title="Run ID">
<InfoItemContent>{dpi?.mlTrainingRunProperties?.id}</InfoItemContent>
</InfoItem>
</InfoItemContainer>
<InfoItemContainer justifyContent="left">
<InfoItem title="Artifacts Location">
<InfoItemContent>{dpi?.mlTrainingRunProperties?.outputUrls}</InfoItemContent>
</InfoItem>
</InfoItemContainer>
<Typography.Title level={3}>Training Metrics</Typography.Title>
<Table
pagination={false}
columns={propertyTableColumns}
dataSource={dpi?.mlTrainingRunProperties?.trainingMetrics as MlMetric[]}
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved
/>
<Typography.Title level={3}>Hyper Parameters</Typography.Title>
<Table
pagination={false}
columns={propertyTableColumns}
dataSource={dpi?.mlTrainingRunProperties?.hyperParams as MlHyperParam[]}
/>
</Space>
</TabContent>
);
}
2 changes: 1 addition & 1 deletion datahub-web-react/src/app/entity/mlModel/MLModelEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class MLModelEntity implements Entity<MlModel> {
};

displayName = (data: MlModel) => {
return data.name || data.urn;
return data.properties?.displayName || data.name || data.urn;
};

getGenericEntityProperties = (mlModel: MlModel) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,52 @@
import React from 'react';
import styled from 'styled-components';
import { Space, Table, Typography } from 'antd';

import { MlHyperParam, MlMetric } from '../../../../types.generated';
import { useEntityRegistry } from '../../../useEntityRegistry';
import { MlHyperParam, MlMetric, EntityType } from '../../../../types.generated';
import { useBaseEntity } from '../../shared/EntityContext';
import { GetMlModelQuery } from '../../../../graphql/mlModel.generated';
import { InfoItem } from '../../shared/components/styled/InfoItem';
import { Link } from 'react-router-dom';

const TabContent = styled.div`
padding: 16px;
`;

const InfoItemContainer = styled.div<{ justifyContent }>`
display: flex;
position: relative;
justify-content: ${(props) => props.justifyContent};
padding: 0px 2px;
`;

const InfoItemContent = styled.div`
padding-top: 8px;
width: 100px;
`;

const VersionTagContainer = styled.span`
padding: 2px 8px;
display: inline-flex;
align-items: center;
border-radius: 4px;
border: 1px solid #d9d9d9;
color: #595959;
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved
background: #fafafa;
margin-right: 8px;
margin-bottom: 4px;
`;

const JobLink = styled(Link)`
color: #1890ff;
&:hover {
text-decoration: underline;
}
`;

export default function MLModelSummary() {
const baseEntity = useBaseEntity<GetMlModelQuery>();
const model = baseEntity?.mlModel;
const entityRegistry = useEntityRegistry();

const propertyTableColumns = [
{
Expand All @@ -26,9 +60,63 @@ export default function MLModelSummary() {
},
];

const formatDate = (timestamp?: number) => {
if (!timestamp) return '-';
const milliseconds = timestamp < 10000000000 ? timestamp * 1000 : timestamp;
return new Date(milliseconds).toISOString().slice(0, 19).replace('T', ' ');
};
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved

const renderTrainingJobs = () => {
const lineageTrainingJobs = model?.properties?.mlModelLineageInfo?.trainingJobs || [];
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved

if (lineageTrainingJobs.length === 0) return '-';

return lineageTrainingJobs.map((jobUrn, index) => (
<div key={jobUrn}>
<JobLink to={entityRegistry.getEntityUrl(EntityType.DataProcessInstance, jobUrn)}>
{jobUrn}
</JobLink>
{index < lineageTrainingJobs.length - 1 && ', '}
</div>
));
};

return (
<TabContent>
<Space direction="vertical" style={{ width: '100%' }} size="large">
<Typography.Title level={3}>Model Details</Typography.Title>
<InfoItemContainer justifyContent="left">
{/* TODO: should use versionProperties? */}
<InfoItem title="Version">
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved
<InfoItemContent>{model?.properties?.version}</InfoItemContent>
</InfoItem>
<InfoItem title="Registered At">
<InfoItemContent>{formatDate(model?.properties?.created?.time)}</InfoItemContent>
</InfoItem>
<InfoItem title="Last Modified At">
<InfoItemContent>{formatDate(model?.properties?.lastModified?.time)}</InfoItemContent>
</InfoItem>
</InfoItemContainer>
<InfoItemContainer justifyContent="left">
<InfoItem title="Created By">
<InfoItemContent>{model?.properties?.created?.actor}</InfoItemContent>
</InfoItem>
<InfoItem title="Aliases">
<InfoItemContent>
{/* use versionProperties for aliases */}
yoonhyejin marked this conversation as resolved.
Show resolved Hide resolved
{/* {model?.versionProperties?.aliases?.map((alias, index) => (
<VersionTagContainer key={`${alias.version}-${index}`}>
{alias.version}
</VersionTagContainer>
))} */}
</InfoItemContent>
</InfoItem>
<InfoItem title="Source Run">
<InfoItemContent>
{renderTrainingJobs()}
</InfoItemContent>
</InfoItem>
</InfoItemContainer>
<Typography.Title level={3}>Training Metrics</Typography.Title>
<Table
pagination={false}
Expand Down
Loading
Loading