Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/greendelta/olca-ipc-container
https://github.com/greendelta/olca-ipc-container
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/greendelta/olca-ipc-container
- Owner: GreenDelta
- License: mpl-2.0
- Created: 2023-07-20T13:01:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-25T11:20:37.000Z (over 1 year ago)
- Last Synced: 2024-06-11T16:19:42.532Z (7 months ago)
- Language: Dart
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# olca-ipc-container
This repository contains an example for packaging an openLCA v2 IPC server in a Docker container. This is done in a multi-stage build where the final image only contains the necessary resources to run the server. To build the image, just run:
```bash
cd olca-ipc-container
docker build -t olca-ipc-server .
```This will package the IPC server and native calculation libraries in an image tagged as `olca-ipc-server`. The following example will start a container from that image:
```bash
docker run \
-p 3000:8080 \
-v $HOME/openLCA-data-1.4:/app/data \
--rm -d olca-ipc-server \
-db example --readonly
```This will start the server in the container at port `8080` using `/app/data` as data folder. The data folder is mapped to the default openLCA workspace in the example and the port to `3000` of the host. More options can be passed in to the container after the image name (`olca-ipc-server`). In the example, the database is set to `example` (so `~/openLCA-data-1.4/databases/example` would be the full path of the database) and the server is run in `readonly` mode.
The server implements the JSON-RPC protocol of the openLCA API (see https://greendelta.github.io/openLCA-ApiDoc/ipc/). Here is an example `curl` command to list the product systems via the API:
```bash
curl -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "data/get/descriptors",
"params": { "@type": "ProductSystem" }}'\
-H "Content-Type: application/json"\
-X POST http://localhost:3000
```