bilayer-containers / bilayers

https://bilayers.org
3 stars 1 forks source link

Folder Structure Setup and Tool Specific Python Scripts #7

Closed rajavishah closed 4 months ago

rajavishah commented 5 months ago

Discussed in https://github.com/orgs/bilayer-containers/discussions/5

Originally posted by **gnodar01** June 11, 2024 Our goal for bilayer is to work up to whats shown in the following figure: ![COBA_R24_proposal](https://github.com/bilayer-containers/bilayers/assets/8888732/d224e5a7-3a50-4c0a-921d-a553dce472d3) We'll take it one step at a time though. For version `0.1`, @rajavishah and I discussed concentrating on an MVP. The idea is to build off the docker gradio demo that Callum built. We [have a branch with some rough notes](https://github.com/COBA-NIH/docker_gradio_demo/tree/biapy_notes) in that repo. For `v0.1`, we will start by only creating enough to programmatically generate a replica of the threshold gradio app. We'll add other interfaces afterwards. The MVP will have the following starting elements: * a super simple (for now) config/spec file (maybe in json, or yaml, or toml, or ...) definition * a docker file which installs all the gradio dependencies We'll then need components that are specific to the algorithm, in this case simple threshold: * populated config/spec file * input & output UI types (for now just `filepath`, `choice` / `radio` and `number` is needed; we will expand UI types later) * A second dockerfile which `FROM`s the base gradio docker file, and then installs the necessary dependencies (`scikit-image` and `scipy` in this case) * a python file providing the "execute" function (i.e. the [example function](https://github.com/COBA-NIH/docker_gradio_demo/blob/biapy_notes/app.py#L22)) Finally we'll need a build process. Initially the plan is to simply have a python script which parses the config/spec file and: * programmatically generates the Gradio interface * corresponding to [these lines](https://github.com/COBA-NIH/docker_gradio_demo/blob/biapy_notes/app.py#L9-L20), followed by the `execute` function from above, and then [these lines](https://github.com/COBA-NIH/docker_gradio_demo/blob/biapy_notes/app.py#L75-L83) * a third dockerfile which `FROM`s the previous one above, and copies in the programmatically generated file above, and sets its execution as the `ENTRYPOINT` We will also need to come up with a folder structure that organizes all this