Skip to content

Commit ac6e1eb

Browse files
authored
Update command-line tool design to support list models/repos in Model Zoo (#2746)
* refine pai code structure * remove unused function * move tensorflow files to a sub-package * add docstring * Add KMeans and RF PAI submitter * use model type defined in runtim.model * fix string compare * Evaluate for PAI * modify code * update cli design to support model zoo list * update doc
1 parent c2d9831 commit ac6e1eb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

doc/design/cli_model_zoo_cmd.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Usage:
1515
sqlflow [options] release model [--force] <model> <version>
1616
sqlflow [options] delete repo <name_version>
1717
sqlflow [options] delete model <model> <version>
18+
sqlflow [options] list repo
19+
sqlflow [options] list model
1820

1921
Options:
2022
-v, --version print the version and exit
@@ -23,6 +25,8 @@ Options:
2325
--env-file=<file> config file in KEY=VAL format
2426
-s, --sqlflow-server=<addr> SQLFlow server address and port
2527
-m, --model-zoo-server=<addr> Model Zoo server address and port
28+
-u, --user=<user> Model Zoo user account
29+
-p, --password=<password> Model Zoo user password
2630

2731
Run Options:
2832
-d, --data-source=<data_source> data source to operate
@@ -41,6 +45,9 @@ As the command-line is written in `docopt`, it can be parsed by existing parsers
4145
### Model Uploading
4246
For model definitions, we can simply tar the whole directory and upload them through the [gRPC interface](https://github.com/sql-machine-learning/sqlflow/blob/14d6a28be13418bec8a17091a0db22b5c76a1fc2/pkg/proto/modelzooserver.proto#L91). For models, there already exists [some code](https://github.com/sql-machine-learning/sqlflow/blob/14d6a28be13418bec8a17091a0db22b5c76a1fc2/pkg/model/model.go#L77) to export the model from database to file system. We can upload them after the exporting.
4347

48+
## Model and Repo Listing
49+
SQLFlow command-line tool support listing released repos/models. By default, users can only list the repos/models released by himself. So, we need to add authentication info in the listing requests. We added `--user` and the `--password` options to handle this. As there may be a lot of models and repos, the implementation will pull the list for multiple times, each time for just a small number of results.
50+
4451
## Action Plan
4552
We will implement the core logic of the command-line, which is the uploading and deleting of objects in the `Model Zoo`.
4653
SQLFlow command-line tool may need some authentication process for further operation. This may be implemented by username/password or by certification file. Also, some of the params in the command-line can be written into env file, we postpone the implementation of these features.

0 commit comments

Comments
 (0)