-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (27 loc) · 973 Bytes
/
Makefile
File metadata and controls
38 lines (27 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
BINARY_CLI = kubectl-gpu_top
BINARY_AGENT = kube-gpu-agent
IMAGE_REPO = ghcr.io/jia-gao/kube-gpu-agent
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
.PHONY: all proto build build-cli build-agent test lint clean docker-build docker-push
all: proto build
proto:
protoc --go_out=api/gpuagent --go_opt=paths=source_relative \
--go-grpc_out=api/gpuagent --go-grpc_opt=paths=source_relative \
-I api/proto api/proto/gpuagent.proto
build: build-cli build-agent
build-cli:
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=$(VERSION)" \
-o bin/$(BINARY_CLI) ./cmd/kubectl-gpu-top/
build-agent:
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=$(VERSION)" \
-o bin/$(BINARY_AGENT) ./cmd/kube-gpu-agent/
test:
go test ./... -v
lint:
golangci-lint run
clean:
rm -rf bin/
docker-build:
docker build -t $(IMAGE_REPO):$(VERSION) -f Dockerfile.agent .
docker-push: docker-build
docker push $(IMAGE_REPO):$(VERSION)