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

New docs structure #188

Merged
merged 109 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
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
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
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
5856a37
fix index get-started snippet
mike0sv Oct 17, 2022
a7749bc
deployments docs
mike0sv Oct 17, 2022
edc1931
Update content/docs/get-started/index.md
aguschin Oct 18, 2022
d4b6230
Update content/docs/get-started/index.md
aguschin Oct 18, 2022
58c6e00
Update content/docs/get-started/index.md
aguschin Oct 18, 2022
4ae9318
Update content/docs/get-started/index.md
aguschin Oct 18, 2022
71e0edd
Update content/docs/get-started/index.md
aguschin Oct 18, 2022
a171a85
object-reference: re-generate, add serving/sagemaker page
aguschin Oct 18, 2022
35bae87
format code with black
aguschin Oct 18, 2022
3e994a0
remove .mlem/ dir mentions, rename .mlem/config.yaml to .mlem.yaml
aguschin Oct 18, 2022
8447773
fix linting
aguschin Oct 18, 2022
f4c489d
command-reference: re-generate it
aguschin Oct 18, 2022
a3ae71b
remove mlem list mentions
aguschin Oct 18, 2022
7d76ec1
remove --conf and -c options
aguschin Oct 18, 2022
ff46362
use-cases: update
aguschin Oct 18, 2022
e09104c
API ref bootstrap WIP
mike0sv Oct 19, 2022
d6cae58
update bootstrap_api.py
aguschin Oct 19, 2022
d9d0e1e
improve scripts
aguschin Oct 19, 2022
44e7413
regenerate API and fix CLI reference
aguschin Oct 19, 2022
9da5477
Apply suggestions from code review
aguschin Oct 20, 2022
02942c8
get-started/new changes
aguschin Oct 20, 2022
15b2062
merging
aguschin Oct 20, 2022
1498d66
remove dvc/s3/gh/gl/bb from the sidebar
aguschin Oct 20, 2022
0079da1
return user-guide/heroku, update user-guide/sagemaker
aguschin Oct 20, 2022
8d95062
remove outdated examples and replace them with link to GS and UG
aguschin Oct 20, 2022
98a6361
Merge pull request #197 from iterative/api-reference-script
aguschin Oct 21, 2022
fcd25d4
update sagemaker
aguschin Oct 21, 2022
706947b
add deployment to k8s docs
madhur-tandon Sep 20, 2022
b94d888
fix lint
madhur-tandon Sep 20, 2022
f8236a0
move to user guides
madhur-tandon Oct 13, 2022
e8bdc45
suggested fixes
madhur-tandon Oct 21, 2022
a033b1e
fix linting
madhur-tandon Oct 21, 2022
fb0f477
remove usage of --conf
madhur-tandon Oct 21, 2022
9926b74
remove newline between cmd and output
madhur-tandon Oct 21, 2022
7c1b8d2
adjustments due to refactor of deployments
madhur-tandon Oct 21, 2022
f6c94e0
Merge pull request #183 from iterative/k8s-docs
madhur-tandon Oct 21, 2022
b277052
Update index.md
aguschin Oct 24, 2022
8479856
sagemaker declare examples
mike0sv Oct 25, 2022
20e0074
fix broken links
madhur-tandon Oct 25, 2022
02870a2
remove unneeded stuff
madhur-tandon Oct 25, 2022
fd4e742
fix one more link
madhur-tandon Oct 25, 2022
ddefa30
fix lint
madhur-tandon Oct 25, 2022
6498369
Update content/docs/get-started/deploying.md
aguschin Oct 25, 2022
4a965d2
Merge pull request #201 from iterative/fix/broken-links
madhur-tandon Oct 25, 2022
13ca5a7
add UG for docker
madhur-tandon Oct 25, 2022
c9d3ecb
suggested changes
madhur-tandon Oct 26, 2022
56797e3
Merge pull request #202 from iterative/user-guide-docker
madhur-tandon Oct 26, 2022
3db2ad2
add docs for requirement, venv, conda builders
madhur-tandon Oct 13, 2022
715292a
change titles
madhur-tandon Oct 13, 2022
c05631e
move to user guide
madhur-tandon Oct 13, 2022
de66408
address minor feedback
madhur-tandon Oct 17, 2022
991ce65
fix requirements.md
madhur-tandon Oct 25, 2022
cb30fb0
fix venv
madhur-tandon Oct 25, 2022
37846af
update custom reqs
madhur-tandon Oct 25, 2022
c13d140
minor fixes
madhur-tandon Oct 25, 2022
b2bc7f3
fix conda reqs docs
madhur-tandon Oct 25, 2022
3042586
suggested changes
madhur-tandon Oct 25, 2022
46534e3
suggested changes
madhur-tandon Oct 26, 2022
d2be41a
add object-refs
madhur-tandon Oct 26, 2022
04e2c5d
update sidebar
madhur-tandon Oct 26, 2022
501b7ed
import f from another file for custom reqs
madhur-tandon Oct 27, 2022
d5987c6
change filename to func
madhur-tandon Oct 27, 2022
c9565a7
add a note about pip builder
madhur-tandon Oct 27, 2022
2d34fec
comment our file reqs section
madhur-tandon Oct 27, 2022
d39200e
Merge pull request #191 from iterative/requirement-builder-docs
madhur-tandon Oct 27, 2022
e9a4c5f
Update sidebar.json
aguschin Oct 27, 2022
4262403
Update sidebar.json
aguschin Oct 27, 2022
2422c20
Update sidebar.json
aguschin Oct 27, 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
23 changes: 12 additions & 11 deletions content/docs/api-reference/apply.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mlem.api.apply()

