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
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
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
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42576 114
New

We're in Beta

About us Mission Statement