-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
47 lines (37 loc) · 1.66 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
# RAY_VERSION defines the default version of Ray (used for testing)
RAY_VERSION ?= 2.35.0
# RAY_IMAGE defines the default container image for Ray (used for testing)
RAY_IMAGE ?= quay.io/modh/ray:2.35.0-py39-cu121
##@ Development
DEFAULTS_TEST_FILE := support/defaults.go
.PHONY: defaults
defaults:
$(info Regenerating $(DEFAULTS_TEST_FILE))
@echo "package support" > $(DEFAULTS_TEST_FILE)
@echo "" >> $(DEFAULTS_TEST_FILE)
@echo "// ***********************" >> $(DEFAULTS_TEST_FILE)
@echo "// DO NOT EDIT THIS FILE" >> $(DEFAULTS_TEST_FILE)
@echo "// ***********************" >> $(DEFAULTS_TEST_FILE)
@echo "" >> $(DEFAULTS_TEST_FILE)
@echo "const (" >> $(DEFAULTS_TEST_FILE)
@echo " RayVersion = \"$(RAY_VERSION)\"" >> $(DEFAULTS_TEST_FILE)
@echo " RayImage = \"$(RAY_IMAGE)\"" >> $(DEFAULTS_TEST_FILE)
@echo "" >> $(DEFAULTS_TEST_FILE)
@echo ")" >> $(DEFAULTS_TEST_FILE)
@echo "" >> $(DEFAULTS_TEST_FILE)
gofmt -w $(DEFAULTS_TEST_FILE)
## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
OPENSHIFT-GOIMPORTS ?= $(LOCALBIN)/openshift-goimports
.PHONY: openshift-goimports
openshift-goimports: $(OPENSHIFT-GOIMPORTS) ## Download openshift-goimports locally if necessary.
$(OPENSHIFT-GOIMPORTS): $(LOCALBIN)
test -s $(LOCALBIN)/openshift-goimports || GOBIN=$(LOCALBIN) go install github.com/openshift-eng/openshift-goimports@latest
.PHONY: imports
imports: openshift-goimports ## Organize imports in go files using openshift-goimports. Example: make imports
$(OPENSHIFT-GOIMPORTS)
.PHONY: verify-imports
verify-imports: openshift-goimports ## Run import verifications.
./hack/verify-imports.sh $(OPENSHIFT-GOIMPORTS)