Skip to content

Commit

Permalink
Move date to build string in conda recipe
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. This is useful for testing purposes.

Additionally, this PR adds the `PKG_HASH` value to our build string. This value is a hash computed from the dependency names and versions used to build our packages.

Typically the `PKG_HASH` value is included in packages when the build string is omitted, as seen on most `conda-forge` packages.

Including it in our build string will help ensure that new packages are published whenever our dependencies change (which is important in the case of shared library updates).

xref: rapidsai/rmm#1195
  • Loading branch information
ajschmidt8 committed Feb 2, 2023
1 parent 00296fc commit 59bb267
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 1 addition & 5 deletions ci/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ cd "$WORKSPACE"
# Get latest tag and number of commits since tag
export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags`
export GIT_DESCRIBE_NUMBER=`git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count`

# 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=$(git show --no-patch --date=format:'%y%m%d' --format='%cd')

# Setup 'gpuci_conda_retry' for build retries (results in 2 total attempts)
export GPUCI_CONDA_RETRY_MAX=1
Expand Down
1 change: 1 addition & 0 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ cd $WORKSPACE
export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags`
export GIT_DESCRIBE_NUMBER=`git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count`
export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'`
export RAPIDS_DATE_STRING=$(git show --no-patch --date=format:'%y%m%d' --format='%cd')

################################################################################
# SETUP - Check environment
Expand Down
7 changes: 4 additions & 3 deletions conda/recipes/jupyterlab-nvdashboard/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% 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 minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set git_revision_count=environ.get('GIT_DESCRIBE_NUMBER', 0) %}
{% set py_version=environ.get('CONDA_PY', 37) %}
{% set date_string = environ['RAPIDS_DATE_STRING'] %}

package:
name: jupyterlab-nvdashboard
Expand All @@ -11,7 +11,8 @@ source:
path: ../../..

build:
number: {{ git_revision_count }}
number: {{ GIT_DESCRIBE_NUMBER }}
string: py_{{ date_string }}_h{{ PKG_HASH }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
script: python -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
noarch: python
script_env:
Expand Down

0 comments on commit 59bb267

Please sign in to comment.