Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #172 from iterative/new-cli
Browse files Browse the repository at this point in the history
Semi-autogenerated cli reference
  • Loading branch information
aguschin authored Oct 5, 2022
2 parents 45b0179 + 095acea commit 0525959
Show file tree
Hide file tree
Showing 22 changed files with 594 additions and 176 deletions.
37 changes: 21 additions & 16 deletions content/docs/command-reference/apply-remote.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ a MLEM object to `output` if provided. Otherwise, it will be printed to
## Synopsis

```usage
usage: mlem apply-remote [options] [subtype] data
arguments:
[SUBTYPE] Type of client. Choices: ['http', 'rmq']
DATA Path to dataset object [required]
usage: mlem apply-remote [-d <path>] [-p <path>] [--rev <commitish>]
[-o <path>] [--tp <path>] [-m <text>]
[--index] [--json] [-f <text>] [-h]
[<client> [client options] | --load <declaration>]
Builtin clients:
- http
- rmq
- sagemaker
```

## Description
Expand All @@ -27,18 +31,19 @@ clients are `http` and `rmq` - which are used to launch requests against the

## Options

- `-p, --project TEXT`: Path to MLEM project [default: (none)]
- `--rev TEXT`: Repo revision to use [default: (none)]
- `-o, --output TEXT`: Where to store the outputs.
- `--target-project, --tp TEXT`: Project to save target to [default: (none)]
- `-m, --method TEXT`: Which model method is to be applied [default: predict]
- `--index / --no-index`: Whether to index output in .mlem directory
- `--json`: Output as json
- `-l, --load TEXT`: File to load client config from
- `-c, --conf TEXT`: Options for client in format `field.name=value`
- `-f, --file_conf TEXT`: File with options for client in format
- `-d <path>`, `--data <path>` - Path to MLEM dataset [required]
- `-p <path>`, `--project <path>` - Path to MLEM project [default: (none)]
- `--rev <commitish>` - Repo revision to use [default: (none)]
- `-o <path>`, `--output <path>` - Where to save model outputs
- `--tp <path>`, `--target-project <path>` - Project to save target to [default:
(none)]
- `-m <text>`, `--method <text>` - Which model method is to be applied [default:
predict]
- `--index` / `--no-index` - Whether to index output in .mlem directory
- `--json` - Output as json
- `-f <text>`, `--file_conf <text>` - File with options for client in format
`field.name=path_to_config`
- `-h, --help`: Show this message and exit.
- `-h`, `--help` - Show this message and exit.

## Example: Apply a locally hosted model to a local dataset

Expand Down
40 changes: 23 additions & 17 deletions content/docs/command-reference/apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ provided. Otherwise, it will be printed to `stdout`.
## Synopsis

```usage
usage: mlem apply [options] model data
usage: mlem apply [-p <path>] [--rev <commitish>] [-o <path>]
[-m <text>] [--dr <path>]
[--data-rev <commitish>] [-i] [--it <text>]
[-b <integer>] [--index] [-e] [--json] [-h]
model data
arguments:
MODEL Path to model object [required]
DATA Path to dataset object [required]
model Path to model object
data Path to data object
```

## Description
Expand All @@ -29,20 +33,22 @@ datasets.

## Options

- `-p, --project TEXT`: Path to MLEM project [default: (none)]
- `--rev TEXT`: Repo revision to use [default: (none)]
- `-o, --output TEXT`: Where to store the outputs.
- `-m, --method TEXT`: Which model method is to be applied [default: predict]
- `--data-project, --dr TEXT`: Project with data
- `--data-rev TEXT`: Revision of data
- `-i, --import`: Try to import data on-the-fly
- `--import-type, --it TEXT`: Specify how to read data file for import.
Available types: ['pandas', 'pickle']
- `-b, --batch_size INTEGER`: Batch size for reading data in batches.
- `--index / --no-index`: Whether to index output in .mlem directory
- `-e, --external`: Save result not in .mlem, but directly in project
- `--json`: Output as json
- `-h, --help`: Show this message and exit.
- `-p <path>`, `--project <path>` - Path to MLEM project [default: (none)]
- `--rev <commitish>` - Repo revision to use [default: (none)]
- `-o <path>`, `--output <path>` - Where to save model outputs
- `-m <text>`, `--method <text>` - Which model method is to be applied [default:
predict]
- `--dr <path>`, `--data-project <path>` - Project with data
- `--data-rev <commitish>` - Revision of data
- `-i`, `--import` - Try to import data on-the-fly
- `--it <text>`, `--import-type <text>` - Specify how to read data file for
import. Available types: ['pandas', 'pickle', 'torch']
- `-b <integer>`, `--batch_size <integer>` - Batch size for reading data in
batches
- `--index` / `--no-index` - Whether to index output in .mlem directory
- `-e`, `--external` - Save result not in .mlem, but directly in project
- `--json` - Output as json
- `-h`, `--help` - Show this message and exit.

## Examples

Expand Down
30 changes: 17 additions & 13 deletions content/docs/command-reference/build.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# build

Build models to create re-usable, ship-able entities such as a Docker image or
Python package.
Build models into re-usable assets you can distribute and use in production,
such as a Docker image or Python package.

## Synopsis

```usage
usage: mlem build [options] model [subtype]
arguments:
MODEL Path to model [required]
[SUBTYPE] Type of build. Choices: ['whl', 'pip', 'docker_dir', 'docker']
usage: mlem build [-m <path>] [-p <path>] [--rev <commitish>]
[-f <text>] [-h]
[<builder> [builder options] | --load <declaration>]
Builtin builders:
- docker
- docker_dir
- kubernetes
- pip
- whl
```

## Description
Expand All @@ -21,13 +26,12 @@ images.

## Options

- `-p, --project TEXT`: Path to MLEM project [default: (none)]
- `--rev TEXT`: Repo revision to use [default: (none)]
- `-l, --load TEXT`: File to load builder config from
- `-c, --conf TEXT`: Options for builder in format `field.name=value`
- `-f, --file_conf TEXT`: File with options for builder in format
- `-m <path>`, `--model <path>` - Path to MLEM model [required]
- `-p <path>`, `--project <path>` - Path to MLEM project [default: (none)]
- `--rev <commitish>` - Repo revision to use [default: (none)]
- `-f <text>`, `--file_conf <text>` - File with options for builder in format
`field.name=path_to_config`
- `-h, --help`: Show this message and exit.
- `-h`, `--help` - Show this message and exit.

## Examples

Expand Down
21 changes: 21 additions & 0 deletions content/docs/command-reference/checkenv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# checkenv

Check that current environment satisfies object requrements

## Synopsis

```usage
usage: mlem checkenv [-p <path>] [--rev <commitish>] [-h]
path
arguments:
path Path to object
```

## Options

- `-p <path>`, `--project <path>` - Path to MLEM project [default: (none)]
- `--rev <commitish>` - Repo revision to use [default: (none)]
- `-h`, `--help` - Show this message and exit.

## Examples
21 changes: 12 additions & 9 deletions content/docs/command-reference/clone.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ saves a copy of it to `target` path.
## Synopsis

```usage
usage: mlem clone [options] uri target
usage: mlem clone [-p <path>] [--rev <commitish>]
[--tp <path>] [-e] [--index] [-h]
uri target
arguments:
URI URI to object you want to clone [required]
TARGET Path to store the downloaded object. [required]
uri URI to object you want to clone
target Path to store the downloaded object.
```

## Description
Expand All @@ -22,12 +24,13 @@ repository.

## Options

- `-p, --project TEXT`: Path to MLEM project [default: (none)]
- `--rev TEXT`: Repo revision to use [default: (none)]
- `--target-project, --tp TEXT`: Project to save target to [default: (none)]
- `-e, --external`: Save result not in .mlem, but directly in project
- `--link / --no-link`: Whether to create link for output in .mlem directory
- `--help`: Show this message and exit.
- `-p <path>`, `--project <path>` - Path to MLEM project [default: (none)]
- `--rev <commitish>` - Repo revision to use [default: (none)]
- `--tp <path>`, `--target-project <path>` - Project to save target to [default:
(none)]
- `-e`, `--external` - Save result not in .mlem, but directly in project
- `--index` / `--no-index` - Whether to index output in .mlem directory
- `-h`, `--help` - Show this message and exit.

## Examples

Expand Down
15 changes: 15 additions & 0 deletions content/docs/command-reference/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# config

Manipulate MLEM configuration.

## Synopsys

```usage
usage: mlem config [-h]
```

## Options

- `-h`, `--help` - Show this message and exit.

## Examples
25 changes: 12 additions & 13 deletions content/docs/command-reference/declare.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ metafile from config args and config files.
## Synopsis

```usage
usage: mlem declare [options] object_type [subtype] path
arguments:
OBJECT_TYPE Type of metafile to declare [required]
[SUBTYPE] Subtype of MLEM object [default: ]
PATH Where to save object [required]
usage: mlem declare [-h]
[<subtype> [subtype options] | --load <declaration>]
Builtin subtypes:
- builder
- client
- deployment
- docker_registry
- env
- server
```

