combust / mleap

MLeap: Deploy ML Pipelines to Production
https://combust.github.io/mleap-docs/
Apache License 2.0
1.5k stars 312 forks source link

How to add custom transformer to mleap-serving docker #612

Open ketanio opened 4 years ago

ketanio commented 4 years ago

Need some clarity,

This is what I did:

After this I tried to load bundle in the spring-boot docker container and realized that the mleap-spring-boot app does not have my custom transformer class in its runtime.

Questions:

I poked around the mleap codebase and docker container and found /opt/docker/lib directory where all the jars are stored. Should I copy my custom transformer jar to this directory when I build my custom docker image (built from the mleap base docker image)?

femibyte commented 4 years ago

Yes, that's what I'm doing (though I have other unrelated errors) The line in my Dockerfile is 👍

COPY mycustomtransformer.jar /opt/docker/lib

ketanio commented 4 years ago

@femibyte I was looking the startup script in /opt/docker/bin it seemed like the classpaths were hardcoded. Does it pick the custom jars?

femibyte commented 4 years ago

Yeah, the way I got around that was by taking the existing mleap-spring-boot file, modifying it to use the jars I want and renaming it to mleap-spring-boot-custom. Then in my Dockerfile, I have

COPY mleap-spring-boot-custom /opt/docker/bin
ENTRYPOINT ["bin/mleap-spring-boot-custom"]
CMD []
anand3loq commented 4 years ago

I am following mleap docs to serve inside a docker container, but i am finding it difficult to pass the leapFrame . When i apply transform it throws error of jsonParser. Can you help me which docker image tag is running smooothly? Or any suggestion for a beginner

anand3loq commented 4 years ago

while executing transform on airbnb example i get ( currently using 0.14-snapshot) {"timestamp":"2020-06-16T17:09:36.973+0000","status":500,"error":"Internal Server Error","message":"Illegal character '.' (code 0x2e) in base64 content","path":"/models/transform"}

i have passed format as ml.combust.mleap.json and LEAP_FRAME as frame.airbnb.json file provided in the doc. additionaly i have two more question

  1. when i start container with 0.17.0 snapshot i recieve connection reset by peer ERROR
  2. How do i create or store a leap frame, in the document how do i store bytes for json https://mleap-docs.combust.ml/mleap-runtime/storing.html#custom, even if i store its not working in airbnb case as mentioned above. P.S. I can read meta data of the model airbnb.lr.zip