mlcube
mlcube copied to clipboard
Custom entry points.
Currently, MLCube docker and singularity runners require that docker and singularity images define entry points that serve as dispatcher scripts for various tasks implemented in those MLCubes.
This PR introduces a new feature - custom entry points for MLCube tasks:
tasks:
download:
entrypoint: /workspace/download.py
parameters:
inputs:
data_config: {type: file, default: data.yaml}
outputs:
data_dir: {type: directory, default: data}
log_dir: {type: directory, default: logs}
Technical details
- One MLCube can implement tasks with and without entry points. If for some task there's no custom entry point, a default image entry point must exist.
- When tasks do not define entry points and default image entry points are used, the first positional argument is always a task name.
- When tasks define entry points, no task name is provided to those entry points.
- Docker runner runs MLCubes with
runcommand. When custom entry point is defined, the MLCube docker runner will pass--entrypointparameter to docker. - Singularity runner uses
runcommand to run tasks without entry points, andexeccommand when custom entry points exist.
Unit tests for docker and singularity runners partially cover this new functionality using very simple MLCubes. More details are available in MLCube docker and singularity runners package descriptions (__init__.py files).
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