girder / girder_worker

Distributed task execution engine with Girder integration, developed by Kitware
http://girder-worker.readthedocs.io/
Apache License 2.0
34 stars 30 forks source link

How can I pass env variables from within DSA to a image that is being added through slicer web task #387

Open lomshabhishek opened 10 months ago

lomshabhishek commented 10 months ago

I want to pass secret env variables when a new docker image is pulled and as well as eventually when it is used to create container to serve user request.

@manthey 's response https://github.com/DigitalSlideArchive/digital_slide_archive/discussions/300


We have the ability to use environment variables to set parameters in a job that is being run, but it wouldn't be used for secrets (see near the end of the README here: https://github.com/girder/slicer_cli_web). You can also add environment parameters in part of the docker-params markup that a cli has; but that also wouldn't be appropriate for secrets.

There currently isn't a way to do this for secrets -- we'd have to make a change to girder_worker to pass specific environment variable. We could make it so that all environment variables that start with some prefix would be passed without that prefix into all running containers (or maybe it needs to be more constrained than that). Then, you would set environment variables in the main girder or girder worker processes(via docker-compose a environment key, for instance).

We should make an issue in the girder-worker repo and further discuss what would make sense.