{"id":21888410,"url":"https://github.com/hydrospheredata/hydro-serving-cli","last_synced_at":"2025-04-15T10:18:06.473Z","repository":{"id":29893643,"uuid":"123100375","full_name":"Hydrospheredata/hydro-serving-cli","owner":"Hydrospheredata","description":"CLI for the Hydrosphere.io project.","archived":false,"fork":false,"pushed_at":"2023-10-02T23:43:35.000Z","size":653,"stargazers_count":2,"open_issues_count":9,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-15T10:17:24.342Z","etag":null,"topics":["cli","hydrosphere","serving","yaml"],"latest_commit_sha":null,"homepage":"http://docs.hydrosphere.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hydrospheredata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-27T08:50:47.000Z","updated_at":"2021-11-12T16:28:10.000Z","dependencies_parsed_at":"2022-08-07T14:31:03.950Z","dependency_job_id":null,"html_url":"https://github.com/Hydrospheredata/hydro-serving-cli","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hydrospheredata%2Fhydro-serving-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hydrospheredata%2Fhydro-serving-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hydrospheredata%2Fhydro-serving-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hydrospheredata%2Fhydro-serving-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hydrospheredata","download_url":"https://codeload.github.com/Hydrospheredata/hydro-serving-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048747,"owners_count":21204306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","hydrosphere","serving","yaml"],"created_at":"2024-11-28T11:15:32.972Z","updated_at":"2025-04-15T10:18:06.448Z","avatar_url":"https://github.com/Hydrospheredata.png","language":"Python","readme":"# hydro-serving-cli\n\n[![PyPI version](https://badge.fury.io/py/hs.svg)](https://badge.fury.io/py/hs)\n\nCLI tool for [hydro-serving](https://github.com/Hydrospheredata/hydro-serving).\n\n## Installation\n\n```bash\npip install hs\n```\n\n## Usage\n\n### hs cluster\n\nSince 0.1.0 the tool uses configurable endpoints called cluster:\nThey can be managed with:\n\n- `hs cluster` - shows default cluster\n- `hs cluster add --name local --server http://localhost` - creates entry with name `local`\nand address `http://localhost`.\n- `hs cluster use local` - uses the previously created `local` cluster as default\n- `hs cluster rm local` - removes `local` cluster entry\n\nThe default cluster is used as endpoint for all API calls made from the CLI tool.\n\n### hs upload\n\nWhen you use `hs upload`, the tool looks for `serving.yaml` file in current dir.\n`serving.yaml` defines model metadata and contract\n\n```yaml\nkind: Model\nname: \"example_model\"\ninstall-command: \"pip install requirements.txt\"  # if you need to run additional command before deployment\nruntime: \"hydrosphere/serving-runtime-python:3.6-latest\"\npayload:\n  - \"saved_model.pb\"\n  - \"variables/\"\n\nmonitoring:\n  - name: ks\n    kind: KSMetricSpec\n    config:\n      input: client_profile_42\n    with-health: true\n  - name: gan\n    kind: GANMetricSpec\n    with-health: true\n    config:\n      input: feature\n      application: claims-gan-app\n  - name: autoencoder\n    kind: AEMetricSpec\n    with-health: true\n    config:\n      application: claims-autoencoder-app\n      input: feature\n      threshold: 69\n  \ncontract:\n  name: detect  # the name of signature\n  inputs:  # signature input fields\n    image_b64:\n      type: string\n  outputs:  # signature output fields\n    scores:\n      shape: [-1]\n      type: double\n    classes:\n      shape: [-1]\n      type: string\n```\n\n### hs apply\n\nThe command takes `-f` path parameter to yaml file or directory containing yaml files.\nThen, it will read the yaml documents and apply them sequentially.\n\nThese files can contain definition of a resource defined below:\n\n#### Model\n\nThe model definition is the same as in `serving.yaml` file.\n\n#### HostSelector\n\nExample of a selector definition:\n\n```yaml\nkind: HostSelector\nname: xeon-cpu\nnode_selector: \"/* INSTANCE SELECTOR */\"\n```\n\nNote that selector is a string that defines platform specific filter on instances.\n\n#### Application\n\nFor the sake of simplicity CLI provides simplified structures for major use cases:\n\n- Single model app:\n\n```yaml\nkind: Application\nname: demo-app\nsingular:\n  model: demo_model:2\n```\n\n- Pipeline app\n\n```yaml\nkind: Application\nname: demo-pipeline-app\n\npipeline:\n  - - model: claims-preprocessing:1\n  - - model: claims-model:1\n      weight: 80\n    - model: claims-model:2\n      weight: 20\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhydrospheredata%2Fhydro-serving-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhydrospheredata%2Fhydro-serving-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhydrospheredata%2Fhydro-serving-cli/lists"}