GreenDelta/olca-ipc.py

Opening IPC Server from Python

Opened this issue · 3 comments

Is there a way to start the IPC Server in OpenLCA without using the GUI but from a python console?

Thanks so much!

@msrocka any update on this topic ?

The IPC server package has a Main class so yes you can start it without the GUI. Also, openLCA comes with an embedded Java runtime so you could run the following script in the openLCA installation folder in Windows to start the IPC server:

rem the path to the database
set db=C:\Users\ms\openLCA-data-1.4\databases\ecoinvent_2_2_unit

rem the Java executable
set java_exec=.\jre\bin\java.exe

rem the installation folders with the openLCA modules
set cp=.\plugins\olca-app_1.10.2\libs\*

%java_exec% -cp %cp% org.openlca.ipc.Main -port 8080 -db %db%

(for Linux and macOS it would be equivalent). You can execute these commands of course also from Python using the process API. However, it is currently not possible to load the native calculation libraries via this startup command, so calculation would be slow... but the rest should work.

Are they any new updates on this to use the calculations?
I would like to run all of this on a linux server with out a GUI.