-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathbuild_wheel.sh
executable file
·45 lines (32 loc) · 1.41 KB
/
build_wheel.sh
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
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.
# Exit script if any command fails
set -euo pipefail
# Set the package name
package_name="jupyterlab-nvdashboard"
# Configure sccache and set the date string
source rapids-configure-sccache
source rapids-date-string
rapids-logger "Install Node.js required for building the extension front-end"
# Install NVM for managing Node.js versions
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# Install Node.js required for building the extension front-end
nvm install 18 && nvm use 18
# Generate version and replace any letter with a hyphen
version=$(rapids-generate-version)
node_version=$(echo "$version" | sed 's/[a-zA-Z]/-\0/' | sed 's/^-//')
# Log message: Update the version field in package.json
rapids-logger "Updating version in package.json to $node_version"
jq -e --arg tag "$node_version" '.version=$tag' package.json > package.json.tmp
mv package.json.tmp package.json
# Log message: Begin py build
rapids-logger "Begin py build"
# Install build tools for Python
python -m pip install build
# Build the Python package
python -m build -s -w
ci/validate_wheel.sh dist
rapids-logger "Uploading JupyterLab NVDashboard wheels to S3"
# Upload Python wheels to S3
RAPIDS_PY_WHEEL_NAME="${package_name}" RAPIDS_PY_WHEEL_PURE="1" rapids-upload-wheels-to-s3 dist