Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

[Deployment] Support to manage a list of services in paictl #3432

Merged
merged 3 commits into from
Aug 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions deployment/serviceCmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,17 @@ def register(self, parser):

def add_arguments(parser):
parser.add_argument("-c", "--kube-config-path", dest="kube_config_path", default="~/.kube/config", help="The path to KUBE_CONFIG file. Default value: ~/.kube/config")
parser.add_argument("-n", "--service-name", dest="service_name", default="all", help="Build and push the target image to the registry")
parser.add_argument("-n", "--service-list", nargs='+', dest="service_list", default=None, help="Service list to manage")

add_arguments(start_parser)
add_arguments(stop_parser)
add_arguments(delete_parser)
add_arguments(refresh_parser)

def process_args(self, args):
if args.kube_config_path != None:
if args.kube_config_path is not None:
args.kube_config_path = os.path.expanduser(args.kube_config_path)

service_list = None
if args.service_name != "all":
service_list = [args.service_name]

return service_list
return args.service_list

def service_start(self, args):
service_list = self.process_args(args)
Expand Down
4 changes: 2 additions & 2 deletions docs/pai-management/doc/how-to-start-pai-serv.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ cd pai

python paictl.py service start \
[ -c ~/.kube/config] \
[ -n service-name ]
[ -n service-list ]
```

If the `-n` parameter is specified, only the given service, e.g. `rest-server`, `webportal`, `watchdog`, etc., will be deployed. If not, all PAI services will be deployed. In the latter case, the above command does the following things:
If the `-n` parameter is specified, only the given services, e.g. `rest-server`, `webportal`, `watchdog`, etc., will be deployed. If not, all PAI services will be deployed. In the latter case, the above command does the following things:

- Generate Kubernetes-related configuration files based on `layout.yaml`.

Expand Down
4 changes: 2 additions & 2 deletions docs/pai-management/doc/validate-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ If the `-n` parameter is specified, only the given image, e.g. `rest-server`, `w
```bash
python paictl.py service stop \
[ -c /path/to/kubeconfig ] \
[ -n service-name ]
[ -n service-list ]
```

If the -n parameter is specified, only the given service, e.g. rest-server, webportal, watchdog, etc., will be stopped. If not, all PAI services will be stopped.
If the -n parameter is specified, only the given services, e.g. rest-server, webportal, watchdog, etc., will be stopped. If not, all PAI services will be stopped.

2. ```Boot up single all OpenPAI services.```

Expand Down
28 changes: 14 additions & 14 deletions docs/paictl/paictl-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ A tool to manage your pai cluster.
### Set external storage configuration to k8s <a name="External_Set"></a>

```
python paictl.py config external-config-update -e external-config [ -c kube-config ]
python paictl.py config external-config-update -e external-config [ -c kube-config ]
```

- External storage is responsible for storing your cluster configuration. And it is not a part of OpenPai's service. Now OpenPai supports 2 method to integrate.
- git: Admin could manage their cluster configuration with git such as VSTS, Github or Gitlab. Of course, you could setup your own git server.
- local: If you don't have a git repo to manage your cluster configuration, you can store it in the local disk.
- git: Admin could manage their cluster configuration with git such as VSTS, Github or Gitlab. Of course, you could setup your own git server.
- local: If you don't have a git repo to manage your cluster configuration, you can store it in the local disk.