Apply provided model against provided data
Apply provided model against provided data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jorgeorpinel, I have a question about docs tone. I see sometimes we say "One can...", sometimes "You can...", sometimes "We can...". Is it ok to have it like this? I'm sure you discussed this with other products, what have you decided?

Copy link
Contributor

@jorgeorpinel jorgeorpinel Oct 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best to be consistent. In DVC docs we use 2nd person form ("you can", "your models", "do this or that") with the idea that it hopefully feels more actionable to the reader.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @mike0sv @madhur-tandon - for future reference


```py
def apply(
Expand All @@ -9,8 +9,6 @@ def apply(
method: str = None,
output: str = None,
target_project: str = None,
index: bool = None,
external: bool = None,
batch_size: Optional[int] = None,
) -> Optional[Any]
```
Expand All @@ -33,16 +31,19 @@ required.

## Parameters

- **`model`** (required) - MLEM model (a MlemModel object).
- **`model`** (required) - MLEM model.
- **`data`** (required) - Input to the model.
- `method` (optional) - Which model method to use. If None, use the only method
model has. If more than one is available, will fail.
- `output` (optional) - If value is provided, assume its path and save output
- `method` (optional) - Which model method to use.If None, use the only method
model has.If more than one is available, will fail.
- `output` (optional) - If value is provided,assume it's path and save output
there.
- `target_project` (optional) - The path to project to save the results to.
- `index` (optional) - Whether to index saved output in MLEM root folder.
- `external` (optional) - Whether to save result outside mlem dir.
- `batch_size` (optional) - If data is to be loaded and applied in batches.
- `target_project` (optional) - Path to MLEM project to save the result to.
- `batch_size` (optional) - If provided, will process data in batches of given
size.

## Returns

If `output=None`, returns results for given data. Otherwise returns None.

## Exceptions

Expand Down
19 changes: 10 additions & 9 deletions content/docs/api-reference/apply_remote.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mlem.api.apply_remote()

Apply deployed model (possibly remote) against provided data.
Apply provided model against provided data.

```py
def apply_remote(
Expand All @@ -9,7 +9,6 @@ def apply_remote(
method: str = None,
output: str = None,
target_project: str = None,
index: bool = False,
**client_kwargs,
) -> Optional[Any]
```
Expand All @@ -34,14 +33,16 @@ knows how to make requests to the deployed model.

- **`client`** (required) - The client to access methods of deployed model.
- **`data`** (required) - Input to the model.
- `method` (optional) - Which model method to use. If None, use the only method
model has. If more than one is available, will fail.
- `output` (optional) - If value is provided, assume its path and save output
- **`method`** (required) - Which model method to use.If None, use the only
method model has.If more than one is available, will fail.
- `output` (optional) - If value is provided,assume it's path and save output
there.
- `target_project` (optional) - The path to project to save the results to.
- `index` (optional) - Whether to index saved output in MLEM root folder.
- `client_kwargs` (optional) - Keyword arguments for the underlying client
implementation being used.
- `target_project` (optional) - Path to MLEM project to save the result to.
- `**client_kwargs` (optional) - Additional arguments to pass to client.

## Returns

If `output=None`, returns results for given data. Otherwise returns None.

## Exceptions

