]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/dev/conbench_envs/hooks.sh
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / dev / conbench_envs / hooks.sh
1 #!/usr/bin/env bash
2 #
3 # Licensed to the Apache Software Foundation (ASF) under one
4 # or more contributor license agreements. See the NOTICE file
5 # distributed with this work for additional information
6 # regarding copyright ownership. The ASF licenses this file
7 # to you under the Apache License, Version 2.0 (the
8 # "License"); you may not use this file except in compliance
9 # with the License. You may obtain a copy of the License at
10 #
11 # http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing,
14 # software distributed under the License is distributed on an
15 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 # KIND, either express or implied. See the License for the
17 # specific language governing permissions and limitations
18 # under the License.
19
20
21 ## These hooks are used by benchmark builds
22 # to create a conda env with Arrow dependencies and build Arrow C++, Python, etc
23 create_conda_env_for_benchmark_build() {
24 conda create -y -n "${BENCHMARKABLE_TYPE}" -c conda-forge \
25 --file ci/conda_env_unix.txt \
26 --file ci/conda_env_cpp.txt \
27 --file ci/conda_env_python.txt \
28 --file ci/conda_env_gandiva.txt \
29 compilers \
30 python="${PYTHON_VERSION}" \
31 pandas \
32 aws-sdk-cpp \
33 r
34 }
35
36 activate_conda_env_for_benchmark_build() {
37 conda init bash
38 conda activate "${BENCHMARKABLE_TYPE}"
39 }
40
41 install_arrow_python_dependencies() {
42 pip install -r python/requirements-build.txt -r python/requirements-test.txt
43 }
44
45 set_arrow_build_and_run_env_vars() {
46 set -a
47 source dev/conbench_envs/benchmarks.env
48 set +a
49 }
50
51 build_arrow_cpp() {
52 # Ignore the error when a cache can't be created
53 if ! ci/scripts/cpp_build.sh $(pwd) $(pwd) 2> error.log; then
54 if ! grep -q -F "Can\'t create temporary cache file" error.log; then
55 cat error.log
56 fi
57 fi
58 }
59
60 build_arrow_python() {
61 ci/scripts/python_build.sh $(pwd) $(pwd)
62 }
63
64 build_arrow_r() {
65 cat ci/etc/rprofile >> $(R RHOME)/etc/Rprofile.site
66 ci/scripts/r_deps.sh $(pwd) $(pwd)
67 (cd r; R CMD INSTALL .;)
68 }
69
70 build_arrow_java() {
71 ci/scripts/java_build.sh $(pwd) $(pwd)
72 }
73
74 install_archery() {
75 pip install -e dev/archery
76 }
77
78 install_java_script_project_dependencies() {
79 (cd js; yarn;)
80 }
81
82 create_conda_env_with_arrow_python() {
83 create_conda_env_for_benchmark_build
84 activate_conda_env_for_benchmark_build
85 install_arrow_python_dependencies
86 set_arrow_build_and_run_env_vars
87 build_arrow_cpp
88 build_arrow_python
89 }
90
91 "$@"