Deploy Marketplace version v1.4.0 and later
Note: This document suits for openpaimarketplace version v1.4.0 and later, and pai version v1.4.0 and later.
To deploy OpenPAI Marketplace, you need to prepare three parts when deploying Marketplace: database, rest server and webportal.
Deployment steps
When deploying in OpenPAI cluster, you should deploy 3 services: marketplace-db, marketplace-restserver and marketplace-webportal. The deployment process of these 3 services are the same as deploying other pai services (like webportal and rest-server). The documentation of how to deploy a PAI service is located in this page and in PAI Service Management and Paictl section. Here we just figure out some main points about how to deploy these 3 marketplace services.
Firstly, start a dev-box and prepare a pai cluster config file service-configuration.yaml (please refer to pai doc how to get this file), and add some extra configurations in this file. Including: cluster, marketplace-db, marketplace-restserver, marketplace-webportal properties, the following steps will give the details how to add these configs.
Then, push the new pai config file service-configuration.yaml to the cluster and start 3 services marketplace-db marketplace-restserver marketplace-webportal.
If the 3 services are started successfully, edit webportal plugin config in service-configuration.yaml file and push this file to cluster again and then restart pai webportal. Alternatively, if you are sure about the url of service marketplace-webportal, you could directly start OpenPAI webportal with webportal plugin config before the marketplace related services are started. When marketplace-webportal is started successfully, you could directly access marketplace plugin in the sidebar. Belowed are the detailed steps:
- Add marketplace related configs in service-configuration.yaml, including
cluster.common.marketplace, marketplace-db, marketplace-restserver, marketplace-webportal and webportal.pluginsproperties.
```
cluster: common: marketplace: 'true'
marketplace-db:
user:
marketplace-restserver:
db_user:
marketplace-webportal:
marketplace_api_uri: https://
webportal:
plugins:
- id: marketplace
title: Marketplace
uri: https://
```
TODO: does the file value correctly and indicate properties required or optional
-
cluster.common.marketplace: this config is the switch of marketplace, if this value is set true, marketplace will be enabled in OpenPAI, if this value is false or not set, marketplace will be disabled in OpenPAI. -
marketplace-db: includinguser, passwd and data-pathvalues. These values controls the basic info of postgresql database marketplace used. -
marketplace-restserver: includingdb_user, db_password and azure_storage. These values are used when starting Marketplace rest server. The first two values should be aligned with values set inmarketplace-db. The last valueazure_storageis not required, if this value exists, rest server will initialize it into database as an available azure blob storage. -
marketplace-webportal.marketplace_api_uri: this value is set with Marketplace rest server api url. If OpenPAI webportal url ishttps://xxx, marketplace_api_uri should be set ashttps://<openpai_cluster_ip>/marketplace/api. If OpenPAI webpoortal url ishttp://xxx, then marketplace_api_uri should be set ashttp://<master_node_ip>:<9292>. -
webportal.plugins: this value is used in OpenPAI webportal, set with the marketplace webportal plugin url when marketplace-webportal service successfully started. Same asmarketpalce_api_uri, if OpenPAI webportal url ishttps://xxx, marketplace_api_uri could be set ashttps://<openpai_cluster_ip>/marketplace/plugin.js. If OpenPAI webportal url ishttp://xxx, then marketplace_api_uri should be set ashttp://<master_node_ip>:<9293>/plugin.js. -
After the pai config file service-configuration.yaml are edited correctly, push config file to update the cluster config using command
./paictl.py config push -p <config-folder> -m service. -
Start marketplace services in OpenPAI:
./paictl.py service start -n marketplace-db marketplace-restserver marketplace-webportal`.
- Make sure
webportal.pluginsis set correctly, then restart OpenPAI webportal service:
./paictl.py service stop -n webportal`
./paictl.py service start -n webportal`
Notes
-
The marketplace will be deployed to master node in OpenPAI cluster.
-
User can still deploy marketplaces service without set
cluster.common.market: "true", but the OpenPAI cluster will not expose the marketplace uri without this config.