-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathbuild_python.sh
executable file
·34 lines (24 loc) · 1.16 KB
/
build_python.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
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.
# Exit script if any command fails
set -euo pipefail
rapids-configure-conda-channels
source rapids-configure-sccache
source rapids-date-string
# Print the Rapids environment for debugging purposes
rapids-print-env
# 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/^-//')
# 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
# Generate jupyterlab_nvdashboard/_version.py since hatch version hook isn't working with conda-build
echo "__version__ = '$version'" > jupyterlab_nvdashboard/_version.py
# TODO: Remove `--no-test` flag once importing on a CPU
# node works correctly
rapids-logger "Building JupyterLab NVDashboard conda package"
RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild --no-test conda/recipes/jupyterlab-nvdashboard
rapids-logger "Uploading JupyterLab NVDashboard conda package to S3"
rapids-upload-conda-to-s3 python