Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading zolca file in olca-ipc #25

Closed
zond opened this issue Aug 9, 2021 · 4 comments
Closed

Loading zolca file in olca-ipc #25

zond opened this issue Aug 9, 2021 · 4 comments

Comments

@zond
Copy link

zond commented Aug 9, 2021

Hello,

I'm interested in loading an existing zolca file into the server when running olca-ipc as an IPC server, specifically https://simapro.com/products/agribalyse-agricultural-database/.

How do I do that? I looked around in the RPC handlers, and found nothing that corresponded to the 'restore database' menu option in the app.

I tried to just unzip the zolca file in a directory, and use that directory as -db option. The server started, but I'm not yet sure if this will lead to the expected results..

@spietzn
Copy link

spietzn commented Aug 11, 2021

I tried setting up something similar over the past few days.
For me your described process worked, I just had to make sure to build the correct version of openLCA.
My database was created using the 1.10 release, so I had to build a v1.10 IPC Server.
Here is a Dockerfile that works for me:

FROM maven:3.8-openjdk-8
RUN apt-get install git;
RUN mkdir /db
RUN git clone https://github.com/GreenDelta/olca-modules.git
WORKDIR /olca-modules/
RUN git checkout v1.10
RUN sed -i 's/.*olca-geo.*//' pom.xml
RUN mvn clean install -DskipTests
WORKDIR /olca-modules/olca-ipc
CMD mvn -P server-app exec:java -Dexec.mainClass=org.openlca.ipc.Main -Dexec.args="-db /db"

Running the image with docker run -v path/to/db:/db --name openlca-server --rm -it <image-name> should hopefully work for you too.

@zond
Copy link
Author

zond commented Aug 16, 2021

Ah, nice, that worked!

Some follow up questions:

  • In the desktop app, I can load this same zolca-file even using version 1.4. Is there a way to do that using the headless server? I'm assuming not since it seems the headless server just assigns a database, it doesn't seem to load it per se?
  • If not, is there a way to update the database, for example using the desktop app (which I would assume uses some compatibility layer to load old version databases into a new version data structure)?

@spietzn
Copy link

spietzn commented Aug 16, 2021

Have you tried importing and exporting the database using the desktop app? I would assume that the exported .zolca file can be used with the headless server.
Regarding direct imports, the only thing I found was the -db argument, so I do not think anything else can be done here - I am certainly no expert on the software though.

@zond
Copy link
Author

zond commented Aug 16, 2021

Oh, I realized I am of course not using 1.4 on the desktop, since I'm using the latest release!

But thank you for the advice - I'll try that if I want to run the headless version in a different version than the desktop version :)

@zond zond closed this as completed Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants