Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: update zh-doc for example and cli #1304

Merged
merged 11 commits into from
Oct 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ example/mnist/runtime.yaml
example/mnist/sw_output
example/mnist/test/task_volume
example/cifar10/data/
example/cifar10/models/
example/PennFudanPed/data/
example/PennFudanPed/models/
example/nmt/models/
Expand Down
2 changes: 1 addition & 1 deletion client/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"fs>=2.4.0",
"typing-extensions>=4.0.0",
"commonmark>=0.9.1",
"textual>=0.1.18",
"textual==0.1.18",
"jsonlines==3.0.0",
"boto3==1.21.0",
"scikit-learn>=0.20.0",
Expand Down
2 changes: 2 additions & 0 deletions client/starwhale/consts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ class SWDSSubFileType:
DEFAULT_PAGE_SIZE = 20

RECOVER_DIRNAME = ".recover"
OBJECT_STORE_DIRNAME = ".objectstore"
DATA_STORE_DIRNAME = ".datastore"
DEFAULT_PYTHON_VERSION = "3.8"
LATEST_TAG = "latest"

Expand Down
21 changes: 17 additions & 4 deletions client/starwhale/core/eval/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import click

from starwhale.consts.env import SWEnv

from .view import JobTermView, get_term_view, DEFAULT_PAGE_IDX, DEFAULT_PAGE_SIZE


