-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathbuild_python.sh
More file actions
executable file
·81 lines (56 loc) · 2.69 KB
/
build_python.sh
File metadata and controls
executable file
·81 lines (56 loc) · 2.69 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
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
source ./ci/use_conda_packages_from_prs.sh
source rapids-configure-sccache
source rapids-date-string
export CMAKE_GENERATOR=Ninja
rapids-print-env
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
version=$(rapids-generate-version)
export RAPIDS_PACKAGE_VERSION=${version}
echo "${version}" > ./VERSION
git_commit=$(git rev-parse HEAD)
package_dir="python"
for package_name in cuopt cuopt_server; do
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/${package_name}/_version.py"
done
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/cuopt/cuopt/linear_programming/cuopt_mps_parser/_version.py"
# populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array
source rapids-rattler-channel-string
# Override `rapids-rattler-channelstring` while cuOpt is not on the standard RAPIDS release cycle
RATTLER_ARGS=("--experimental" "--no-build-id" "--channel-priority" "disabled" "--output-dir" "$RAPIDS_CONDA_BLD_OUTPUT_DIR")
# Prepending `rapidsai` channel so cuOpt can grab release builds of dependencies
# that have been cleared from `rapidsai-nightly`
RATTLER_CHANNELS=("--channel" "rapidsai" "${RATTLER_CHANNELS[@]}")
rapids-logger "Prepending channel ${CPP_CHANNEL} to RATTLER_CHANNELS"
RATTLER_CHANNELS=("--channel" "${CPP_CHANNEL}" "${RATTLER_CHANNELS[@]}")
sccache --zero-stats
rapids-logger "Building mps-parser"
# --no-build-id allows for caching with `sccache`
# more info is available at
# https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build
rattler-build build --recipe conda/recipes/mps-parser \
--test skip \
"${RATTLER_ARGS[@]}" \
"${RATTLER_CHANNELS[@]}"
sccache --show-adv-stats
sccache --zero-stats
rapids-logger "Building cuopt"
rattler-build build --recipe conda/recipes/cuopt \
--test skip \
"${RATTLER_ARGS[@]}" \
"${RATTLER_CHANNELS[@]}"
sccache --show-adv-stats
rattler-build build --recipe conda/recipes/cuopt-server \
--test skip \
"${RATTLER_ARGS[@]}" \
"${RATTLER_CHANNELS[@]}"
rattler-build build --recipe conda/recipes/cuopt-sh-client \
--test skip \
"${RATTLER_ARGS[@]}" \
"${RATTLER_CHANNELS[@]}"
# remove build_cache directory to avoid uploading the entire source tree
# tracked in https://github.com/prefix-dev/rattler-build/issues/1424
rm -rf "$RAPIDS_CONDA_BLD_OUTPUT_DIR"/build_cache