PrincetonPoh

PrincetonPoh

Running python script in phoenix project on fly.io

Hi everyone! I’m building a lightweight phoenix webapp that spits out results from a python script that my friend built. That script runs with tensorflow.

My question is do I host (on fly.io) the elixir service and python service separately? I mean to create a python flask app and put the tensorflow prediction scripts on it to expose it as an API. Then separately create a phoenix elixir app. 2 fly.io compute instance in total.

I understand that for local development, I can simply have both projects in one repository and simply use Erlport to link between them. However, i’m not sure what is the best practise for doing this on production (fly.io). Please let me know your thoughts.

Most Liked

greven

greven

There isn’t a best practice I guess, any of the solutions you listed have their pros and cons. I would also add gRPC to the list.

I explored a REST API, Ports, but ended up with gRPC, I feel it’s the “cleaner” solution to integrate external services I control in terms of interoperability and resilience.

Last Post!

PrincetonPoh

PrincetonPoh

Ah, I would if I was the one working on that part of the project but sadly my friend is only familiar with doing it on python. Thank you for the suggestion. The bumblebee project is cool! I’ve tried out that little livebook example.

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement