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

Test snippets (WIP) #195

Draft
wants to merge 64 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
4840479
semi-autogenerated cli reference
mike0sv Sep 3, 2022
2fa1e07
fix double spaces and impls order
mike0sv Sep 5, 2022
7b83973
fix double spaces (for real)
mike0sv Sep 5, 2022
d48ed0d
add abc subcommand args
mike0sv Sep 5, 2022
96f2f7b
address comments
mike0sv Sep 9, 2022
a7085ab
prettier
mike0sv Sep 9, 2022
de0b20a
prettier
mike0sv Sep 9, 2022
65f1588
delete spec, update usage and options formatting
mike0sv Sep 13, 2022
e0c1b9d
lint?
mike0sv Sep 13, 2022
7182940
lint?
mike0sv Sep 13, 2022
5b221ba
lint?
mike0sv Sep 13, 2022
2ed3efa
lint
mike0sv Sep 13, 2022
e196fc4
feedback
mike0sv Sep 13, 2022
fabe888
revert yarn.lock
renovate[bot] Sep 2, 2022
1f50a51
initial commit
mike0sv Sep 16, 2022
9ee436c
linting
mike0sv Sep 16, 2022
2c0b544
linting
mike0sv Sep 16, 2022
b34b321
some examples
mike0sv Sep 16, 2022
bab1679
descriptions
mike0sv Sep 16, 2022
3d346d3
add kubernetes
mike0sv Sep 16, 2022
e669838
move scripts, re-generate from latest docs
mike0sv Sep 19, 2022
f254cb6
MLEM model and MLEM dataset
mike0sv Sep 19, 2022
095acea
💅🏼
mike0sv Sep 19, 2022
ea9a9d6
sagemaker docs
mike0sv Sep 19, 2022
dabcdd1
fix sidebar
mike0sv Oct 4, 2022
1753e78
move advanced
mike0sv Oct 4, 2022
5e264c0
general structure
mike0sv Oct 4, 2022
4617f12
object reference re-do
mike0sv Oct 4, 2022
0525959
Merge pull request #172 from iterative/new-cli
aguschin Oct 5, 2022
08c36f1
Merge branch 'release/0.3.0' into new-docs-structure
aguschin Oct 5, 2022
fdcb741
builders
mike0sv Oct 5, 2022
577eea9
mlem-abc links
mike0sv Oct 5, 2022
95c6fb8
sidebar fixes and object ref sorting
mike0sv Oct 5, 2022
3a6ac9a
smore sidebar fixes
mike0sv Oct 5, 2022
3296581
add to ignore
mike0sv Oct 5, 2022
4cc2fc9
smol sidebar fix
mike0sv Oct 5, 2022
5a4509c
Merge remote-tracking branch 'origin/new-docs-structure' into new-doc…
mike0sv Oct 5, 2022
16eba0f
smol lint fix
mike0sv Oct 5, 2022
91dae68
rewriting GS WIP
aguschin Oct 5, 2022
b9356fc
Merge branch 'new-docs-structure' of github.com:iterative/mlem.ai int…
aguschin Oct 5, 2022
387d553
fix lint
aguschin Oct 5, 2022
c4133bb
update serving.md
aguschin Oct 6, 2022
3f40d45
fix typos
aguschin Oct 6, 2022
4d444a9
sorting user guide sidebar
aguschin Oct 6, 2022
d216f6b
simplify get-started/building
aguschin Oct 7, 2022
6e30635
update gs/building
aguschin Oct 7, 2022
5887340
updating user-guide/serving
aguschin Oct 7, 2022
1c44fd6
user-guide/{building, serving}
aguschin Oct 7, 2022
4e96078
user-guide/{building,deploying,models}
aguschin Oct 10, 2022
e1abc9c
remove ls from api and cli
aguschin Oct 10, 2022
b3e3f5e
remove ls from api and cli
aguschin Oct 10, 2022
1e8b46d
update gs using Jorge's feedback
aguschin Oct 11, 2022
2c96f1d
object-reference: updating index pages
aguschin Oct 11, 2022
86a9ace
object-reference/index
aguschin Oct 12, 2022
db3a161
object-reference/index
aguschin Oct 13, 2022
22ad698
get-started
aguschin Oct 16, 2022
75851c1
remove extra part
aguschin Oct 16, 2022
c472436
use-cases: changing page locations
aguschin Oct 16, 2022
3c517f9
get-started/deploying
aguschin Oct 17, 2022
f420592
test code snippets in docs
mike0sv Oct 17, 2022
2c61bb1
replace assert
mike0sv Oct 17, 2022
215b87c
format code with black
aguschin Oct 18, 2022
0773bbb
Revert "format code with black"
aguschin Oct 18, 2022
604ac22
format with black
aguschin Oct 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/docs/api-reference/build.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# mlem.api.build()

Build a [MLEM model](/doc/user-guide/mlem-abcs#modeltype) in pip-ready format, a
built package using whl, docker-build-ready folder or directly build a docker
image.
Build a [MLEM model](/doc/object-reference/mlem-abcs#modeltype) in pip-ready
format, a built package using whl, docker-build-ready folder or directly build a
docker image.

```py
def build(
Expand Down
53 changes: 0 additions & 53 deletions content/docs/api-reference/ls.md

This file was deleted.

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
27 changes: 27 additions & 0 deletions content/docs/command-reference/checkenv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# checkenv

Check that current environment satisfies object requirements

## 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

```cli
$ mlem checkenv rf
⏳️ Loading meta from .mlem/model/rf.mlem
✅ Requirements are satisfied!
```
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
Loading