LinguaCafe icon indicating copy to clipboard operation
LinguaCafe copied to clipboard

PhpServer and PythonService decoupling.

Open ilexei opened this issue 1 year ago • 1 comments

Right now main PhpService and PythonService are connected to the same machine, basically, due to several things.

  1. Python Service port. It is hardcoded as :8678 in PHP. I would propose make it an env variable for PHP and Python (tested it already - it is working).
  2. There is am implicit connection via filesystem. I discovered that subtitle files are stored by PHP and Python Service is reading them directly from the same disk. It is not working without file shares, when services are deployed to different servers. Workaround is to add file share (which is quite expensive) or send the file itself through the API, so that python could save it itself and then parse. It could be a breaking change, if anyone is using containers on different servers - they will have to redeploy both containers.
  3. Unfortunately, I don't know if any other APIs use the same filesystem for other operations. If you could help me finding it, I could propose a fix.

ilexei avatar Jan 03 '25 14:01 ilexei

Hi!

Sorry for the late response.

  1. Great suggestion, thank you! 2., 3. Sorry, I'm not sure I understand this. However, the file sharing between the 2 containers is something that I don't really like either, and I would like to find a different way in the future if possible, like sending the file inside HTTP request. Not sure if it's possible now, I cannot recall all the functions that use file sharings.

simjanos-dev avatar Mar 09 '25 14:03 simjanos-dev