I was following <https://github.com/linkedin/datah...
# all-things-deployment
a
I was following https://github.com/linkedin/datahub/blob/master/metadata-models-custom/README.md - when I run ../gradlew install like the readme states, it appears to build and install locally. I'd like the newly created aspect pushed to my gms running in k8s. I checked and my datahub cli is configured to point to the remote server, so I'm not sure why the install doesn't push the artifact to the server. /config endpoint shows only noCode true. Am I understanding this example properly, shouldn't it add new aspects at runtime for existing entities?
m
@agreeable-plastic-37919: the gradle task does not push to a remote server.
you need to take the artifact produced and "get it" to your server ... e.g. using a mounted volume in your k8s
We'll update the documentation to make this clearer!
a
Ok thanks, I'll have to figure out how/where to add the files via the helm charts
is there an alternative method for adding aspects at runtime via an API?
or all methods require placing the PDL onto the GMS server
m
Right now, that's the only way. We don't support an API to POST the zip over yet.
@early-lamp-41924 might be able to give you some advice for how to set up a dynamic mount like this
a
ok sounds good. I would appreciate any help on the mount, not sure what path the container needs the zip located at or how to do it..
e
Hey! awesome
so first of all, by default it reads models from /etc/datahub/plugins/models https://github.com/linkedin/datahub/blob/master/metadata-service/factories/src/main/resources/application.yml#L44 but you can update this behavior with an env variable
that being said we need to mount a local jar file into the k8s pod. and that is done through volumes and volume mounts
First you need to push the jar into a configmap refer to this command
Copy code
kubectl create configmap custom-model --from-file=<<path-to-jar-file>> -n <<namespace>>
Then you need to set the volumes for the gms deployment (refer to how jmx exporter configmap is added here https://github.com/acryldata/datahub-helm/blob/master/charts/datahub/subcharts/datahub-gms/templates/deployment.yaml#L40) This just tells the gms deploy in advance that we will be pulling this configmap in. You can do this by setting the datahub-gms.extraVolumes which gets appended to the deployment without having to change the helm chart.
Finally you need to mount the volume into the container’s local directory by setting volumeMounts. Refer to how the kafka certs are mounted onto a local path here https://github.com/acryldata/datahub-helm/blob/master/charts/datahub/subcharts/datahub-gms/templates/deployment.yaml#L182 You can do this by setting the datahub-gms.extraVolumeMounts
at the end your values.yaml should have something like:
Copy code
datahub-gms:
  ...
  extraVolumes:
    - name: custom-model
      configMap:
        name: custom-model ## should match configmap name above
  extraVolumeMounts:
    - name: custom-model-dir
      mountPath: /etc/datahub/plugins/models
Let us know how this goes
a
@early-lamp-41924 - thanks I was able to mount a local jar into the pod as you described. I'm still not seeing the new model in the /config endpoint
I uploaded the jar from build/libs
metadata-models-custom-data-template-0.0.8.jar
Archive: metadata-models-custom-data-template-0.0.8.jar Length Date Time Name --------- ---------- ----- ---- 0 2022-01-28 15:45 META-INF/ 25 2022-01-28 15:45 META-INF/MANIFEST.MF 0 2022-01-28 15:45 com/ 0 2022-01-28 15:45 com/factset/ 0 2022-01-28 15:45 com/factset/bmd/ 1496 2022-01-28 15:45 com/factset/bmd/BusinessMetadata$Fields.class 8207 2022-01-28 15:45 com/factset/bmd/BusinessMetadata.class 0 2022-01-28 15:45 pegasus/ 0 2022-01-28 15:45 pegasus/com/ 0 2022-01-28 15:45 pegasus/com/factset/ 0 2022-01-28 15:45 pegasus/com/factset/bmd/ 312 2022-01-28 15:45 pegasus/com/factset/bmd/BusinessMetadata.pdl 0 2022-01-28 15:45 legacyPegasusSchemas/ 0 2022-01-28 15:45 legacyPegasusSchemas/com/ 0 2022-01-28 15:45 legacyPegasusSchemas/com/factset/ 0 2022-01-28 15:45 legacyPegasusSchemas/com/factset/bmd/ 607 2022-01-28 15:45 legacyPegasusSchemas/com/factset/bmd/BusinessMetadata.pdsc --------- ------- 10647 17 files
then on the pod: /etc/datahub/plugins/models $ ls metadata-models-custom-data-template-0.0.8.jar
Do I need to mount the zip file and then add a command to extract at container startup?
e
@mammoth-bear-12532 do we also need to mount the entity-registry.yml for this to work?
m
@agreeable-plastic-37919 the structure of the folder under
/etc/plugins/models
is
Copy code
registry-name/<version>/
                        entity-registry.yaml
                        libs/
                             <model-jar-name>.jar
if you run the gradle task
modelArtifact
in the custom-metadata-model module
Copy code
../gradlew modelArtifact
you will find a zip file generated under
build/dist
something like
metadata-models-custom-0.0.1.zip
e.g.
Copy code
../gradlew modelArtifact -PprojVersion=0.0.2
will generate a zip file with the
0.0.2
version
this zip file contains everything you need
you just need to drop it (unzipped) under the
/etc/plugins/models/<registry-name>/<registry-version>
directory
a
ok i think possibly I need to upgrade too, im currently running linkedin/datahub-gms:v0.8.17 - was this support added after that version?
just upgraded
ok it works now 🙂
thank you
e
awesome!!!!!!
a
My next bug is that UI isn't auto rendering the aspect
should the UI also update after a deployment of an artifact
namespace com.factset.bmd @Aspect = { "name": "businessMetadata", "autoRender": true, "renderSpec": { "displayType": "properties", "displayName": "Business Metadata" } } record BusinessMetadata { ... }
So I can deploy the model
then use the sample script to add a record
datahub put --urn "urnliglossaryTerm:(Test.test)" --aspect businessMetadata --aspect-data data/bmd.json
but when i navigate to the glossary term Test.test, I don't see anything in the UI for the businessAspect I created
m
ah glossary terms -> don't support the auto-render of custom aspects yet
it should be available soon as Glossary terms are getting moved over to the new UI rendering today
a
is there a list somewhere of what is supported?
for use with auto rendering
also, when they are moved over to the the UI rendering, will that enable it, or maybe more work after?
m
I believe it will just work when they are moved over to the new UI rendering, but I'll get back to you after confirming with some of the frontend experts.
We should also document which entities will work with auto-render aspects, will do that soon.
a
ok awesome 🙂
d
hey @early-lamp-41924, im trying deploy this same on my kube pod and im able to see the contents of my gradel build inside /etc/plugins/models/ but no models are seen when i hit /config endpoint if i copy it to etc/datahub/plugins/models/ it shows up with some failures. Could you please help?