mlem
mlem copied to clipboard
Make subcommands for packaging (and deploy)
My 2cs feedback on UX that I got while following the tutorial. Looking at how packaging works now, I think we can make subcommands to make it more self-explainable. E.g. now:
$ mlem pack rf pip -c target=build/ -c package_name=example_mlem_get_started
⏳️ Loading model from .mlem/model/rf.mlem
💼 Written `example_mlem_get_started` package data to `build`
With subcommands
$ mlem pack pip --help
Pack model to Python package that can be distributed with PyPi
Arguments:
MODEL Path to model
NAME Package name
TARGET Folder to save build
Examples:
$ mlem pack pip rf example_mlem_get_started build/
Pros of this approach: easier to see specific args in --help that are required for each packaging solution, harder to do it wrong.
Cons of this approach: requires either writing subcommands for each packaging type (then it should be part of extension mechanism) or generating subcommands automatically from extensions (may be not user-friendly UX since it's hard to fine-tune it).
The same point probably could be made for deploying mechanics, although I didn't explore how it could be made more intuitive.
As another thought, I think mlem types packager pip for now will be often a complementary command to mlem pack pip. Should we mention this in mlem pack --help? Or suggest checking out mlem types packager X when user calls mlem pack pip with wrong args/options?
- If you specify config for packaging you don't specify type that is why model argument goes before type argument, since type argument is optional.
- mlem types works with all MlemABC, so it should be mentioned everywhere I guess. But more important is to add doc links
mlem pack pip --help +1
closed by #363 🚀