Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
92 lines (81 loc) · 3.89 KB
/
Copy pathMakefile
File metadata and controls
92 lines (81 loc) · 3.89 KB
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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
.PHONY: all core jvm test clean rat release bench print-benchmark-args
define spark_jvm_17_extra_args
$(shell ./mvnw help:evaluate -q -DforceStdout -Dexpression=extraJavaTestArgs $(PROFILES))
endef
# Build optional Comet native features (like hdfs-opendal e.g)
FEATURES_ARG := $(shell ! [ -z $(COMET_FEATURES) ] && echo '--features=$(COMET_FEATURES)')
# JVM max heap for the benchmark targets. Lower this when benchmarking on a
# machine with less memory, for example BENCH_HEAP=8g on a 16 GiB instance.
BENCH_HEAP ?= 20g
# How a benchmark suite is invoked. benchmarks/micro/run.py reads these through
# `print-benchmark-args` rather than restating them, because it runs many suites
# against one build and so cannot use the benchmark-% target, whose `release`
# prerequisite would rebuild before each one.
BENCH_MAVEN_OPTS = -Xmx$(BENCH_HEAP) ${call spark_jvm_17_extra_args}
BENCH_MVN_ARGS = exec:java -Dexec.classpathScope=test -Dexec.cleanupDaemonThreads=false
all: core jvm
core:
cd native && cargo build $(FEATURES_ARG)
test-rust:
# We need to compile CometException so that the cargo test can pass
./mvnw compile -pl common -DskipTests $(PROFILES)
cd native && cargo build $(FEATURES_ARG) && \
RUST_BACKTRACE=1 cargo test $(FEATURES_ARG)
jvm:
./mvnw clean package -DskipTests $(PROFILES)
test-jvm: core
SPARK_HOME=`pwd` COMET_CONF_DIR=$(shell pwd)/conf RUST_BACKTRACE=1 ./mvnw verify $(PROFILES)
test: test-rust test-jvm
clean:
cd native && cargo clean
./mvnw clean $(PROFILES)
rm -rf .dist
rat:
./dev/release/check-rat.sh HEAD
bench:
cd native && RUSTFLAGS="-Ctarget-cpu=native" cargo bench $(FEATURES_ARG) $(filter-out $@,$(MAKECMDGOALS))
format:
@if command -v prettier >/dev/null 2>&1; then \
prettier -w "**/*.md"; \
else \
echo "prettier not found, skipping markdown formatting (npm i -g prettier)"; \
fi
cd native && cargo fmt
./mvnw compile test-compile scalafix:scalafix -Psemanticdb $(PROFILES)
./mvnw spotless:apply $(PROFILES)
# build native libs for amd64 architecture Linux on a Linux/amd64 machine/container
core-amd64-libs:
cd native && RUSTFLAGS="-Ctarget-cpu=x86-64-v3" cargo build --release $(FEATURES_ARG)
# build native libs for arm64 architecture Linux on a Linux/arm64 machine/container
core-arm64-libs:
cd native && RUSTFLAGS="-Ctarget-cpu=neoverse-n1" cargo build --release $(FEATURES_ARG)
release:
cd native && RUSTFLAGS="$(RUSTFLAGS) -Ctarget-cpu=native" cargo build --release $(FEATURES_ARG)
./mvnw install -Prelease -DskipTests $(PROFILES)
release-nogit:
cd native && RUSTFLAGS="-Ctarget-cpu=native" cargo build --release
./mvnw install -Prelease -DskipTests $(PROFILES) -Dmaven.gitcommitid.skip=true
benchmark-%: release
cd spark && COMET_CONF_DIR=$(shell pwd)/conf MAVEN_OPTS='$(BENCH_MAVEN_OPTS)' ../mvnw $(BENCH_MVN_ARGS) -Dexec.mainClass="$*" -Dexec.args="$(filter-out $@,$(MAKECMDGOALS))" $(PROFILES)
# Emit the benchmark invocation as KEY=VALUE lines for benchmarks/micro/run.py.
print-benchmark-args:
@echo 'MAVEN_OPTS=$(BENCH_MAVEN_OPTS)'
@echo 'MVN_ARGS=$(BENCH_MVN_ARGS)'
.DEFAULT:
@: # ignore arguments provided to benchmarks e.g. "make benchmark-foo -- --bar", we do not want to treat "--bar" as target