Skip to content

Commit 6e9df24

Browse files
authored
Merge pull request #48 from Project-HAMi/fix_ci
update_CI and delete go mod tidy to avoid error
2 parents 9c0ed26 + 00d1017 commit 6e9df24

5 files changed

Lines changed: 32 additions & 19 deletions

File tree

.github/workflows/dev.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: CI
55

66
on:
7-
pull_request_target:
7+
pull_request:
88
branches: [ "main" ]
99

1010
env:
@@ -16,6 +16,9 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.pull_request.head.sha }}
21+
submodules: true
1922
- uses: actions/setup-go@v5
2023
with:
2124
go-version: ${{ env.GO_VERSION }}
@@ -32,7 +35,10 @@ jobs:
3235
runs-on: ubuntu-latest
3336
steps:
3437
- uses: actions/checkout@v4
35-
38+
with:
39+
ref: ${{ github.event.pull_request.head.sha }}
40+
submodules: true
41+
3642
- name: Get branch names.
3743
id: branch-names
3844
uses: tj-actions/branch-names@v8
@@ -43,16 +49,16 @@ jobs:
4349
- name: Set up Docker Buildx
4450
uses: docker/setup-buildx-action@v3
4551

46-
- name: Docker Login
47-
uses: docker/login-action@v3.1.0
48-
with:
49-
username: ${{ secrets.DOCKERHUB_TOKEN }}
50-
password: ${{ secrets.DOCKERHUB_PASSWD }}
52+
#- name: Docker Login
53+
# uses: docker/login-action@v3.1.0
54+
# with:
55+
# username: ${{ secrets.DOCKERHUB_TOKEN }}
56+
# password: ${{ secrets.DOCKERHUB_PASSWD }}
5157

5258
- name: Build and push
5359
uses: docker/build-push-action@v6
5460
with:
55-
platforms: linux/amd64,linux/arm64
61+
platforms: linux/amd64
5662
push: false
5763
build-args: |
5864
BASE_IMAGE=ubuntu:20.04

.github/workflows/go.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v4
25+
with:
26+
ref: ${{ github.event.pull_request.head.sha }}
27+
submodules: true
2528
- uses: actions/setup-go@v5
2629
with:
2730
go-version: ${{ env.GO_VERSION }}
@@ -38,6 +41,9 @@ jobs:
3841
runs-on: ubuntu-latest
3942
steps:
4043
- uses: actions/checkout@v4
44+
with:
45+
ref: ${{ github.event.pull_request.head.sha }}
46+
submodules: true
4147

4248
- name: Get branch names.
4349
id: branch-names

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ ENV GOPATH=/go
1212
ARG VERSION
1313
WORKDIR /build
1414
ADD . .
15-
RUN --mount=type=cache,target=/go/pkg/mod \
16-
make all
15+
RUN go mod download github.com/Project-HAMi/HAMi
16+
RUN go get github.com/Project-HAMi/ascend-device-plugin/internal/server
17+
RUN make all
1718

1819
FROM $BASE_IMAGE
1920
ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64:/usr/local/Ascend/driver/lib64/driver:/usr/local/Ascend/driver/lib64/common

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ docker:
1414
--build-arg GOPROXY=https://goproxy.cn,direct \
1515
-t ${IMG_NAME}:${VERSION} .
1616

17-
lint: tidy
17+
lint:
1818
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
1919
golangci-lint run
2020

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

2424
clean:

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,13 @@ To exclusively use an entire card or request multiple cards, you only need to se
6565
huawei.com/Ascend910B-memory: "4096"
6666
```
6767
68+
For more examples, see [examples](./examples/)
6869
69-
## License
70-
[![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)
71-
For more examples, see [examples](./examples/)
72-
73-
### Usage in volcano
70+
### Usage in volcano
7471
75-
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)
72+
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)
7673
77-
```yaml
74+
```yaml
7875
apiVersion: v1
7976
kind: Pod
8077
metadata:
@@ -91,3 +88,6 @@ spec:
9188
huawei.com/Ascend310P: "1"
9289
huawei.com/Ascend310P-memory: "4096"
9390
```
91+
92+
## License
93+
[![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)

0 commit comments

Comments
 (0)