diff --git a/ci/build_conda.sh b/ci/build_conda.sh index 4fe68d9..f4a2de5 100755 --- a/ci/build_conda.sh +++ b/ci/build_conda.sh @@ -3,10 +3,6 @@ set -euo pipefail -conda config --set channel_priority strict - -rapids-configure-conda-channels - source rapids-configure-sccache source rapids-date-string @@ -15,23 +11,24 @@ export CMAKE_GENERATOR=Ninja rapids-print-env -rapids-logger "Begin py build" +# populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array +source rapids-rattler-channel-string -CUDA_VERSION="$(cat pynvjitlink/CUDA_VERSION)" -export CUDA_VERSION - -cat > cuda_compiler_version.yaml << EOF -cuda_compiler_version: - - "${CUDA_VERSION}" -EOF +rapids-logger "Building pynvjitlink" sccache --zero-stats -rapids-conda-retry build \ - conda/recipes/pynvjitlink \ - -m cuda_compiler_version.yaml \ -; +# --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/pynvjitlink \ + "${RATTLER_ARGS[@]}" \ + "${RATTLER_CHANNELS[@]}" sccache --show-adv-stats +# 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 + rapids-upload-conda-to-s3 python diff --git a/conda/recipes/pynvjitlink/meta.yaml b/conda/recipes/pynvjitlink/meta.yaml deleted file mode 100644 index d5cb6b1..0000000 --- a/conda/recipes/pynvjitlink/meta.yaml +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) 2018-2024, NVIDIA CORPORATION. - -{% set data = load_file_data("pyproject.toml") %} -{% set version = load_file_regex( - load_file="pynvjitlink/VERSION", - regex_pattern="(?P.*)" -)[0] %} -{% set project_data = data["project"] %} -{% set project_urls = project_data["urls"] %} - -package: - name: pynvjitlink - version: {{ version }} - -source: - path: ../../.. - -build: - script: - - {{ PYTHON }} -m pip install . -vv - script_env: - - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - - AWS_SESSION_TOKEN - - CMAKE_C_COMPILER_LAUNCHER - - CMAKE_CUDA_COMPILER_LAUNCHER - - CMAKE_CXX_COMPILER_LAUNCHER - - CMAKE_GENERATOR - - PARALLEL_LEVEL - - SCCACHE_BUCKET - - SCCACHE_IDLE_TIMEOUT - - SCCACHE_REGION - - SCCACHE_S3_KEY_PREFIX=pynvjitlink-aarch64 # [aarch64] - - SCCACHE_S3_KEY_PREFIX=pynvjitlink-linux64 # [linux64] - - SCCACHE_S3_USE_SSL - - SCCACHE_S3_NO_CREDENTIALS - ignore_run_exports_from: - - {{ compiler('cuda') }} - - libnvjitlink-dev - -requirements: - build: - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - {{ compiler('cuda') }} - - {{ stdlib('c') }} - - cmake >=3.26.4,!=3.30.0 - - ninja - host: - - cuda-version {{ cuda_compiler_version }} - - libnvjitlink-dev - - libnvjitlink-static - - python - - pip - - rapids-build-backend >=0.3.0,<0.4.0dev0 - - scikit-build-core >=0.10.0 - run: - - python - - numba >=0.58 - - {{ pin_compatible('cuda-version', min_pin='x', max_pin='x.x') }} - -about: - home: {{ project_urls["Homepage"] }} - dev_url: {{ project_urls["Repository"] }} - doc_url: {{ project_urls["Documentation"] }} - license: {{ project_data["license"]["text"] }} - license_family: Apache - license_file: LICENSE - license_url: {{ project_urls["License"] }} - summary: nvJitLink Python binding diff --git a/conda/recipes/pynvjitlink/recipe.yaml b/conda/recipes/pynvjitlink/recipe.yaml new file mode 100644 index 0000000..f81c8e0 --- /dev/null +++ b/conda/recipes/pynvjitlink/recipe.yaml @@ -0,0 +1,69 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +schema_version: 1 + +context: + cuda_version: ${{ load_from_file("pynvjitlink/CUDA_VERSION") | trim }} + date_string: '${{ env.get("RAPIDS_DATE_STRING") }}' + head_rev: ${{ git.head_rev(".")[:8] }} + py_version: ${{ env.get("RAPIDS_PY_VERSION") }} + py_buildstring: ${{ py_version | version_to_buildstring }} + version: ${{ load_from_file("pynvjitlink/VERSION") | trim }} + +package: + name: pynvjitlink + version: ${{ version }} +source: + path: ../../.. + +build: + dynamic_linking: + overlinking_behavior: error + string: ${{ cuda_version }}_py${{ py_buildstring }}_${{ date_string }}_${{ head_rev }}_h${{ PKG_HASH }} + script: + content: | + python -m pip install . -vv + secrets: + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + - AWS_SESSION_TOKEN + env: + CMAKE_C_COMPILER_LAUNCHER: ${{ env.get("CMAKE_C_COMPILER_LAUNCHER") }} + CMAKE_CUDA_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CUDA_COMPILER_LAUNCHER") }} + CMAKE_CXX_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CXX_COMPILER_LAUNCHER") }} + CMAKE_GENERATOR: ${{ env.get("CMAKE_GENERATOR") }} + SCCACHE_BUCKET: ${{ env.get("SCCACHE_BUCKET") }} + SCCACHE_IDLE_TIMEOUT: ${{ env.get("SCCACHE_IDLE_TIMEOUT") }} + SCCACHE_REGION: ${{ env.get("SCCACHE_REGION") }} + SCCACHE_S3_USE_SSL: ${{ env.get("SCCACHE_S3_USE_SSL") }} + SCCACHE_S3_NO_CREDENTIALS: ${{ env.get("SCCACHE_S3_NO_CREDENTIALS") }} + SCCACHE_S3_KEY_PREFIX: pynvjitlink/${{ env.get("RAPIDS_CONDA_ARCH") }}/cuda${{ cuda_major }} + +requirements: + build: + - ${{ compiler("c") }} + - ${{ compiler("cxx") }} + - ${{ compiler("cuda") }} + - ${{ stdlib("c") }} + - cmake >=3.24.4,!=3.30.0 + - ninja + host: + - cuda-version =${{ cuda_version }} + - libnvjitlink-dev + - libnvjitlink-static + - python =${{ py_version }} + - pip + - rapids-build-backend >=0.3.0,<0.4.0dev0 + - scikit-build-core >=0.10.0 + run: + - ${{ pin_compatible("cuda-version", lower_bound="x", upper_bound="x.x") }} + - python + - numba >=0.58 + ignore_run_exports: + by_name: + - cuda-version + - libnvjitlink + +about: + homepage: ${{ load_from_file("pyproject.toml").project.urls.Homepage }} + license: ${{ load_from_file("pyproject.toml").project.license.text }} + summary: ${{ load_from_file("pyproject.toml").project.description }} diff --git a/conda/recipes/pynvjitlink/conda_build_config.yaml b/conda/recipes/pynvjitlink/variants.yaml similarity index 100% rename from conda/recipes/pynvjitlink/conda_build_config.yaml rename to conda/recipes/pynvjitlink/variants.yaml diff --git a/pyproject.toml b/pyproject.toml index ce499b6..2c773c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ readme = { file = "README.md", content-type = "text/markdown" } authors = [ { name = "NVIDIA Corporation" }, ] -license = { text = "Apache 2.0" } +license = { text = "Apache-2.0" } requires-python = ">=3.10" dependencies = [ ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.