From cb58582f6c7121399ac64f4974a0e3299c0abab7 Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Mon, 6 Feb 2023 12:57:43 -0500 Subject: [PATCH] Move date to build string in `conda` recipe (#165) This PR moves the date string from the version to the build string for conda recipes in this repository. This is necessary to ensure that the conda packages resulting from PR builds can be installed in the same environment as nightly conda packages, which is useful for testing purposes. Additionally, this prevents a bug from occurring where the Python builds fail because the date string it computes is different than the one computed by the C++ build, therefore causing the Python build to search for a C++ build artifact that doesn't exist. xref: https://github.com/rapidsai/rmm/pull/1195 Authors: - AJ Schmidt (https://github.com/ajschmidt8) Approvers: - Ray Douglass (https://github.com/raydouglass) URL: https://github.com/rapidsai/kvikio/pull/165 --- ci/cpu/build.sh | 5 +---- ci/gpu/build.sh | 2 ++ conda/recipes/kvikio/meta.yaml | 7 ++++--- conda/recipes/libkvikio/meta.yaml | 7 ++++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ci/cpu/build.sh b/ci/cpu/build.sh index d11e817696..3d9ce6e221 100644 --- a/ci/cpu/build.sh +++ b/ci/cpu/build.sh @@ -26,10 +26,7 @@ export CONDA_BLD_DIR="$WORKSPACE/.conda-bld" # Switch to project root; also root of repo checkout cd "$WORKSPACE" -# If nightly build, append current YYMMDD to version -if [[ "$BUILD_MODE" = "branch" && "$SOURCE_BRANCH" = branch-* ]] ; then - export VERSION_SUFFIX=`date +%y%m%d` -fi +export RAPIDS_DATE_STRING=$(date +%y%m%d) ################################################################################ # SETUP - Check environment diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index 8d7a1f355e..129e85d807 100644 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -30,6 +30,8 @@ export GIT_DESCRIBE_TAG=`git describe --tags` export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'` unset GIT_DESCRIBE_TAG +export RAPIDS_DATE_STRING=$(date +%y%m%d) + ################################################################################ # SETUP - Check environment ################################################################################ diff --git a/conda/recipes/kvikio/meta.yaml b/conda/recipes/kvikio/meta.yaml index d138bff435..239a5b6d83 100644 --- a/conda/recipes/kvikio/meta.yaml +++ b/conda/recipes/kvikio/meta.yaml @@ -1,9 +1,10 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2023, NVIDIA CORPORATION. -{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %} {% set py_version = environ.get('CONDA_PY', 36) %} {% set cuda_version = '.'.join(environ.get('CUDA', '11.5').split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} +{% set date_string = environ['RAPIDS_DATE_STRING'] %} package: name: kvikio @@ -14,7 +15,7 @@ source: build: number: {{ GIT_DESCRIBE_NUMBER }} - string: cuda_{{ cuda_major }}_py{{ py_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} + string: cuda_{{ cuda_major }}_py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} script_env: - VERSION_SUFFIX - PARALLEL_LEVEL diff --git a/conda/recipes/libkvikio/meta.yaml b/conda/recipes/libkvikio/meta.yaml index 77696df2d7..d5290d8a9a 100644 --- a/conda/recipes/libkvikio/meta.yaml +++ b/conda/recipes/libkvikio/meta.yaml @@ -1,8 +1,9 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2023, NVIDIA CORPORATION. -{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %} {% set cuda_version='.'.join(environ.get('CUDA', '11.5').split('.')[:2]) %} {% set cuda_major=cuda_version.split('.')[0] %} +{% set date_string = environ['RAPIDS_DATE_STRING'] %} package: name: libkvikio @@ -13,7 +14,7 @@ source: build: number: {{ GIT_DESCRIBE_NUMBER }} - string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} + string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} script_env: - PARALLEL_LEVEL - VERSION_SUFFIX