Skip to main content
Version: 0.6.0

Starwhale Resources URI

tip

Resource URI is widely used in Starwhale client commands. The URI can refer to a resource in the local instance or any other resource in a remote instance. In this way, the Starwhale client can easily manipulate any resource.

concepts-org.jpg

Instance URI​

Instance URI can be either:

  • local: standalone instance.
  • [http(s)://]<hostname or ip>[:<port>]: cloud instance with HTTP address.
  • [cloud://]<cloud alias>: cloud or server instance with an alias name, which can be configured in the instance login phase.
caution

"local" is different from "localhost". The former means the local standalone instance without a controller, while the latter implies a controller listening at the default port 8082 on the localhost.

Example:

# log in Starwhale Cloud; the alias is swcloud
swcli instance login --username <your account name> --password <your password> https://cloud.starwhale.ai --alias swcloud

# copy a model from the local instance to the cloud instance
swcli model copy mnist/version/latest swcloud/project/<your account name>:demo

# copy a runtime to a Starwhale Server instance: http://localhost:8081
swcli runtime copy pytorch/version/v1 http://localhost:8081/project/<your account name>:demo

Project URI​

Project URI is in the format [<Instance URI>/project/]<project name>. If the instance URI is not specified, use the current instance instead.

Example:

swcli project select self   # select the self project in the current instance
swcli project info local/project/self # inspect self project info in the local instance

Model/Dataset/Runtime URI​

  • Model URI: [<Project URI>/model/]<model name>[/version/<version id|tag>].
  • Dataset URI: [<Project URI>/dataset/]<dataset name>[/version/<version id|tag>].
  • Runtime URI: [<Project URI>/runtime/]<runtime name>[/version/<version id|tag>].
tip
  • swcli supports human-friendly short version id. You can type the first few characters of the version id, provided it is at least four characters long and unambiguous. However, the recover command must use the complete version id.
  • If the project URI is not specified, the default project will be used.
  • You can always use the version tag instead of the version id.

Example:

swcli model info mnist/version/hbtdenjxgm4ggnrtmftdgyjzm43tioi  # inspect model info, model name: mnist, version:hbtdenjxgm4ggnrtmftdgyjzm43tioi
swcli model remove mnist/version/hbtdenj # short version
swcli model info mnist # inspect mnist model info
swcli model run mnist --runtime pytorch-mnist --dataset mnist # use the default latest tag

Job URI​

  • format: [<Project URI>/job/]<job id>.
  • If the project URI is not specified, the default project will be used.

Example:

swcli job info mezdayjzge3w   # Inspect mezdayjzge3w version in default instance and default project
swcli job info local/project/self/job/mezday # Inspect the local instance, self project, with short job id:mezday

The default instance​

When the instance part of a project URI is omitted, the default instance is used instead. The default instance is the one selected by the swcli instance login or swcli instance use command.

The default project​

When the project parts of Model/Dataset/Runtime/Evaluation URIs are omitted, the default project is used instead. The default project is the one selected by the swcli project use command.