зеркало из https://github.com/microsoft/pai.git
[Docs] Add docs for protocol and marketplace plugins (#2820)
* Add docs for protocol and marketplace plugins * Rename "Submit Protocol" to "Submit Job v2" * Update travis ci config
This commit is contained in:
Родитель
198eb0d8f9
Коммит
1d9c99df26
|
@ -140,6 +140,12 @@ matrix:
|
|||
|
||||
- language: node_js
|
||||
node_js: lts/dubnium
|
||||
before_install: cd contrib/submit-protocol
|
||||
before_install: cd contrib/submit-job-v2
|
||||
install: yarn --frozen-lockfiles
|
||||
script: yarn build
|
||||
|
||||
- language: node_js
|
||||
node_js: lts/dubnium
|
||||
before_install: cd contrib/marketplace
|
||||
install: yarn --frozen-lockfiles
|
||||
script: yarn build
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
# Marketplace Plugin
|
||||
|
||||
A web portal plugin for marketplace on OpenPAI.
|
||||
|
||||
## Usage
|
||||
|
||||
This plugin is used to browse shared v2 jobs in marketplace. The marketplace can be either public (e.g. public GitHub repo) or private (e.g. private Azure DevOps repo).
|
||||
|
||||
User can configure the marketplace with a URI and a token:
|
||||
* GitHub
|
||||
* URI: directory uri of shared marketplace on GitHub, e.g. [OpenPAI marketplace](https://github.com/microsoft/pai/tree/master/marketplace-v2)
|
||||
* token: if the uri needs authentication to read, you need to [create a personal access token on GitHub](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line), then set marketplace token field to `your_github_username:your_personal_access_token`
|
||||
* Azure DevOps
|
||||
* URI: directory uri of shared marketplace on Azure DevOps
|
||||
* token: if the uri needs authentication to read, you need to [create a personal access token on Azure DevOps](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops), then set marketplace token field to `your_devops_username:your_personal_access_token`
|
||||
|
||||
After correct configuration, user can browse all v2 jobs in marketplace, view each job's protocol yaml, or clone and submit a job in marketplace.
|
||||
|
||||
## Build
|
||||
|
||||
```sh
|
||||
git clone https://github.com/Microsoft/pai.git
|
||||
cd pai/contrib/marketplace
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
The built files will be located in `dist/`.
|
||||
|
||||
## Deployment
|
||||
|
||||
Put the built plugin files to a static file server that is accessible by the user.
|
||||
Read [PLUGINS](../../docs/webportal/PLUGINS.md#publish) for details.
|
||||
|
||||
Append the following plugin configuration block to the `webportal.plugins` section of `service-configuration.yaml` file.
|
||||
|
||||
```yaml
|
||||
webportal:
|
||||
plugins:
|
||||
- id: marketplace
|
||||
title: Marketplace
|
||||
uri: # uri of dist/plugin.js
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
```sh
|
||||
git clone https://github.com/Microsoft/pai.git
|
||||
cd pai/contrib/marketplace
|
||||
yarn install
|
||||
yarn start
|
||||
```
|
||||
|
||||
Configure the plugin of webportal env file with the uri `http://localhost:9091/plugin.js`.
|
||||
|
||||
## License
|
||||
|
||||
[MIT License](../../LICENSE)
|
|
@ -49,7 +49,7 @@ class MarketplacePluginElement extends HTMLElement {
|
|||
let submissionId;
|
||||
const plugins = (window as unknown as IWindow).PAI_PLUGINS;
|
||||
for (const i in plugins) {
|
||||
if (plugins[i].id === "protocol") {
|
||||
if (plugins[i].id === "submit-job-v2") {
|
||||
submissionId = i;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
# Submit Job v2 Plugin
|
||||
|
||||
A web portal plugin to submit job v2 on OpenPAI.
|
||||
|
||||
## Usage
|
||||
|
||||
This plugin is used to submit PAI job v2 on web portal.
|
||||
|
||||
User can upload a job v2 yaml file from disk, choose a job v2 from marketplace, or use the submission form to fill in a job v2 config.
|
||||
|
||||
Please refer to [PAI protocol spec](../../docs/pai-job-protocol.yaml) for more details.
|
||||
|
||||
## Build
|
||||
|
||||
```sh
|
||||
git clone https://github.com/Microsoft/pai.git
|
||||
cd pai/contrib/submit-job-v2
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
The built files will be located in `dist/`.
|
||||
|
||||
## Deployment
|
||||
|
||||
Put the built plugin files to a static file server that is accessible by the user.
|
||||
Read [PLUGINS](../../docs/webportal/PLUGINS.md#publish) for details.
|
||||
|
||||
Append the following plugin configuration block to the `webportal.plugins` section of `service-configuration.yaml` file.
|
||||
|
||||
```yaml
|
||||
webportal:
|
||||
plugins:
|
||||
- id: submit-job-v2
|
||||
title: Submit Job v2
|
||||
uri: # uri of dist/plugin.js
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
```sh
|
||||
git clone https://github.com/Microsoft/pai.git
|
||||
cd pai/contrib/submit-job-v2
|
||||
yarn install
|
||||
yarn start
|
||||
```
|
||||
|
||||
Configure the plugin of webportal env file with the uri `http://localhost:9090/plugin.js`.
|
||||
|
||||
## License
|
||||
|
||||
[MIT License](../../LICENSE)
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "submit-protocol",
|
||||
"name": "submit-job-v2",
|
||||
"version": "1.0.0",
|
||||
"description": "A web portal plugin to submit protocol.",
|
||||
"description": "A web portal plugin to submit job v2.",
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"start": "webpack-dev-server --mode=development",
|
Загрузка…
Ссылка в новой задаче