mlem icon indicating copy to clipboard operation
mlem copied to clipboard

Make subcommands for packaging (and deploy)

Open aguschin opened this issue 3 years ago • 3 comments

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.

aguschin avatar Apr 28 '22 13:04 aguschin

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?

aguschin avatar Apr 28 '22 13:04 aguschin

  1. 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.
  2. mlem types works with all MlemABC, so it should be mentioned everywhere I guess. But more important is to add doc links

mike0sv avatar Apr 28 '22 14:04 mike0sv

mlem pack pip --help +1

daavoo avatar May 09 '22 16:05 daavoo

closed by #363 🚀

aguschin avatar Oct 07 '22 17:10 aguschin