forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
150 lines (120 loc) · 5.25 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
export REPOSITORY=flyte
include boilerplate/flyte/end2end/Makefile
include boilerplate/flyte/golang_test_targets/Makefile
define PIP_COMPILE
pip-compile $(1) --upgrade --verbose --resolver=backtracking --annotation-style=line
endef
GIT_VERSION := $(shell git describe --always --tags)
GIT_HASH := $(shell git rev-parse --short HEAD)
TIMESTAMP := $(shell date '+%Y-%m-%d')
PACKAGE ?=github.com/flyteorg/flytestdlib
LD_FLAGS="-s -w -X $(PACKAGE)/version.Version=$(GIT_VERSION) -X $(PACKAGE)/version.Build=$(GIT_HASH) -X $(PACKAGE)/version.BuildTime=$(TIMESTAMP)"
TMP_BUILD_DIR := .tmp_build
.PHONY: cmd/single/dist
cmd/single/dist: export FLYTECONSOLE_VERSION ?= latest
cmd/single/dist:
script/get_flyteconsole_dist.sh
.PHONY: compile
compile: cmd/single/dist
go build -tags console -v -o flyte -ldflags=$(LD_FLAGS) ./cmd/
mv ./flyte ${GOPATH}/bin/ || echo "Skipped copying 'flyte' to ${GOPATH}/bin"
.PHONY: linux_compile
linux_compile: cmd/single/dist
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags console -v -o /artifacts/flyte -ldflags=$(LD_FLAGS) ./cmd/
.PHONY: update_boilerplate
update_boilerplate:
@boilerplate/update.sh
.PHONY: helm
helm: ## Generate K8s Manifest from Helm Charts.
bash script/generate_helm.sh
make -C docker/sandbox-bundled manifests
.PHONY: release_automation
release_automation:
mkdir -p release
bash script/release.sh
bash script/generate_config_docs.sh
$(MAKE) -C docker/sandbox-bundled manifests
.PHONY: deploy_sandbox
deploy_sandbox:
bash script/deploy.sh
.PHONY: install-piptools
install-piptools: ## Install pip-tools
pip install -U pip-tools
.PHONY: install-conda-lock
install-conda-lock:
pip install conda-lock
.PHONY: conda-lock
conda-lock: install-conda-lock
conda-lock -f monodocs-environment.yaml --without-cuda \
--lockfile monodocs-environment.lock.yaml \
--platform=osx-64 --platform=osx-arm64 --platform=linux-64
.PHONY: stats
stats:
@generate-dashboard -o deployment/stats/prometheus/flytepropeller-dashboard.json stats/flytepropeller.dashboard.py
@generate-dashboard -o deployment/stats/prometheus/flyteadmin-dashboard.json stats/flyteadmin.dashboard.py
@generate-dashboard -o deployment/stats/prometheus/flyteuser-dashboard.json stats/flyteuser.dashboard.py
.PHONY: prepare_artifacts
prepare_artifacts:
bash script/prepare_artifacts.sh
.PHONE: helm_update
helm_update: ## Update helm charts' dependencies.
helm dep update ./charts/flyte/
.PHONY: helm_install
helm_install: ## Install helm charts
helm install flyte --debug ./charts/flyte -f ./charts/flyte/values.yaml --create-namespace --namespace=flyte
.PHONY: helm_upgrade
helm_upgrade: ## Upgrade helm charts
helm upgrade flyte --debug ./charts/flyte -f ./charts/flyte/values.yaml --create-namespace --namespace=flyte
# Used in CI
.PHONY: docs
docs:
make -C docs clean html SPHINXOPTS=-W
$(TMP_BUILD_DIR):
mkdir $@
$(TMP_BUILD_DIR)/conda-lock-image: docs/Dockerfile.conda-lock | $(TMP_BUILD_DIR)
docker buildx build --load --platform=linux/amd64 --build-arg USER_UID=$$(id -u) --build-arg USER_GID=$$(id -g) -t flyte-conda-lock:latest -f docs/Dockerfile.conda-lock .
touch $(TMP_BUILD_DIR)/conda-lock-image
monodocs-environment.lock.yaml: monodocs-environment.yaml $(TMP_BUILD_DIR)/conda-lock-image
docker run --platform=linux/amd64 --rm --pull never -v ./:/flyte flyte-conda-lock:latest lock --file monodocs-environment.yaml --lockfile monodocs-environment.lock.yaml
$(TMP_BUILD_DIR)/dev-docs-image: docs/Dockerfile.docs monodocs-environment.lock.yaml | $(TMP_BUILD_DIR)
docker buildx build --load --platform=linux/amd64 --build-arg USER_UID=$$(id -u) --build-arg USER_GID=$$(id -g) -t flyte-dev-docs:latest -f docs/Dockerfile.docs .
touch $(TMP_BUILD_DIR)/dev-docs-image
# Build docs in docker container for local development
.PHONY: dev-docs
dev-docs: $(TMP_BUILD_DIR)/dev-docs-image
bash script/local_build_docs.sh
.PHONY: help
help: SHELL := /bin/sh
help: ## List available commands and their usage
@awk 'BEGIN {FS = ":.*?##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST)
.PHONY: setup_local_dev
setup_local_dev: ## Sets up k3d cluster with Flyte dependencies for local development
@bash script/setup_local_dev.sh
# This builds the flyte binary image for whatever architecture you're on. Don't push this image to the official
# registry because we need those to be multi-arch.
.PHONY: build_native_flyte
build_native_flyte: FLYTECONSOLE_VERSION := latest
build_native_flyte:
docker build \
--build-arg FLYTECONSOLE_VERSION=$(FLYTECONSOLE_VERSION) \
--tag flyte-binary:native .
.PHONY: go-tidy
go-tidy:
go mod tidy
make -C datacatalog go-tidy
make -C flyteadmin go-tidy
make -C flyteidl go-tidy
make -C flytepropeller go-tidy
make -C flyteplugins go-tidy
make -C flytestdlib go-tidy
make -C flytecopilot go-tidy
.PHONY: lint-helm-charts
lint-helm-charts:
# This pressuposes that you have act installed
act pull_request -W .github/workflows/validate-helm-charts.yaml --container-architecture linux/amd64 -e charts/event.json
.PHONY: spellcheck
spellcheck:
act pull_request --container-architecture linux/amd64 -W .github/workflows/codespell.yml
.PHONY: clean
clean: ## Remove the HTML files related to the Flyteconsole and Makefile
rm -rf cmd/single/dist .tmp_build