-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from InfuseAI/feature/sc-21133/ph-apps
add apps and apptemplates
- Loading branch information
Showing
10 changed files
with
1,388 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
|
||
# Primehub Apps | ||
|
||
``` | ||
Usage: | ||
primehub apps <command> | ||
Manage PrimeHub Applications | ||
Available Commands: | ||
create Install an application | ||
delete Stop the PrimeHub Application | ||
get Get the PrimeHub Application | ||
list List PrimeHub Applications | ||
logs Get logs of the PrimeHub Application by id | ||
start Start the PrimeHub Application | ||
stop Stop the PrimeHub Application | ||
Options: | ||
-h, --help Show the help | ||
Global Options: | ||
--config CONFIG Change the path of the config file (Default: ~/.primehub/config.json) | ||
--endpoint ENDPOINT Override the GraphQL API endpoint | ||
--token TOKEN Override the API Token | ||
--group GROUP Override the current group | ||
--json Output the json format (output human-friendly format by default) | ||
``` | ||
|
||
|
||
### create | ||
|
||
Install an application | ||
|
||
|
||
``` | ||
primehub apps create | ||
``` | ||
|
||
|
||
* *(optional)* file: The file path of PrimeHub application configuration | ||
|
||
|
||
|
||
|
||
### delete | ||
|
||
Stop the PrimeHub Application | ||
|
||
|
||
``` | ||
primehub apps delete <id> | ||
``` | ||
|
||
* id | ||
|
||
|
||
|
||
|
||
|
||
### get | ||
|
||
Get the PrimeHub Application | ||
|
||
|
||
``` | ||
primehub apps get <id> | ||
``` | ||
|
||
* id | ||
|
||
|
||
|
||
|
||
|
||
### list | ||
|
||
List PrimeHub Applications | ||
|
||
|
||
``` | ||
primehub apps list | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
### logs | ||
|
||
Get logs of the PrimeHub Application by id | ||
|
||
|
||
``` | ||
primehub apps logs <id> | ||
``` | ||
|
||
* id: The job id | ||
|
||
|
||
* *(optional)* follow: Wait for additional logs to be appended | ||
|
||
* *(optional)* tail: Show last n lines | ||
|
||
|
||
|
||
|
||
### start | ||
|
||
Start the PrimeHub Application | ||
|
||
|
||
``` | ||
primehub apps start <id> | ||
``` | ||
|
||
* id | ||
|
||
|
||
|
||
|
||
|
||
### stop | ||
|
||
Stop the PrimeHub Application | ||
|
||
|
||
``` | ||
primehub apps stop <id> | ||
``` | ||
|
||
* id | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Examples | ||
|
||
The `create` action helps you to install a new PrimeHub application. It shows an example that can be used to create | ||
a `code-server` application: | ||
|
||
``` | ||
$ primehub apps create | ||
PrimeHub application configuration is required. | ||
Example: | ||
{ | ||
"templateId": "code-server", | ||
"id": "code-server-26fcc", | ||
"displayName": "my-code-server-26fcc", | ||
"env": [ | ||
{ | ||
"name": "key1", | ||
"value": "value1" | ||
} | ||
], | ||
"instanceType": "cpu-1", | ||
"scope": "primehub" | ||
} | ||
* the scope field could be one of the ['public', 'primehub', 'group'] | ||
``` | ||
|
||
It follows our convention accepting a STDIN or with a real file by `--file` optional: | ||
|
||
``` | ||
$ primehub apps create <<EOF | ||
{ | ||
"templateId": "code-server", | ||
"id": "code-server-26fcc", | ||
"displayName": "my-code-server-26fcc", | ||
"env": [ | ||
{ | ||
"name": "key1", | ||
"value": "value1" | ||
} | ||
], | ||
"instanceType": "cpu-1", | ||
"scope": "primehub" | ||
} | ||
EOF | ||
``` | ||
|
||
After the application created, it could be found at list: | ||
|
||
``` | ||
$ primehub apps list | ||
id: code-server-26fcc | ||
displayName: my-code-server-26fcc | ||
appVersion: v3.9.2 | ||
appName: code-server | ||
appDefaultEnv: None | ||
appTemplate: | ||
name: Code Server | ||
docLink: https://github.com/cdr/code-server | ||
description: Run VS Code on any machine anywhere and access it in the browser. | ||
groupName: phusers | ||
instanceType: cpu-1 | ||
instanceTypeSpec: | ||
name: cpu-1 | ||
displayName: CPU 1 XD | ||
cpuLimit: 1 | ||
memoryLimit: 2 | ||
gpuLimit: 0 | ||
scope: primehub | ||
appUrl: http://primehub-python-sdk.primehub.io/console/apps/code-server-26fcc | ||
internalAppUrl: http://app-code-server-26fcc:8080/console/apps/code-server-26fcc | ||
svcEndpoints: ['app-code-server-26fcc:8080'] | ||
env: [{'name': 'key1', 'value': 'value1'}] | ||
stop: False | ||
status: Ready | ||
message: Deployment is ready | ||
pods: [{'logEndpoint': 'http://primehub-python-sdk.primehub.io/api/logs/pods/app-code-server-26fcc-765bf579c5-srcft'}] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
|
||
# Primehub Apptemplates | ||
|
||
``` | ||
Usage: | ||
primehub apptemplates <command> | ||
Get PhAppTemplates | ||
Available Commands: | ||
get Get a PhApp template | ||
list List PhApp templates | ||
Options: | ||
-h, --help Show the help | ||
Global Options: | ||
--config CONFIG Change the path of the config file (Default: ~/.primehub/config.json) | ||
--endpoint ENDPOINT Override the GraphQL API endpoint | ||
--token TOKEN Override the API Token | ||
--group GROUP Override the current group | ||
--json Output the json format (output human-friendly format by default) | ||
``` | ||
|
||
|
||
### get | ||
|
||
Get a PhApp template | ||
|
||
|
||
``` | ||
primehub apptemplates get <id> | ||
``` | ||
|
||
* id | ||
|
||
|
||
|
||
|
||
|
||
### list | ||
|
||
List PhApp templates | ||
|
||
|
||
``` | ||
primehub apptemplates list | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Examples | ||
|
||
The `list` action will show you each template that is registered to the PrimeHub | ||
|
||
``` | ||
primehub apptemplates list | ||
``` | ||
|
||
``` | ||
id: code-server | ||
name: Code Server | ||
version: v3.9.2 | ||
description: Run VS Code on any machine anywhere and access it in the browser. | ||
docLink: https://github.com/cdr/code-server | ||
image: codercom/code-server:3.9.2 | ||
id: label-studio | ||
name: Label Studio | ||
version: 1.1.0 | ||
description: Label Studio is an open source data labeling tool for labeling and exploring multiple types of data. You can perform many different types of labeling for many different data formats. | ||
docLink: https://labelstud.io/guide/ | ||
image: heartexlabs/label-studio:1.1.0 | ||
id: matlab | ||
name: Matlab | ||
version: r2020b | ||
description: MATLAB is a programming platform designed for engineers and scientists. The MATLAB Deep Learning Container provides algorithms, pretrained models, and apps to create, train, visualize, and optimize deep neural networks. | ||
docLink: https://ngc.nvidia.com/catalog/containers/partners:matlab/tags | ||
image: nvcr.io/partners/matlab:r2020b | ||
id: mlflow | ||
name: MLflow | ||
version: v1.9.1 | ||
description: MLflow is an open source platform to manage the ML lifecycle, including experimentation, reproducibility, deployment, and a central model registry. | ||
docLink: https://www.mlflow.org/docs/1.9.1/index.html | ||
image: larribas/mlflow:1.9.1 | ||
id: streamlit | ||
name: Streamlit | ||
version: v0.79.0 | ||
description: Streamlit turns data scripts into shareable web apps in minutes. All in Python. All for free. No front‑end experience required. | ||
docLink: https://docs.primehub.io/docs/primehub-app-builtin-streamlit | ||
image: infuseai/streamlit:v0.79.0 | ||
``` | ||
|
||
You could get one of them with `get` action and the id of a template: | ||
|
||
``` | ||
primehub apptemplates get code-server | ||
``` | ||
|
||
|
||
``` | ||
id: code-server | ||
name: Code Server | ||
version: v3.9.2 | ||
description: Run VS Code on any machine anywhere and access it in the browser. | ||
docLink: https://github.com/cdr/code-server | ||
image: codercom/code-server:3.9.2 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.