Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Project-HAMi/dcu-vgpu-device-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
archlitchi committed Jan 13, 2025
2 parents 833c151 + 2165b49 commit 114c048
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,32 @@ The flow of vDCU job is as follows:
* This plugin targets Kubernetes v1.18+.

## Deployment

### Prepare
```bash
# on the dcu node, create these directory:
$ mkdir /etc/vdev
```
```bash
# should change dtk-xx.xx.x to your installed dtk version
$ cp -r /opt/dtk-xx.xx.x /opt/dtk
```

```bash
$ kubectl apply -f k8s-dcu-rbac.yaml
$ kubectl apply -f k8s-dcu-plugin.yaml
# replace NODE_NAME with your dcu node name
$ kubectl label node NODE_NAME dcu=on
```

## Build
```
```bash
docker build .
```

## Examples

```
```yaml
apiVersion: v1
kind: Pod
metadata:
Expand All @@ -53,13 +66,13 @@ spec:
Inside container, use hy-virtual to validate
```
```bash
source /opt/hygondriver/env.sh
hy-virtual -show-device-info
```

There will be output like these:
```
```bash
Device 0:
Actual Device: 0
Compute units: 9
Expand Down
2 changes: 2 additions & 0 deletions k8s-dcu-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ spec:
serviceAccountName: dcu-device-plugin
hostPID: true
hostNetwork: true
nodeSelector:
dcu: "on"
tolerations:
- key: CriticalAddonsOnly
operator: Exists
Expand Down

0 comments on commit 114c048

Please # to comment.