ome / omero-ms-zarr

Experimental micro-service for implementing the Zarr spec over HTTP
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
17 stars 12 forks source link

Optionally add CONFIG_ env-vars to properties #33

Closed manics closed 4 years ago

manics commented 4 years ago

This should allow the Docker image to be run using the same configuration format as the omero-web and omero-server containers.

For example, https://github.com/ome/docker-example-omero with these changes:

diff --git a/docker-compose.yml b/docker-compose.yml
index 60fd75c..efc64d5 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -29,6 +29,21 @@ services:
     volumes:
       - "omero:/OMERO"

+  omerozarr:
+    image: omero-ms-zarr
+    environment:
+      CONFIG_omero_db_host: database
+      CONFIG_omero_db_user: omero
+      CONFIG_omero_db_pass: omero
+      CONFIG_omero_db_name: omero
+      CONFIG_omero_ms_zarr_net_path_image: /idr/zarr/v0.1/{image}.zarr/
+    networks:
+      - omero
+    ports:
+      - "8080:8080"
+    volumes:
+      - "omero:/OMERO"
+
   omeroweb:
     image: "openmicroscopy/omero-web-standalone:5.6"
     environment:

Import an image, then check:

$ curl http://localhost:8080/idr/zarr/v0.1/1.zarr/.zattrs
{"multiscales":[{"datasets":[{"path":"0","scale":1.0}],"version":"0.1"}]}
mtbc commented 4 years ago

Huh, that's interesting, OMERO.blitz already has code that makes it able to accept configuration from the environment like that?

manics commented 4 years ago

No, this is done in the Docker containers by a Python script. I didn't want to install Python just for processing env-vars and trying to do it in bash sounds painful (though should be possible): https://github.com/ome/omero-server-docker/blob/master/50-config.py