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

Commit

Permalink
dedicated vc management tool
Browse files Browse the repository at this point in the history
  • Loading branch information
mzmssg committed Jun 12, 2019
1 parent 7db0a94 commit 7e958cd
Show file tree
Hide file tree
Showing 22 changed files with 2,585 additions and 138 deletions.
56 changes: 56 additions & 0 deletions docs/tools/dedicated_vc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# dedicated_vc

## Overview

Unlike shared virtual cluster sharing whole cluster resource, dedicated vc is bound to specific nodes.
"Dedicated" here is bidirectional, in other words, dedicated vc could only use bound nodes,
and these node could only be used by this vc.
Noticed that dedicated resource will be excluded from shared resource.
shared_vc_resource = (whole_resource - dedicated_resource) * shared_vc_capacity

This doc introduces how to configure dedicated vc, currently we provide only cmdline tool for it.

## Commands

We provide get, add and remove dedicate vc in the node_maintain.py, working directory is pai/src/tools.
```bash
python node_maintain.py dedicated-vc {get,add,remove}
```

### Get dedicated-vc

```bash
python node_maintain.py dedicated-vc get -m {master_ip}
```
This command output dedicated vc name, nodes and total resource, as below:
```
dedicated_1:
Nodes:
Resource: <CPUs:0.0, Memory:0.0MB, GPUs:0.0>
dedicated_2:
Nodes: 10.0.0.1
Resource: <CPUs:24.0, Memory:208896.0MB, GPUs:4.0>
```


### Add dedicated-vc

```bash
python node_maintain.py dedicated-vc add -m {master_ip} -v {added_vc_name} [-n {added_nodes}]
```
This command added {added_nodes} to {added_vc_name}, if {added_vc_name} doesn't exist, it will be created firstly.

Added resource will be subtracted from default vc.

### Remove dedicated-vc

```bash
python node_maintain.py dedicated-vc remove -m {master_ip} -v {removed_vc_name} [-n {removed_nodes}]
```
This command delete {removed_nodes} from {removed_vc_name}, if omit {removed_nodes}, it will delete whole vc.

Deleted resource will be back to default vc




2 changes: 1 addition & 1 deletion src/dev-box/build/dev-box.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RUN apt-get -y update && \
net-tools && \
mkdir -p /cluster-configuration &&\
git clone https://github.com/Microsoft/pai.git &&\
pip install python-etcd docker kubernetes GitPython jsonschema
pip install python-etcd docker kubernetes GitPython jsonschema attrs dicttoxml beautifulsoup4

WORKDIR /tmp

Expand Down
Loading

0 comments on commit 7e958cd

Please sign in to comment.