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

Proposal: python package with docker container wrapper #119

Open
keller-mark opened this issue Apr 13, 2023 · 2 comments
Open

Proposal: python package with docker container wrapper #119

keller-mark opened this issue Apr 13, 2023 · 2 comments

Comments

@keller-mark
Copy link
Member

keller-mark commented Apr 13, 2023

Idea

For future workflows consisting of exclusively python code:

Rather than needing to define a docker container per-workflow, there could be a single “dummy” docker container that installs a python package that is developed independently (eg pip install portal-containers). This package could expose a CLI that is parameterized by a workflow name (eg anndata-to-ui), and the input/output directory paths. Based on the workflow name, this CLI would call a different data processing function defined in the package.

A python package for data processing developed/tested independently would substantially lower the barrier to developing/improving these workflows.

Docker would still be wrapping this package before it is used in the ingest-pipeline, but there would only need to be one dockerfile and one docker image per version of the python package.

The existing workflows could be incrementally migrated into such a package and of course the standalone dockerfile option could continue to be used in cases of dependency conflicts or non-python processing code.

@keller-mark
Copy link
Member Author

keller-mark commented Apr 14, 2023

We should be able to pass the parameter in the CWL files (for example in the baseCommand)

baseCommand: ['python', '/main.py', '--output_dir', './anndata-zarr', '--input_dir']

i.e., for anndata-to-ui, the above would become:

baseCommand: ['portal-containers-cli', 'anndata-to-ui', '--output_dir', './anndata-zarr', '--input_dir']

whereas for for sprm-to-anndata:

baseCommand: ['portal-containers-cli', 'sprm-to-anndata', '--output_dir', './anndata-zarr', '--input_dir']

Here, portal-containers-cli anndata-to-ui and portal-containers-cli sprm-to-anndata could each correspond to an independent sub-parser (e.g., implemented with argparse). The portal-containers python package itself could be created with Hatch.

@keller-mark
Copy link
Member Author

cc @mruffalo do you forsee any issues with this proposal?

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

1 participant