forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(metadata-service): support for custom model extensions without f…
…orks (datahub-project#3630)
- Loading branch information
1 parent
7f7eb83
commit 842c059
Showing
73 changed files
with
2,082 additions
and
312 deletions.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import org.yaml.snakeyaml.Yaml | ||
|
||
buildscript { | ||
repositories{ | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath("org.yaml:snakeyaml:1.17") | ||
} | ||
} | ||
|
||
plugins { | ||
id 'base' | ||
} | ||
apply plugin: 'pegasus' | ||
|
||
|
||
if (project.hasProperty('projVersion')) { | ||
project.version = project.projVersion | ||
} else { | ||
project.version = '0.0.0-dev' | ||
} | ||
|
||
|
||
dependencies { | ||
compile spec.product.pegasus.data | ||
// Uncomment these if you want to depend on models defined in core datahub | ||
//compile project(':li-utils') | ||
//dataModel project(':li-utils') | ||
//compile project(':metadata-models') | ||
//dataModel project(':metadata-models') | ||
|
||
} | ||
//def deployBaseDir = findProperty('pluginModelsDir') ?: file(project.gradle.gradleUserHomeDir.parent + "/.datahub/plugins/models") | ||
def deployBaseDir = file(layout.buildDirectory.dir("plugins/models")) | ||
|
||
mainAvroSchemaJar.dependsOn generateAvroSchema | ||
|
||
pegasus.main.generationModes = [PegasusGenerationMode.PEGASUS, PegasusGenerationMode.AVRO] | ||
|
||
|
||
task modelArtifact(type: Zip) { | ||
|
||
from(layout.buildDirectory.dir("libs")) { | ||
include "*-data-template-*.jar" | ||
exclude "*-test-data-template-*.jar" | ||
into "libs" | ||
} | ||
from(layout.projectDirectory.dir("registry")) { | ||
include "*.yml", "*.yaml" | ||
} | ||
|
||
destinationDirectory = layout.buildDirectory.dir("dist") | ||
} | ||
|
||
modelArtifact.dependsOn build | ||
task modelDeploy(type: Copy) { | ||
def registryDir = layout.projectDirectory.dir("registry") | ||
def cfg = new Yaml().load(new File("$registryDir/entity-registry.yaml").newInputStream()) | ||
def outputBaseName = cfg.id ? cfg.id : project.name | ||
def zipFile = file("build/dist/${project.name}-${version}.zip") | ||
logger.info("Zip file is $zipFile") | ||
def outputDir = "$deployBaseDir/${outputBaseName}/$version" | ||
from zipTree(zipFile) | ||
into outputDir | ||
} | ||
|
||
modelDeploy.dependsOn modelArtifact | ||
|
||
configurations { | ||
builtModels { | ||
canBeConsumed = true | ||
canBeResolved = false | ||
} | ||
} | ||
|
||
//artifacts { | ||
// builtModels(modelArtifact) | ||
//} | ||
|
||
|
6 changes: 6 additions & 0 deletions
6
entity-registry/custom-test-model/registry/entity-registry.yaml
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,6 @@ | ||
--- | ||
id: mycompany-dq-model | ||
entities: | ||
- name: dataset | ||
aspects: | ||
- testDataQualityRules |
10 changes: 10 additions & 0 deletions
10
entity-registry/custom-test-model/src/main/pegasus/com/mycompany/dq/DataQualityRule.pdl
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,10 @@ | ||
namespace com.mycompany.dq | ||
|
||
record DataQualityRule { | ||
field: optional string | ||
isFieldLevel: boolean | ||
type: string | ||
checkDefinition: optional string | ||
url: optional string | ||
isDatasetLevel: boolean | ||
} |
Oops, something went wrong.