-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
73 lines (58 loc) · 2 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
.PHONY: create-cluster drop-cluster helm-install helm-uninstall helm-reinstall helm-deps-up validate-k-env
SHELL := /bin/bash
CLUSTER_NAME ?= tensorleap
NAME_SPACE ?= tensorleap
validate-k-env:
[[ -x "$$(command -v kubectx)" && "$$(kubectx --current)" == 'k3d-tensorleap' ]]
[[ -x "$$(command -v kubens)" && "$$(kubens --current)" == 'tensorleap' ]]
cluster-create:
k3d cluster create ${CLUSTER_NAME} --config ./config/k3d-config.yaml
cluster-del: validate-k-env
k3d cluster delete ${CLUSTER_NAME}
helm-install: validate-k-env
helm upgrade --install ${CLUSTER_NAME} ./charts/tensorleap -n ${NAME_SPACE}
helm-uninstall: validate-k-env
helm uninstall ${CLUSTER_NAME} -n ${NAME_SPACE}
helm-reinstall: helm-uninstall helm-install
helm-deps-up: validate-k-env
helm dependency update ./charts/tensorleap -n ${NAME_SPACE}
.PHONY: lint
lint:
@golangci-lint run
.PHONY: fmt
fmt:
@gofmt -w -l ./
create_go_tag:
git tag -a $$(go run . --version) -m"$$(go run . --version)"
.PHONY: check-fmt
check-fmt:
@echo "Checking code formatting..."
@result=$$(gofmt -l ./); \
if [ -n "$$result" ]; then \
echo "Formatting issues found:"; \
echo "$$result"; \
exit 1; \
fi
.PHONY: test
test:
@go test ./...
# This code run helm template on charts and extracts all image names by simple search of image: [image-name]
.PHONY: update-images
update-images:
(helm template ./charts/tensorleap-infra --set nvidiaGpu.enabled=true && helm template ./charts/tensorleap) \
| grep 'image: ' \
| sed 's/.*: //' \
| sed 's/\"//g' \
| sort \
| uniq > images.txt
.PHONY: build-helm
build-helm:
helm repo add nginx https://kubernetes.github.io/ingress-nginx
helm repo add elastic https://helm.elastic.co
helm repo add minio https://charts.min.io
helm repo add codecentric https://codecentric.github.io/helm-charts
helm repo add datadog https://helm.datadoghq.com
helm dependency build ./charts/tensorleap
rm ./charts/tensorleap/Chart.lock
helm dependency build ./charts/tensorleap-infra
rm ./charts/tensorleap-infra/Chart.lock