forked from kubeflow/katib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (72 loc) · 2.74 KB
/
Makefile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
HAS_LINT := $(shell command -v golangci-lint;)
COMMIT := v1beta1-$(shell git rev-parse --short=7 HEAD)
KATIB_REGISTRY := docker.io/kubeflowkatib
# Run tests
.PHONY: test
test:
go test ./pkg/... ./cmd/... -coverprofile coverage.out
check: generate fmt vet lint
fmt:
hack/verify-gofmt.sh
lint:
ifndef HAS_LINT
go install github.com/golangci/golangci-lint/cmd/[email protected]
echo "golangci-lint has been installed"
endif
hack/verify-golangci-lint.sh
vet:
go vet ./pkg/... ./cmd/...
update:
hack/update-gofmt.sh
# Deploy Katib v1beta1 manifests using Kustomize into a k8s cluster.
deploy:
bash scripts/v1beta1/deploy.sh
# Undeploy Katib v1beta1 manifests using Kustomize from a k8s cluster
undeploy:
bash scripts/v1beta1/undeploy.sh
# Run this if you update any existing controller APIs.
# 1. Genereate deepcopy, clientset, listers, informers for the APIs (hack/update-codegen.sh)
# 2. Generate open-api for the APIs (hack/update-openapigen)
# 3. Generate Python SDK for Katib (hack/gen-python-sdk/gen-sdk.sh)
# 4. Generate gRPC manager APIs (pkg/apis/manager/v1beta1/build.sh and pkg/apis/manager/health/build.sh)
generate:
ifndef GOPATH
$(error GOPATH not defined, please define GOPATH. Run "go help gopath" to learn more about GOPATH)
endif
go generate ./pkg/... ./cmd/...
hack/gen-python-sdk/gen-sdk.sh
cd ./pkg/apis/manager/v1beta1 && ./build.sh
cd ./pkg/apis/manager/health && ./build.sh
# Build images for the Katib v1beta1 components.
build: generate
ifeq ($(and $(REGISTRY),$(TAG)),)
$(error REGISTRY and TAG must be set. Usage: make build REGISTRY=<registry> TAG=<tag>)
endif
bash scripts/v1beta1/build.sh $(REGISTRY) $(TAG)
# Build and push Katib images from the latest master commit.
push-latest: generate
bash scripts/v1beta1/build.sh $(KATIB_REGISTRY) latest
bash scripts/v1beta1/build.sh $(KATIB_REGISTRY) $(COMMIT)
bash scripts/v1beta1/push.sh $(KATIB_REGISTRY) latest
bash scripts/v1beta1/push.sh $(KATIB_REGISTRY) $(COMMIT)
# Build and push Katib images for the given tag.
push-tag: generate
ifeq ($(TAG),)
$(error TAG must be set. Usage: make push-tag TAG=<release-tag>)
endif
bash scripts/v1beta1/build.sh $(KATIB_REGISTRY) $(TAG)
bash scripts/v1beta1/build.sh $(KATIB_REGISTRY) $(COMMIT)
bash scripts/v1beta1/push.sh $(KATIB_REGISTRY) $(TAG)
bash scripts/v1beta1/push.sh $(KATIB_REGISTRY) $(COMMIT)
# Release a new version of Katib.
release:
ifeq ($(and $(BRANCH),$(TAG)),)
$(error BRANCH and TAG must be set. Usage: make release BRANCH=<branch> TAG=<tag>)
endif
bash scripts/v1beta1/release.sh $(BRANCH) $(TAG)
# Prettier UI format check for Katib v1beta1.
prettier-check:
npm run format:check --prefix pkg/new-ui/v1beta1/frontend
# Update boilerplate for the source code.
update-boilerplate:
./hack/boilerplate/update-boilerplate.sh