## Description
Expand All @@ -28,12 +32,7 @@ check out the last example [here](/doc/command-reference/types#examples)

## Options

- `-c, --conf TEXT`: Values for object fields in format
`field.nested.name=value`
- `-p, --project TEXT`: Path to MLEM project [default: (none)]
- `-e, --external`: Save result not in .mlem, but directly in project
- `--index / --no-index`: Whether to index output in .mlem directory
- `-h, --help`: Show this message and exit.
- `-h`, `--help` - Show this message and exit.

## Examples

Expand All @@ -45,7 +44,7 @@ $ mlem types env heroku
[not required] api_key: str = None
# Declare the heroku env
$ mlem declare env heroku production --conf api_key="mlem_heroku_staging"
$ mlem declare env heroku production --api_key mlem_heroku_staging
💾 Saving env to .mlem/env/staging.mlem
# Print the contents of the new heroku env metafile
Expand Down
32 changes: 19 additions & 13 deletions content/docs/command-reference/deployment/apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ Apply a deployed model to data.
## Synopsis

```usage
usage: mlem deployment apply [options] path data
usage: mlem deployment apply [-p <path>] [--rev <commitish>]
[--dr <path>] [--data-rev <commitish>]
[-o <text>] [--tp <path>] [-m <text>]
[--index] [--json] [-h]
path data
arguments:
PATH Path to deployment meta [required]
DATA Path to data object [required]
path Path to deployment meta
data Path to data object
```

## Description
Expand All @@ -21,16 +25,18 @@ gathered and returned, also as a MLEM Object.

## Options

- `-p, --project TEXT`: Path to MLEM project [default: (none)]
- `--rev TEXT`: Repo revision to use [default: (none)]
- `--data-project, --dr TEXT`: Project with data
- `--data-rev TEXT`: Revision of data
- `-o, --output TEXT`: Where to store the outputs.
- `--target-project, --tp TEXT`: Project to save target to [default: (none)]
- `-m, --method TEXT`: Which model method is to be applied [default: predict]
- `--index / --no-index`: Whether to index output in .mlem directory
- `--json`: Output as json
- `-h, --help`: Show this message and exit.
- `-p <path>`, `--project <path>` - Path to MLEM project [default: (none)]
- `--rev <commitish>` - Repo revision to use [default: (none)]
- `--dr <path>`, `--data-project <path>` - Project with data
- `--data-rev <commitish>` - Revision of data
- `-o <text>`, `--output <text>` - Where to store the outputs.
- `--tp <path>`, `--target-project <path>` - Project to save target to [default:
(none)]
- `-m <text>`, `--method <text>` - Which model method is to be applied [default:
predict]
- `--index` / `--no-index` - Whether to index output in .mlem directory
- `--json` - Output as json
- `-h`, `--help` - Show this message and exit.

## Example: Apply a dataset on a deployed model

Expand Down
19 changes: 10 additions & 9 deletions content/docs/command-reference/deployment/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# deployment

A set of commands to set up and manage deployments.
A set of commands to set up and manage deployments

## Synopsis

```usage
usage: mlem deployment [options] COMMAND [ARGS]...
arguments:
COMMAND
apply Apply method of deployed service
run Deploy a model to target environment
status Print status of deployed service
remove Stop and destroy deployed instance
usage: mlem deployment [-h]
command
subcommands:
run Deploy a model to a target environment.
remove Stop and destroy deployed instance.
status Print status of deployed service.
wait Wait for status of deployed service
apply Apply a deployed model to data.
```

## Description
Expand Down
9 changes: 5 additions & 4 deletions content/docs/command-reference/deployment/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ Stop and destroy deployed instance.
## Synopsis

```usage
usage: mlem deployment remove [options] path
usage: mlem deployment remove [-p <path>] [-h]
path
arguments:
PATH Path to deployment meta [required]
path Path to deployment meta
```

## Description
Expand All @@ -19,8 +20,8 @@ deleting its associated runtime resources.

## Options

- `-p, --project TEXT`: Path to MLEM project [default: (none)]
- `-h, --help`: Show this message and exit.
- `-p <path>`, `--project <path>` - Path to MLEM project [default: (none)]
- `-h`, `--help` - Show this message and exit.

## Example: Stop and destroy a deployment

Expand Down
Loading

0 comments on commit 0525959

Please sign in to comment.