Expand Down Expand Up @@ -38,15 +40,26 @@ def _list(


@eval_job_cmd.command("run", help="Run job")
@click.argument("project", default="")
@click.option("--version", default=None, help="Evaluation job version")
@click.option(
"-p",
"--project",
envvar=SWEnv.project,
default="",
help=f"project name, env is {SWEnv.project}",
)
@click.option(
"--version",
envvar=SWEnv.eval_version,
default=None,
help=f"Evaluation job version, env is {SWEnv.eval_version}",
)
@click.option("--model", required=True, help="model uri or model.yaml dir path")
# TODO:support multi dataset
@click.option(
"--dataset",
required=True,
# multiple=True,
help="dataset uri, one or more",
envvar=SWEnv.dataset_uri,
help=f"dataset uri, env is {SWEnv.dataset_uri}",
)
@click.option("--runtime", default="", help="runtime uri")
@click.option("--name", default="default", help="job name")
Expand Down
13 changes: 11 additions & 2 deletions client/starwhale/core/model/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,27 @@ def _extract(model: str, force: bool, target_dir: str) -> None:
help="Model yaml filename, default use ${MODEL_DIR}/model.yaml file",
)
@click.option(
"-p",
"--project",
envvar=SWEnv.project,
default="",
help=f"project name, env is {SWEnv.project}",
)
@click.option(
"--version", envvar=SWEnv.eval_version, default=None, help="Evaluation job version"
"--version",
envvar=SWEnv.eval_version,
default=None,
help=f"Evaluation job version, env is {SWEnv.eval_version}",
)
@click.option("--step", default="", help="Evaluation run step")
@click.option("--task-index", default=-1, help="Index of tasks in the current step")
@click.option("--runtime", default="", help="runtime uri")
@click.option("--dataset", envvar=SWEnv.dataset_uri, help="dataset uri")
@click.option(
"--dataset",
required=True,
envvar=SWEnv.dataset_uri,
help=f"dataset uri, env is {SWEnv.dataset_uri}",
)
def _eval(
project: str,
target: str,
Expand Down
9 changes: 8 additions & 1 deletion client/starwhale/mngt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
from starwhale.consts import (
RECOVER_DIRNAME,
SW_TMP_DIR_NAME,
DATA_STORE_DIRNAME,
VERSION_PREFIX_CNT,
STANDALONE_INSTANCE,
OBJECT_STORE_DIRNAME,
DEFAULT_MANIFEST_NAME,
)
from starwhale.utils.fs import empty_dir
Expand All @@ -27,7 +29,12 @@ def gc(dry_run: bool = False, yes: bool = False) -> None:

for project_dir in sw.rootdir.iterdir():
project_name = project_dir.name
if project_name in (RECOVER_DIRNAME, SW_TMP_DIR_NAME):
if project_name in (
RECOVER_DIRNAME,
SW_TMP_DIR_NAME,
OBJECT_STORE_DIRNAME,
DATA_STORE_DIRNAME,
):
continue

if not yes and not click.confirm(
Expand Down
6 changes: 4 additions & 2 deletions client/starwhale/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
DEFAULT_PROJECT,
DEFAULT_INSTANCE,
ENV_SW_CLI_CONFIG,
DATA_STORE_DIRNAME,
STANDALONE_INSTANCE,
ENV_SW_LOCAL_STORAGE,
LOCAL_CONFIG_VERSION,
OBJECT_STORE_DIRNAME,
DEFAULT_SW_LOCAL_STORAGE,
)
from starwhale.consts.env import SWEnv
Expand Down Expand Up @@ -111,11 +113,11 @@ def rootdir(self) -> Path:

@property
def datastore_dir(self) -> Path:
return self.rootdir / ".datastore"
return self.rootdir / DATA_STORE_DIRNAME

@property
def object_store_dir(self) -> Path:
return self.rootdir / ".objectstore"
return self.rootdir / OBJECT_STORE_DIRNAME

@property
def sw_remote_addr(self) -> str:
Expand Down
3 changes: 2 additions & 1 deletion client/tests/sdk/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from pyfakefs.fake_filesystem_unittest import TestCase

from starwhale import Link, MIMEType, UserRawBuildExecutor
from starwhale.consts import OBJECT_STORE_DIRNAME
from starwhale.utils.fs import blake2b_file
from starwhale.utils.error import NoSupportError, FieldTypeOrValueError
from starwhale.core.dataset.type import (
Expand Down Expand Up @@ -94,7 +95,7 @@ def setUp(self) -> None:
super().setUp()

self.object_store_dir = os.path.join(
self.local_storage, ".objectstore", DatasetStorage.object_hash_algo
self.local_storage, OBJECT_STORE_DIRNAME, DatasetStorage.object_hash_algo
)
self.raw_data = os.path.join(self.local_storage, ".user", "data")
self.workdir = os.path.join(self.local_storage, ".user", "workdir")
Expand Down
3 changes: 3 additions & 0 deletions docs/docs/community/contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Contribute to Starwhale
---
4 changes: 4 additions & 0 deletions docs/docs/community/dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Development Tutorial
---

3 changes: 3 additions & 0 deletions docs/docs/community/roadmap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Roadmap
---
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Starwhale Dataset
title: Dataset
---

## dataset.yaml Definition
Expand Down
3 changes: 3 additions & 0 deletions docs/docs/guides/evaluation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Evaluation
---
3 changes: 3 additions & 0 deletions docs/docs/guides/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: FAQ
---
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Starwhale Model
title: Model
---
## model.yaml Definition

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Starwhale Runtime
title: Runtime
---

## What is Starwhale Runtime?
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions docs/docs/img/board.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/completion.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/dataset-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/dataset-info.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/dataset-recover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/dataset-tags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/eval-compare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/ag_news-eval.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/ag_news-ui.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/cifar10-dataset.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/mnist-eval.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/mnist-viewer.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/nmt-cloud-result.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/nmt-eval-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/nmt-train.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/pfp-cloud-result-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/pfp-dataset.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/pfp-eval-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/sc_dataset_build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/sc_dataset_info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/sc_dataset_viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/sc_eval.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/sc_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/examples/sc_train.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/gc.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/docs/img/instance-info.png
3 changes: 3 additions & 0 deletions docs/docs/img/instance-list.png
3 changes: 3 additions & 0 deletions docs/docs/img/model-eval.gif
3 changes: 3 additions & 0 deletions docs/docs/img/open-ui.gif
3 changes: 3 additions & 0 deletions docs/docs/img/quickstart-shell.gif
3 changes: 3 additions & 0 deletions docs/docs/img/runtime-build.gif
3 changes: 3 additions & 0 deletions docs/docs/img/runtime-dockerize.png
3 changes: 3 additions & 0 deletions docs/docs/img/runtime-lock.gif
2 changes: 1 addition & 1 deletion docs/docs/quickstart/on-premises.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Starwhale provides two ways to install an On-Premises instance in your private c

- Standard Kubernetes Cluster: A pre-deployed Kubernetes cluster is required.
- Minikube: You should have minikube and docker installed on your machine.
- For more deployment details of Kubernetes, you can refer to this [doc](../cloud/helm-charts.md).
- For more deployment details of Kubernetes, you can refer to this [doc](../guides/install/helm-charts.md).

:::notes
In this tutorial, minikube is used instead of the standard Kubernetes cluster
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/quickstart/standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The Starwhale client version is currently under alpha preview. Thus `--pre` is r
Starwhale standalone requires Python 3.7 or above. Currently, Starwhale only supports Linux and macOS X. Windows is coming soon.
:::

At the installation stage, we strongly recommend you follow the [doc](../standalone/installation.md).
At the installation stage, we strongly recommend you follow the [doc](../guides/install/standalone.md).

## Downloading Examples

Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion docs/docs/reference/cli/dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@ swcli [GLOBAL OPTIONS] dataset [OPTIONS] COMMAND [ARGS]...
|-------|----------|-----|
|build|✅|❌|
|copy|✅|✅|
|diff|✅|❌|
|history|✅|✅|
|info|✅|✅|
|list|✅|✅|
|recover|✅|✅|
|remove|✅|✅|
|summary|✅|✅|
|tag|✅|❌|

## Build a dataset

```bash
swcli build [OPTIONS] WORKDIR
swcli dataset build [OPTIONS] WORKDIR
```

- This command builds a dataset within the specified working directory. The working dir must contain a `dataset.yaml`, which defines the metadata and process handler for dataset building.
Expand Down
Loading