Best Way to Add Python Processes for AI support

Hi there!
I’m creating an AI-enabled app and building a number of different python jobs and scripts for data analysis.

I’m trying to figure out the best way to set up my python processes and I’m not a docker expert.

Here’s my goal:

  • I want Wappler/Database/AI stuff to be deployed to the same server
  • I have 2 flavors of Python AI services - on demand REST APIs and scheduled jobs using pythons APScheduler engine
  • I want my AI services to be able to read/update the Wappler database via an API Key and Secret (I have another post on how I set this up here.)

Here’s my thoughts on how:

  • Update the Wappler Docker file to add a python container
  • Create a dockerfile that uses the wappler root username/pw to create my API user key and password to Wappler and an API key user key/pw for Wappler to use for my services
  • Expose REST APIs in Python for Wappler to use
  • Expose REST APIs in Wappler for Python to use

Are there better ways to do this?
Thanks!

I’ve done something similar, just without docker. Just a simply python/flask app to expose endpoints and then api action from Wappler. But I also setup background talks with celery for longer running processes to keep things snappy. Works fine.

3 Likes

We are playing with the idea to make a whole new services manager, where you can install all kind of docker based services on your server and link them to your project.

Currently we have the docker machine manager that manages your global services like traefik, portainer and maybe others on your server, but it might be better to give it a more prominent place as a panel on the left side called “services manager” and manage it all from there.

6 Likes

Thanks!!!

Hey @George - Where does that live? I’m not seeing it in the project settings?

1 Like

I would like to ask a beginner’s question regarding frontend integration with python backend.

What will be the normal procedure or approach to this? I presume the approach mentioned by crystaltaggart can be summarized as this:

  1. Create and load docker image containing a Python server, presumably a Flask server with REST API? Alternately, how would you make this?

  2. Connect frontend designed in Wappler (assuming also loaded as a docker image?) using API connect to Python REST API? --> I am assuming this allows two way communication i.e Action API?

  3. Assumption is that the docker images containing both Python REST API and Frontend can talk to each other can be deployed together to the cloud as a single project (i.e. it just works)?

I saw another post by George mentioning about the adoption of Terraform in place of the discontinued Docker machine development. How will this affect the ease and feasibility of integration Python backend with Wappler? Or alternately (and preferably), are there any plans to integrate Python as one of the backend frameworks? I saw another feature request here but not sure is that even a possible or feasible request?

Thank you so much for your replies (anyone). The closest Pythonic visual web app framework that I’ve come across is Anvil. However, the frontend is simplistic and the Holy Grail for me personally is still something like Wappler + Python.

2 Likes