Skip to content

Commit

Permalink
Move date to build string in conda recipe (#165)
Browse files Browse the repository at this point in the history
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: rapidsai/rmm#1195

Authors:
  - AJ Schmidt (https://github.com/ajschmidt8)

Approvers:
  - Ray Douglass (https://github.com/raydouglass)

URL: #165
  • Loading branch information
ajschmidt8 authored Feb 6, 2023
1 parent aa28b98 commit cb58582
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
5 changes: 1 addition & 4 deletions ci/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand Down
7 changes: 4 additions & 3 deletions conda/recipes/kvikio/meta.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions conda/recipes/libkvikio/meta.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit cb58582

Please sign in to comment.