I found a python package that I want to use within my angular based firebase project (it does some complex analysation of a text file). What is the best way to use it? I see the following options:
- Own docker container with flask, running in Cloud run (e.g. like that) - pass file in AJAX request, return JSON result.
- Downsides: own endpoint that has to be noted down somewhere in main project, own repository: not in the other Node.js cloud functions
- Call python script in Node.js cloud function (like this)
- a little bit hacky piping file and log outputs as strings, probably not easy to get all the python dependencies working (would this work at all?)
- Totally independent microservice just taking the file, analysing it and sending back JSON. Maybe as AWS lambda?
- again "cut out" of the main project
I'd love to have a "clean and easy" integration in my existing Node.js cloud functions that I use in firebase. The firebase CLI can then take over all the URL endpoint handling etc. But I don't see a way to do this.
A kind of better capsulated approach would be to go with 1. or 3. and have a Node.js cloud function calling the endpoint. With that I would also not have the client code call the endpoint and have better possibilites in configuring it without having to update the client code.
Am I missing an approach? What would be the best way to do this?
Use Case: User uploads file, the file and some other values are saved to his account. The content of the file should be analysed (can be done asynchronously) and the results should be available for the user to be shown.