Skip to main content
Version: 0.6.11

Getting started with Starwhale Standalone

When the Starwhale Client (swcli) is installed, you are ready to use Starwhale Standalone.

We also provide a Jupyter Notebook example, you can try it in Google Colab or in your local vscode/jupyterlab.

Installing Starwhale Client​

python3 -m pip install starwhale

For detailed information, see Starwhale Client Installation Guide.

Downloading Examples​

Download Starwhale examples by cloning the Starwhale project via:

GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/star-whale/starwhale.git --depth 1
cd starwhale

To save time in the example downloading, we skip git-lfs and other commits info. We will use ML/DL HelloWorld code MNIST to start your Starwhale journey. The following steps are all performed in the starwhale directory.

Core Workflow

Building Starwhale Runtime​

Runtime example codes are in the example/helloworld directory.

  • Build the Starwhale runtime bundle:

    swcli -vvv runtime build --yaml example/helloworld/runtime.yaml
    tip

    When you first build runtime, creating an isolated python environment and downloading python dependencies will take a lot of time. The command execution time is related to the network environment of the machine and the number of packages in the runtime.yaml. Using the befitting pypi mirror and cache config in the ~/.pip/pip.conf file is a recommended practice.

    For users in the mainland of China, the following conf file is an option:

    [global]
    cache-dir = ~/.cache/pip
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    extra-index-url = https://mirrors.aliyun.com/pypi/simple/
  • Check your local Starwhale Runtime:

    swcli runtime list
    swcli runtime info helloworld

Building a Model​

Model example codes are in the example/helloworld directory.

  • Build a Starwhale model:

    swcli -vvv model build example/helloworld --name helloworld -m evaluation --runtime helloworld
  • Check your local Starwhale models:

    swcli model list
    swcli model info helloworld

Building a Dataset​

Dataset example codes are in the example/helloworld directory.

  • Build a Starwhale dataset:

    swcli runtime run helloworld --cwd example/helloworld  python3 dataset.py
  • Check your local Starwhale dataset:

    swcli dataset list
    swcli dataset info mnist64
    swcli dataset head mnist64

Running an Evaluation Job​

  • Create an evaluation job:

    swcli -vvv model run --uri helloworld --dataset mnist64 --runtime helloworld
  • Check the evaluation result

    swcli job list
    swcli job info $(swcli job list | grep mnist | grep success | awk '{print $1}' | head -n 1)

Congratulations! You have completed the Starwhale Standalone Getting Started Guide.