Expand Down
46 changes: 34 additions & 12 deletions content/docs/api-reference/build.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# 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.
Pack model into something useful, such as docker image, Python package or
something else.

```py
def build(
Expand All @@ -27,33 +26,56 @@ This API is the underlying mechanism for the
programmatically create ship-able assets from MlemModels such as pip-ready
packages, Docker images, etc.

<admon type="tip">
<details>

The arguments supplied to this method can be found with `mlem types`:
### The arguments supplied to this method can be found with `mlem types` command

```cli
$ mlem types builder pip
Type mlem.contrib.pip.base.PipBuilder
MlemABC parent type: builder
MlemABC type: pip
MlemObject type name: builder
Create a directory python package
Fields:
[required] package_name: str
Name of python package
[required] target: str
[not required] templates_dir: str = []
Path to save result
[not required] templates_dir: List[str] = []
list of directories to look for jinja templates
[not required] templates_dir.0: str = None
Element of templates_dir
[not required] python_version: str = None
Required python version
[not required] short_description: str = ""
short_description
[not required] url: str = ""
url
[not required] email: str = ""
author's email
[not required] author: str = ""
author's name
[not required] version: str = "0.0.0"
[not required] additional_setup_kwargs: typing.Any = {}
package version
[not required] additional_setup_kwargs: Dict[str, any] = {}
additional parameters for setup()
[not required] additional_setup_kwargs.key: any = None
Element of additional_setup_kwargs
```

</admon>
</details>

## Parameters

- **`builder`** (required) - Builder to use. Out-of-the-box supported string
values are ['whl', 'pip', 'docker_dir', 'docker'].
- **`builder`** (required) - Builder to use.
- **`model`** (required) - The model to build.
- `builder_kwargs` (optional) - Keyword arguments for the underlying builder
being used.
- **`builder_kwargs`** (required) - Additional keyword arguments to pass to the
builder.

## Returns

The result of the build, different for different builders.

## Exceptions

Expand Down
25 changes: 12 additions & 13 deletions content/docs/api-reference/clone.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# mlem.api.clone()

Clones MLEM object from `path` to `target` and returns Python representation for
the created object.
Clones [MLEM Object](/doc/user-guide/basic-concepts) from `path` to `out` and
returns Python representation for the created object.

```py
def clone(
Expand All @@ -14,8 +14,6 @@ def clone(
target_fs: Optional[str] = None,
follow_links: bool = True,
load_value: bool = False,
index: bool = None,
external: bool = None,
) -> MlemObject
```

Expand All @@ -37,20 +35,21 @@ target.
## Parameters

- **`path`** (required) - Path to the object. Could be local path or path inside
a Git repo.
a git repo.
- **`target`** (required) - Path to save the copy of initial object to.
- `project` (optional) - URL to project if object is located there.
- `rev` (optional) - revision, could be Git commit SHA, branch name or tag.
- `rev` (optional) - revision, could be git commit SHA, branch name or tag.
- `fs` (optional) - filesystem to load object from
- `target_project` (optional) - path to project to save cloned object to
- `target_fs` (optional) - target filesystem
- `follow_links` (optional) - If object we read is a MLEM link, whether to load
the actual object link points to. Defaults to True.
- `load_value` (optional) - Load actual Python object incorporated in MlemMeta
object. Defaults to False.
- `index` (optional) - Whether to index output in .mlem directory
- `external` (optional) - whether to put object inside mlem dir in target
project
- `follow_links` (optional) - If object we read is a MLEM link, whether to
loadthe actual object link points to. Defaults to True.
- `load_value` (optional) - Load actual python object incorporated in
MlemObject. Defaults to False.

## Returns

`MlemObject`: Copy of initial object saved to `out`.

## Exceptions

Expand Down
45 changes: 19 additions & 26 deletions content/docs/api-reference/deploy.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
# mlem.api.deploy()

Deploy a model to target environment. Can use existing deployment declaration or
create a new one on-the-fly.
Deploy a model to a target environment. Can use an existing deployment
declaration or create a new one on-the-fly.

```py
def deploy(
deploy_meta_or_path: Union[MlemDeploy, str],
model: Union[MlemModel, str] = None,
deploy_meta_or_path: Union[MlemDeployment, str],
model: Union[MlemModel, str],
env: Union[MlemEnv, str] = None,
project: Optional[str] = None,
rev: Optional[str] = None,
fs: Optional[AbstractFileSystem] = None,
external: bool = None,
index: bool = None,
env_kwargs: Dict[str, Any] = None,
**deploy_kwargs,
) -> MlemDeploy
) -> MlemDeployment
```

[//]: # '### Usage:'
[//]: #
[//]: # '```py'
[//]: # 'from mlem.api import deploy'
[//]: #
[//]: # '#TODO'
[//]: # '```'

## Description

This API is the underlying mechanism for the
Expand All @@ -32,17 +24,18 @@ provides a programmatic way to create deployments for a target environment.

## Parameters

- **`deploy_meta_or_path`** (required) - Path to deployment meta (will be
created if it does not exist)
- `model` (optional) - Path to model
- `env` (optional) - Path to target environment
- `project` (optional) - Path to MLEM project
- `fs` (optional) - filesystem to load deploy meta from. If not provided, will
be inferred from `deploy_meta_or_path`
- `external` (optional) - Save result not in mlem dir, but directly in project
- `index` (optional) - Whether to index output in .mlem directory
- `deploy_kwargs` (optional) - Configuration for new deployment meta if it does
not exist
- **`deploy_meta_or_path`** (required) - MlemDeployment object or path to it.
- **`model`** (required) - The model to deploy.
- **`env`** (required) - The environment to deploy to.
- `project` (optional) - Path to mlem project where to load obj from.
- `rev` (optional) - Revision if object is stored in git repo.
- `fs` (optional) - Filesystem to use to load the object.
- `env_kwargs` (optional) - Additional kwargs to pass to the environment.
- `deploy_kwargs` (optional) - Additional kwargs to pass to the deployment.

## Returns

`MlemDeployment`: The deployment object.

## Exceptions

Expand Down
34 changes: 17 additions & 17 deletions content/docs/api-reference/import_object.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# mlem.api.import_object()

Try to load an object as MLEM model (or dataset) and return it, optionally
saving to the specified target location.
Try to load an object as MLEM model (or data) and return it, optionally saving
to the specified target location.

```py
def import_object(
Expand All @@ -14,8 +14,6 @@ def import_object(
target_fs: Optional[AbstractFileSystem] = None,
type_: Optional[str] = None,
copy_data: bool = True,
external: bool = None,
index: bool = None,
)
```

Expand Down Expand Up @@ -47,19 +45,21 @@ command.

## Parameters

- **`path`** (required) - Path of file to import.
- `project` (optional) - Path to MLEM project.
- `rev` (optional) - revision, could be Git commit SHA, branch name or tag.
- `fs` (optional) - FileSystem for the `path` argument
- `target` (optional) - Path to save MLEM object into.
- `target_project` (optional) - Path to MLEM project for `target`.
- `target_fs` (optional) - FileSystem for the `target` argument
- `type_` (optional) - Specify how to read file. Available types: ['pickle',
'pandas']. Defaults to auto-infer.
- `copy_data` (optional) - Whether to create a copy of file in target location
or just link existing file. Defaults to True.
- `external` (optional) - Save result directly to `target` (not inside `.mlem/`)
- `index` (optional) - Whether to index output in `.mlem/` directory
- **`path`** (required) - Path to the object to import.
- `project` (optional) - Path to mlem project where to load obj from.
- `rev` (optional) - Revision if object is stored in git repo.
- `fs` (optional) - Filesystem to use to load the object.
- `target` (optional) - Where to store the imported object.
- `target_project` (optional) - If provided, treat `target` as object name and
dumpobject in this MLEM Project.
- `target_fs` (optional) - Filesystem to use to save the object.
- `type_` (optional) - Type of the object to import. If not provided, will try
toinfer from the object itself.
- `copy_data` (optional) - Whether to copy data to the target location.

## Returns

`MlemObject`: Imported object.

## Exceptions

Expand Down
20 changes: 7 additions & 13 deletions content/docs/api-reference/init.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
# mlem.api.init()

Creates and populates the `.mlem/` directory in `path`.
Creates [MLEM config](/doc/user-guide/configuration) in `path`.

```py
def init(path: str = ".") -> None
```

### Usage:

```py
from mlem.api import init

init(path)
```

## Description

Initializes a MLEM project by creating a `.mlem/` directory inside the given
path. A new and empty `config.yaml` is also created inside it.
Initializes a MLEM project by creating a new and empty `.mlem.yaml` file.

## Parameters

- **`path`** (required) - location of the target where a MLEM project has to be
initialized i.e. a `.mlem/` folder has to be created. `.` by default
- `path` (optional) - Path to create config in. Defaults to current directory.

## Returns

None

## Exceptions

Expand Down
Loading