- External storage configuration
```yaml
Expand All @@ -50,7 +50,7 @@ url: https://github.com/example/example
branch: example_branch
# relative path in the project source code
path: a/b/c
```
```
```yaml
##################
# Local storage. #
Expand All @@ -68,11 +68,11 @@ path: /a/b/c
python paictl.py config generate -i /pai/deployment/quick-start/quick-start/quick-start.yaml -o ~/pai-config -f
```
- quick-start.yaml: Admin could generate a complete cluster configuration with quick-start.yaml. More detailed about this file please refer to this [link](../pai-management/doc/how-to-generate-cluster-config.md).
- More infomation about this command please refer to this [link](../pai-management/doc/how-to-generate-cluster-config.md).
- More infomation about this command please refer to this [link](../pai-management/doc/how-to-generate-cluster-config.md).
- By default, in the generated configuration, a single-master Kubernetes is configured by default.
- Advanced users or developers can fine-tune the content of the generated configuration files according to specific environments.

### Push the cluster configuration in the k8s <a name="Config_Push"></a>
### Push the cluster configuration in the k8s <a name="Config_Push"></a>

###### 1. Push cluster configuration from local path

Expand Down Expand Up @@ -140,39 +140,39 @@ python paictl.py machine etcd-fix -p /path/to/cluster-configuration/dir -l machi
### Start service(s) <a name="Service_Start"></a>

```
python paictl.py service start [-c /path/to/kubeconfig] [ -n service-name ]
python paictl.py service start [-c /path/to/kubeconfig] [ -n service-list ]
```

1) Start all services by default.
2) If the option `-n` is set, only the specified service will be started.
2) If the option `-n` is set, only the specified services will be started.

### Stop service(s) <a name="Service_Stop"></a>

```
python paictl.py service stop [-c /path/to/kubeconfig] [ -n service-name ]
python paictl.py service stop [-c /path/to/kubeconfig] [ -n service-list ]
```

- Stop all services by default.
- If the option `-n` is set, only the specified service will be stopped.
- If the option `-n` is set, only the specified services will be stopped.

### Delete service(s) <a name="Service_Delete"></a>

```
python paictl.py service delete [-c /path/to/kubeconfig] [ -n service-name ]
python paictl.py service delete [-c /path/to/kubeconfig] [ -n service-list ]
```

- 'Delete' a service means to stop that service and then delete all of its persisted data in HDFS, Yarn, ZooKeeper, etc.
- Delete all services by default.
- If the option `-n` is set, only the specified service will be deleted.
- If the option `-n` is set, only the specified services will be deleted.

### Refresh service(s) <a name="Service_Refresh"></a>

```
python paictl.py service refresh [-c /path/to/kubeconfig] [ -n service-name ]
python paictl.py service refresh [-c /path/to/kubeconfig] [ -n service-list ]
```

- Refresh all the labels on each node.
- If the option `-n` is set, only the specified service will be upgrade.
- If the option `-n` is set, only the specified services will be upgrade.


## Maintain your cluster <a name="Cluster"></a>
Expand Down
4 changes: 2 additions & 2 deletions docs/zh_CN/pai-management/doc/how-to-start-pai-serv.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ cd pai

python paictl.py service start \
[ -c ~/.kube/config] \
[ -n service-name ]
[ -n service-list ]
```

If the `-n` parameter is specified, only the given service, e.g. `rest-server`, `webportal`, `watchdog`, etc., will be deployed. If not, all PAI services will be deployed. In the latter case, the above command does the following things:
If the `-n` parameter is specified, only the given services, e.g. `rest-server`, `webportal`, `watchdog`, etc., will be deployed. If not, all PAI services will be deployed. In the latter case, the above command does the following things:

- Generate Kubernetes-related configuration files based on `layout.yaml`.

Expand Down
24 changes: 12 additions & 12 deletions docs/zh_CN/pai-management/doc/validate-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
### Index:

- [1 Drivers](#gpu_check)

- [1.1 Check Drivers service's log](#drivers_log)

- [2.1 Check Drivers version](#drivers_version)

- [2 Data path check](#datapath_check)

- [3 Admin Account in Webportal](#admin_check)

- [4 Troubleshooting OpenPAI services](#troubleshooting_4)

- [4.1 Diagnosing the problem](#troubleshooting_4.1)

- [4.2 Fix problem](#troubleshooting_4.2)

- [4.3 Reboot service](#troubleshooting_4.3)

- [5 Troubleshooting Kubernetes Clusters](#troubleshooting_5)
Expand All @@ -50,7 +50,7 @@
Dashboard:

http://<master>:9090


search driver, view driver status

Expand Down Expand Up @@ -114,7 +114,7 @@ hadooptmp hdfs launcherlogs prometheus yarn zoodata
Dashboard:

http://<master>:9286/virtual-clusters.html


try to login:

Expand All @@ -133,7 +133,7 @@ Note: The username and password are configured in the ```service-configuraiton.y
Dashboard:

http://<master>:9090


![PAI_deploy_log](./images/PAI_deploy_pod.png)

Expand Down Expand Up @@ -175,14 +175,14 @@ Check and refine 4 yaml files:
- kubernetes-configuration.yaml
- k8s-role-definition.yaml
- serivices-configuration.yaml


- Customize config for specific service

If user want to customize single service, you could find service config file at [src](../../../../src) and find image dockerfile at [src](../../../../src).

- Update Code & Image

- Customize image dockerfile or code

User could find service's image dockerfile at [src](../../../../src) and customize them.
Expand Down Expand Up @@ -212,10 +212,10 @@ If the `-n` parameter is specified, only the given image, e.g. `rest-server`, `w
```bash
python paictl.py service stop \
[ -c /path/to/kubeconfig ] \
[ -n service-name ]
[ -n service-list ]
```

If the -n parameter is specified, only the given service, e.g. rest-server, webportal, watchdog, etc., will be stopped. If not, all PAI services will be stopped.
If the -n parameter is specified, only the given services, e.g. rest-server, webportal, watchdog, etc., will be stopped. If not, all PAI services will be stopped.

2. Boot up single all OpenPAI services.

Expand Down
Loading