forked from kubeflow/katib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (65 loc) · 2.49 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_DEP := $(shell command -v dep;)
HAS_LINT := $(shell command -v golint;)
PREFIX ?= katib
CMD_PREFIX ?= cmd
# Run tests
.PHONY: test
test:
go test ./pkg/... ./cmd/... -coverprofile coverage.out
depend:
ifndef HAS_DEP
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
endif
dep ensure -v
check: fmt vet lint
fmt: depend generate
hack/verify-gofmt.sh
lint: depend generate
ifndef HAS_LINT
go get -u golang.org/x/lint/golint
echo "installing golint"
endif
hack/verify-golint.sh
vet: depend generate
go vet ./pkg/... ./cmd/...
update:
hack/update-gofmt.sh
# Deploy katib v1alpha2 manifests into a k8s cluster
deploy:
bash scripts/v1alpha2/deploy.sh
# Undeploy katib v1alpha2 manifests into a k8s cluster
undeploy:
bash scripts/v1alpha2/undeploy.sh
# Build Katib images for v1alpha1
buildv1alpha1:
bash scripts/v1alpha1/build.sh
# Deploy katib v1alpha1 manifests into a k8s cluster
deployv1alpha1:
bash scripts/v1alpha1/deploy.sh
# Undeploy katib v1alpha1 manifests into a k8s cluster
undeployv1alpha1:
bash scripts/v1alpha1/undeploy.sh
# Generate code
generate:
ifndef GOPATH
$(error GOPATH not defined, please define GOPATH. Run "go help gopath" to learn more about GOPATH)
endif
go generate ./pkg/... ./cmd/...
############################################################
# Build docker image section for v1alpha2
############################################################
images: katib-controller katib-manager katib-manager-rest metrics-collector katib-ui tfevent-metrics-collector suggestion-random
katib-controller: depend generate
docker build -t ${PREFIX}/v1alpha2/katib-controller -f ${CMD_PREFIX}/katib-controller/v1alpha2/Dockerfile .
katib-manager: depend generate
docker build -t ${PREFIX}/v1alpha2/katib-manager -f ${CMD_PREFIX}/manager/v1alpha2/Dockerfile .
katib-manager-rest: depend generate
docker build -t ${PREFIX}/v1alpha2/katib-manager-rest -f ${CMD_PREFIX}/manager-rest/v1alpha2/Dockerfile .
metrics-collector: depend generate
docker build -t ${PREFIX}/v1alpha2/metrics-collector -f ${CMD_PREFIX}/metricscollector/v1alpha2/Dockerfile .
katib-ui: depend generate
docker build -t ${PREFIX}/v1alpha2/katib-ui -f ${CMD_PREFIX}/ui/v1alpha2/Dockerfile .
tfevent-metrics-collector: depend generate
docker build -t ${PREFIX}/v1alpha2/tfevent-metrics-collector -f ${CMD_PREFIX}/tfevent-metricscollector/v1alpha2/Dockerfile .
suggestion-random: depend generate
docker build -t ${PREFIX}/v1alpha2/suggestion-random -f ${CMD_PREFIX}/suggestion/random/v1alpha2/Dockerfile .