-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
asikowitz
merged 57 commits into
datahub-project:master
from
yoonhyejin:feat/update-mlflow-ui
Jan 29, 2025
Merged
feat: update ml system UI #12334
Changes from 55 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
7008a23
[wip] update ui changes
yoonhyejin 6148597
fix typo
yoonhyejin bbcc2d4
add mlmodellineageinfo
yoonhyejin 963b060
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin 8dd3c25
update mapper for lineageinfo and add uni tests
yoonhyejin 2046691
[wip] add script for creating mlmodel
yoonhyejin a5f9a3f
spotlessapply
yoonhyejin 054bc1f
feat(graphql/versioning): Add versioning support to graphql; mutation…
asikowitz 06bc8c1
add back fragments.graphql
yoonhyejin 5a6923c
fix tests
RyanHolstien 69da53a
Merge remote-tracking branch 'andrew-fork/versioning-graphql' into fe…
yoonhyejin 314b869
fix fragments.graphql
yoonhyejin 43e3d07
[wip] fix ui bugs
yoonhyejin e365b06
fix rendering issues
yoonhyejin 88db564
add run event in script
yoonhyejin b62ef19
update script and add islinegae:True back
yoonhyejin b5066c6
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin d4dc426
add mlModel to DPIinput relationships entityTypes
yoonhyejin 31dd659
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin 3c1c3b7
fix container dpi preview
yoonhyejin cdc23a8
spotlessapply
yoonhyejin 8a92827
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin 0209b7e
fix prefect test
yoonhyejin 2adba1d
fix linting
yoonhyejin fe1e9cd
fix linting
yoonhyejin 757b914
fix yarn lint
yoonhyejin c4999be
fix ruff check
yoonhyejin 7a3bdf5
[wip] fix linting
yoonhyejin f7336bc
fix linting
yoonhyejin a4c600c
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin da7aee9
update golden files for dbt & fivetran
yoonhyejin 534e3b4
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin 01f17c3
update golden files for airflow
yoonhyejin 24a9070
update golden files for dags
yoonhyejin 28359e3
fix airflow tests to include dataplatforminstance
yoonhyejin 43fe5e2
fix linitng
yoonhyejin 0501a2b
hacky fix for search filters test
shirshanka 398450c
fix searchfilters cypress test
shirshanka 8cdc27d
some golden file updates
shirshanka c52a462
Add argparser for token (#6)
ryota-cloud b198047
update goldens
shirshanka e48a7a6
fix preview entity
yoonhyejin 426d80c
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin 0d99464
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin 2f4aaea
remove commented out code
yoonhyejin 9f7f298
fix empty ml model message
yoonhyejin 946854c
remove console logs
yoonhyejin fa713df
pr feedback pair programming
asikowitz a1d48c2
revert metadata-ingestion/ & metadata-ingestion-modules/ files to head
yoonhyejin 8a42b7e
revert some of the changes manually
yoonhyejin a33ef73
revert some of the changes manually
yoonhyejin d4af718
update stylings
yoonhyejin 07adba4
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin e43ed52
Merge branch 'master' into feat/update-mlflow-ui
yoonhyejin a1c0125
revert search filters
asikowitz dfd66bf
fix properties.name mapping
yoonhyejin 2b9a418
fix yarnlint
yoonhyejin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
.../com/linkedin/datahub/graphql/types/mlmodel/mappers/MLModelGroupPropertiesMapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.linkedin.datahub.graphql.types.mlmodel.mappers; | ||
|
||
import static org.testng.Assert.assertEquals; | ||
import static org.testng.Assert.assertNotNull; | ||
import static org.testng.Assert.assertNull; | ||
|
||
import com.linkedin.common.urn.Urn; | ||
import com.linkedin.ml.metadata.MLModelGroupProperties; | ||
import java.net.URISyntaxException; | ||
import org.testng.annotations.Test; | ||
|
||
public class MLModelGroupPropertiesMapperTest { | ||
|
||
@Test | ||
public void testMapMLModelGroupProperties() throws URISyntaxException { | ||
// Create backend ML Model Group Properties | ||
MLModelGroupProperties input = new MLModelGroupProperties(); | ||
|
||
// Set description | ||
input.setDescription("a ml trust model group"); | ||
|
||
// Create URN | ||
Urn groupUrn = | ||
Urn.createFromString( | ||
"urn:li:mlModelGroup:(urn:li:dataPlatform:sagemaker,another-group,PROD)"); | ||
|
||
// Map the properties | ||
com.linkedin.datahub.graphql.generated.MLModelGroupProperties result = | ||
MLModelGroupPropertiesMapper.map(null, input, groupUrn); | ||
|
||
// Verify mapped properties | ||
assertNotNull(result); | ||
assertEquals(result.getDescription(), "a ml trust model group"); | ||
|
||
// Verify lineage info is null as in the mock data | ||
assertNotNull(result.getMlModelLineageInfo()); | ||
assertNull(result.getMlModelLineageInfo().getTrainingJobs()); | ||
assertNull(result.getMlModelLineageInfo().getDownstreamJobs()); | ||
} | ||
|
||
@Test | ||
public void testMapWithMinimalProperties() throws URISyntaxException { | ||
// Create backend ML Model Group Properties with minimal information | ||
MLModelGroupProperties input = new MLModelGroupProperties(); | ||
|
||
// Create URN | ||
Urn groupUrn = | ||
Urn.createFromString( | ||
"urn:li:mlModelGroup:(urn:li:dataPlatform:sagemaker,another-group,PROD)"); | ||
|
||
// Map the properties | ||
com.linkedin.datahub.graphql.generated.MLModelGroupProperties result = | ||
MLModelGroupPropertiesMapper.map(null, input, groupUrn); | ||
|
||
// Verify basic mapping with minimal properties | ||
assertNotNull(result); | ||
assertNull(result.getDescription()); | ||
|
||
// Verify lineage info is null | ||
assertNotNull(result.getMlModelLineageInfo()); | ||
assertNull(result.getMlModelLineageInfo().getTrainingJobs()); | ||
assertNull(result.getMlModelLineageInfo().getDownstreamJobs()); | ||
} | ||
} |
187 changes: 187 additions & 0 deletions
187
.../java/com/linkedin/datahub/graphql/types/mlmodel/mappers/MLModelPropertiesMapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
package com.linkedin.datahub.graphql.types.mlmodel.mappers; | ||
|
||
import static org.testng.Assert.assertEquals; | ||
import static org.testng.Assert.assertNotNull; | ||
import static org.testng.Assert.assertNull; | ||
|
||
import com.linkedin.common.MLFeatureUrnArray; | ||
import com.linkedin.common.TimeStamp; | ||
import com.linkedin.common.VersionTag; | ||
import com.linkedin.common.url.Url; | ||
import com.linkedin.common.urn.MLFeatureUrn; | ||
import com.linkedin.common.urn.MLModelUrn; | ||
import com.linkedin.common.urn.Urn; | ||
import com.linkedin.data.template.StringArray; | ||
import com.linkedin.data.template.StringMap; | ||
import com.linkedin.ml.metadata.MLHyperParam; | ||
import com.linkedin.ml.metadata.MLHyperParamArray; | ||
import com.linkedin.ml.metadata.MLMetric; | ||
import com.linkedin.ml.metadata.MLMetricArray; | ||
import com.linkedin.ml.metadata.MLModelProperties; | ||
import java.net.URISyntaxException; | ||
import org.testng.annotations.Test; | ||
|
||
public class MLModelPropertiesMapperTest { | ||
|
||
@Test | ||
public void testMapMLModelProperties() throws URISyntaxException { | ||
MLModelProperties input = new MLModelProperties(); | ||
|
||
// Set basic properties | ||
input.setName("TestModel"); | ||
input.setDescription("A test ML model"); | ||
input.setType("Classification"); | ||
|
||
// Set version | ||
VersionTag versionTag = new VersionTag(); | ||
versionTag.setVersionTag("1.0.0"); | ||
input.setVersion(versionTag); | ||
|
||
// Set external URL | ||
Url externalUrl = new Url("https://example.com/model"); | ||
input.setExternalUrl(externalUrl); | ||
|
||
// Set created and last modified timestamps | ||
TimeStamp createdTimeStamp = new TimeStamp(); | ||
createdTimeStamp.setTime(1000L); | ||
Urn userUrn = Urn.createFromString("urn:li:corpuser:test"); | ||
createdTimeStamp.setActor(userUrn); | ||
input.setCreated(createdTimeStamp); | ||
|
||
TimeStamp lastModifiedTimeStamp = new TimeStamp(); | ||
lastModifiedTimeStamp.setTime(2000L); | ||
lastModifiedTimeStamp.setActor(userUrn); | ||
input.setLastModified(lastModifiedTimeStamp); | ||
|
||
// Set custom properties | ||
StringMap customProps = new StringMap(); | ||
customProps.put("key1", "value1"); | ||
customProps.put("key2", "value2"); | ||
input.setCustomProperties(customProps); | ||
|
||
// Set hyper parameters | ||
MLHyperParamArray hyperParams = new MLHyperParamArray(); | ||
MLHyperParam hyperParam1 = new MLHyperParam(); | ||
hyperParam1.setName("learning_rate"); | ||
hyperParam1.setValue("0.01"); | ||
hyperParams.add(hyperParam1); | ||
input.setHyperParams(hyperParams); | ||
|
||
// Set training metrics | ||
MLMetricArray trainingMetrics = new MLMetricArray(); | ||
MLMetric metric1 = new MLMetric(); | ||
metric1.setName("accuracy"); | ||
metric1.setValue("0.95"); | ||
trainingMetrics.add(metric1); | ||
input.setTrainingMetrics(trainingMetrics); | ||
|
||
// Set ML features | ||
MLFeatureUrnArray mlFeatures = new MLFeatureUrnArray(); | ||
MLFeatureUrn featureUrn = MLFeatureUrn.createFromString("urn:li:mlFeature:(dataset,feature)"); | ||
mlFeatures.add(featureUrn); | ||
input.setMlFeatures(mlFeatures); | ||
|
||
// Set tags | ||
StringArray tags = new StringArray(); | ||
tags.add("tag1"); | ||
tags.add("tag2"); | ||
input.setTags(tags); | ||
|
||
// Set training and downstream jobs | ||
input.setTrainingJobs( | ||
new com.linkedin.common.UrnArray(Urn.createFromString("urn:li:dataJob:train"))); | ||
input.setDownstreamJobs( | ||
new com.linkedin.common.UrnArray(Urn.createFromString("urn:li:dataJob:predict"))); | ||
|
||
// Create ML Model URN | ||
MLModelUrn modelUrn = | ||
MLModelUrn.createFromString( | ||
"urn:li:mlModel:(urn:li:dataPlatform:sagemaker,unittestmodel,PROD)"); | ||
|
||
// Map the properties | ||
com.linkedin.datahub.graphql.generated.MLModelProperties result = | ||
MLModelPropertiesMapper.map(null, input, modelUrn); | ||
|
||
// Verify mapped properties | ||
assertNotNull(result); | ||
assertEquals(result.getName(), "TestModel"); | ||
assertEquals(result.getDescription(), "A test ML model"); | ||
assertEquals(result.getType(), "Classification"); | ||
assertEquals(result.getVersion(), "1.0.0"); | ||
assertEquals(result.getExternalUrl(), "https://example.com/model"); | ||
|
||
// Verify audit stamps | ||
assertNotNull(result.getCreated()); | ||
assertEquals(result.getCreated().getTime().longValue(), 1000L); | ||
assertEquals(result.getCreated().getActor(), userUrn.toString()); | ||
|
||
assertNotNull(result.getLastModified()); | ||
assertEquals(result.getLastModified().getTime().longValue(), 2000L); | ||
assertEquals(result.getLastModified().getActor(), userUrn.toString()); | ||
|
||
// Verify custom properties | ||
assertNotNull(result.getCustomProperties()); | ||
|
||
// Verify hyper parameters | ||
assertNotNull(result.getHyperParams()); | ||
assertEquals(result.getHyperParams().size(), 1); | ||
assertEquals(result.getHyperParams().get(0).getName(), "learning_rate"); | ||
assertEquals(result.getHyperParams().get(0).getValue(), "0.01"); | ||
|
||
// Verify training metrics | ||
assertNotNull(result.getTrainingMetrics()); | ||
assertEquals(result.getTrainingMetrics().size(), 1); | ||
assertEquals(result.getTrainingMetrics().get(0).getName(), "accuracy"); | ||
assertEquals(result.getTrainingMetrics().get(0).getValue(), "0.95"); | ||
|
||
// Verify ML features | ||
assertNotNull(result.getMlFeatures()); | ||
assertEquals(result.getMlFeatures().size(), 1); | ||
assertEquals(result.getMlFeatures().get(0), featureUrn.toString()); | ||
|
||
// Verify tags | ||
assertNotNull(result.getTags()); | ||
assertEquals(result.getTags().get(0), "tag1"); | ||
assertEquals(result.getTags().get(1), "tag2"); | ||
|
||
// Verify lineage info | ||
assertNotNull(result.getMlModelLineageInfo()); | ||
assertEquals(result.getMlModelLineageInfo().getTrainingJobs().size(), 1); | ||
assertEquals(result.getMlModelLineageInfo().getTrainingJobs().get(0), "urn:li:dataJob:train"); | ||
assertEquals(result.getMlModelLineageInfo().getDownstreamJobs().size(), 1); | ||
assertEquals( | ||
result.getMlModelLineageInfo().getDownstreamJobs().get(0), "urn:li:dataJob:predict"); | ||
} | ||
|
||
@Test | ||
public void testMapWithMissingName() throws URISyntaxException { | ||
MLModelProperties input = new MLModelProperties(); | ||
MLModelUrn modelUrn = | ||
MLModelUrn.createFromString( | ||
"urn:li:mlModel:(urn:li:dataPlatform:sagemaker,missingnamemodel,PROD)"); | ||
|
||
com.linkedin.datahub.graphql.generated.MLModelProperties result = | ||
MLModelPropertiesMapper.map(null, input, modelUrn); | ||
|
||
// Verify that name is extracted from URN when not present in input | ||
assertEquals(result.getName(), "missingnamemodel"); | ||
} | ||
|
||
@Test | ||
public void testMapWithMinimalProperties() throws URISyntaxException { | ||
MLModelProperties input = new MLModelProperties(); | ||
MLModelUrn modelUrn = | ||
MLModelUrn.createFromString( | ||
"urn:li:mlModel:(urn:li:dataPlatform:sagemaker,minimalmodel,PROD)"); | ||
|
||
com.linkedin.datahub.graphql.generated.MLModelProperties result = | ||
MLModelPropertiesMapper.map(null, input, modelUrn); | ||
|
||
// Verify basic mapping with minimal properties | ||
assertNotNull(result); | ||
assertEquals(result.getName(), "minimalmodel"); | ||
assertNull(result.getDescription()); | ||
assertNull(result.getType()); | ||
assertNull(result.getVersion()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can revert