Skip to content
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
22 changes: 14 additions & 8 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: CI

on:
pull_request_target:
pull_request:
branches: [ "main" ]

env:
Expand All @@ -16,6 +16,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
Expand All @@ -32,7 +35,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true

- name: Get branch names.
id: branch-names
uses: tj-actions/branch-names@v8
Expand All @@ -43,16 +49,16 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker Login
uses: docker/login-action@v3.1.0
with:
username: ${{ secrets.DOCKERHUB_TOKEN }}
password: ${{ secrets.DOCKERHUB_PASSWD }}
#- name: Docker Login
# uses: docker/login-action@v3.1.0
# with:
# username: ${{ secrets.DOCKERHUB_TOKEN }}
# password: ${{ secrets.DOCKERHUB_PASSWD }}

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
push: false
build-args: |
BASE_IMAGE=ubuntu:20.04
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
Expand All @@ -38,6 +41,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true

- name: Get branch names.
id: branch-names
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ ENV GOPATH=/go
ARG VERSION
WORKDIR /build
ADD . .
RUN --mount=type=cache,target=/go/pkg/mod \
make all
RUN go mod download github.com/Project-HAMi/HAMi
RUN go get github.com/Project-HAMi/ascend-device-plugin/internal/server
RUN make all

FROM $BASE_IMAGE
ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64:/usr/local/Ascend/driver/lib64/driver:/usr/local/Ascend/driver/lib64/common
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ docker:
--build-arg GOPROXY=https://goproxy.cn,direct \
-t ${IMG_NAME}:${VERSION} .

lint: tidy
lint:
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
golangci-lint run

ascend-device-plugin: tidy
ascend-device-plugin:
$(GO) build $(BUILDARGS) -o ./ascend-device-plugin ./cmd/main.go

clean:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,13 @@ To exclusively use an entire card or request multiple cards, you only need to se
huawei.com/Ascend910B-memory: "4096"
```

For more examples, see [examples](./examples/)

## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FProject-HAMi%2Fascend-device-plugin.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FProject-HAMi%2Fascend-device-plugin?ref=badge_large)
For more examples, see [examples](./examples/)

### Usage in volcano
### Usage in volcano

Volcano must be installed prior to usage, for more information see [here](https://github.com/volcano-sh/volcano/tree/master/docs/user-guide/how_to_use_vnpu.md)
Volcano must be installed prior to usage, for more information see [here](https://github.com/volcano-sh/volcano/tree/master/docs/user-guide/how_to_use_vnpu.md)

```yaml
```yaml
apiVersion: v1
kind: Pod
metadata:
Expand All @@ -91,3 +88,6 @@ spec:
huawei.com/Ascend310P: "1"
huawei.com/Ascend310P-memory: "4096"
```

## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FProject-HAMi%2Fascend-device-plugin.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FProject-HAMi%2Fascend-device-plugin?ref=badge_large)