Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/conda-python-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ on:
CPU:
type: string
default: "amd64"
upload_to_conda:
type: boolean
required: false
defaults:
run:
shell: bash
Expand Down Expand Up @@ -175,8 +172,3 @@ jobs:
with:
name: conda-repo-${{ matrix.ARCH }}-${{ matrix.PY_VER }}
path: ${{ env.RAPIDS_CONDA_BLD_OUTPUT_DIR }}
- name: Publish Conda Package
if: inputs.upload_to_conda
run: "ci/upload_conda.sh"
env:
CONDA_TOKEN: ${{ secrets.NVIDIA_CONDA_TOKEN }}
45 changes: 38 additions & 7 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-release
cancel-in-progress: true
jobs:
build-conda:
uses: ./.github/workflows/conda-python-build.yaml
secrets: inherit
with:
build_type: release
script: "ci/build_conda_python.sh"
upload_to_conda: true
build-wheels:
uses: ./.github/workflows/wheels-build.yaml
secrets: inherit
Expand All @@ -38,3 +31,41 @@ jobs:
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
verbose: true
trigger-conda-forge:
name: Trigger conda-forge update
if: startsWith(github.ref, 'refs/tags/v')
needs: upload-to-pypi
runs-on: ubuntu-latest
steps:
- name: Request feedstock version update
env:
GH_TOKEN: ${{ secrets.CONDA_FORGE_FEEDSTOCK_TOKEN }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
set -euo pipefail

if [[ -z "${GH_TOKEN}" ]]; then
echo "CONDA_FORGE_FEEDSTOCK_TOKEN must allow creating issues on conda-forge/numbast-feedstock."
exit 1
fi

RELEASE_VERSION="${RELEASE_TAG#v}"
ISSUE_TITLE="@conda-forge-admin, please update version"
EXISTING_ISSUE="$(
gh issue list \
--repo conda-forge/numbast-feedstock \
--state open \
--search "${ISSUE_TITLE} in:title" \
--json number \
--jq '.[0].number // ""'
)"

if [[ -n "${EXISTING_ISSUE}" ]]; then
echo "conda-forge update request already open: conda-forge/numbast-feedstock#${EXISTING_ISSUE}"
exit 0
fi
Comment on lines +53 to +66

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Dedup check can block future release requests

Lines 53–60 search only by a constant title. If an older update issue is still open, a new tag release won’t create a new request, so the new release can be skipped unintentionally.

Proposed fix
-          ISSUE_TITLE="`@conda-forge-admin`, please update version"
+          ISSUE_TITLE="`@conda-forge-admin`, please update version ${RELEASE_VERSION}"
           EXISTING_ISSUE="$(
             gh issue list \
               --repo conda-forge/numbast-feedstock \
               --state open \
               --search "${ISSUE_TITLE} in:title" \
               --json number \
               --jq '.[0].number // ""'
           )"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publish.yaml around lines 53 - 66, The current dedup logic
builds ISSUE_TITLE as a constant and queries gh issue list into EXISTING_ISSUE,
which causes new releases to be blocked if any prior "please update version"
issue remains open; update the script to include the release-specific identifier
(e.g. the tag or version variable such as GITHUB_REF_NAME or a RELEASE_TAG you
compute) in ISSUE_TITLE and in the gh issue list --search so the search is
scoped to issues for this exact release; modify the variables around ISSUE_TITLE
and the gh command that sets EXISTING_ISSUE (and any echo output) to reference
that tag/version identifier so only an open issue for the same release will
prevent creating a new one.


gh issue create \
--repo conda-forge/numbast-feedstock \
--title "${ISSUE_TITLE}" \
--body "Numbast ${RELEASE_VERSION} has been tagged in NVIDIA/numbast. Please have the bot check for the new upstream version and open the feedstock update PR."
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ repos:
- id: check-yaml
exclude: |
(?x)^(
conda/recipe/meta.yaml|
conda/recipes/ast_canopy/meta.yaml|
conda/recipes/numbast/meta.yaml|
conda/recipes/numbast_extensions/meta.yaml
Expand Down Expand Up @@ -48,6 +49,7 @@ repos:
- id: yamlfmt
exclude: |
(?x)^(
conda/recipe/meta.yaml|
conda/recipes/ast_canopy/meta.yaml|
conda/recipes/numbast/meta.yaml|
conda/recipes/numbast_extensions/meta.yaml
Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ v<VERSION>
```
git push git@github.com:NVIDIA/numbast.git v<VERSION>
```
- Verify the publish workflow uploads PyPI wheels and opens a `@conda-forge-admin, please update version` request on `conda-forge/numbast-feedstock`.
- Verify docs deployment publishes `https://nvidia.github.io/numbast/<VERSION>/` and that `<VERSION>` appears in the docs version picker.

### Patch releases from a previous tag
Expand All @@ -90,11 +91,13 @@ cat /tmp/numbast-v<NEW_VERSION>-changelog.txt >> /tmp/numbast-v<NEW_VERSION>-tag
git tag -a v<NEW_VERSION> -F /tmp/numbast-v<NEW_VERSION>-tag.txt
git push origin v<NEW_VERSION>
```
7. Verify docs deployment publishes `https://nvidia.github.io/numbast/<NEW_VERSION>/` and that `<NEW_VERSION>` appears in the docs version picker.
7. Verify the publish workflow uploads PyPI wheels and opens a `@conda-forge-admin, please update version` request on `conda-forge/numbast-feedstock`.
8. Verify docs deployment publishes `https://nvidia.github.io/numbast/<NEW_VERSION>/` and that `<NEW_VERSION>` appears in the docs version picker.
Comment thread
isVoid marked this conversation as resolved.

Notes:
- Use branch names that do not start with `v` for maintenance branches (for example, `0.6.x-patch`) to avoid accidental release automation triggers.
- Keep the PR changelog and tag annotation text consistent.
- The publish workflow needs `CONDA_FORGE_FEEDSTOCK_TOKEN` to create update request issues on `conda-forge/numbast-feedstock`.

## Attribution
Portions adopted from https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md
5 changes: 1 addition & 4 deletions ci/build_conda_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export CMAKE_GENERATOR=Ninja
GIT_DESCRIBE_TAG=$(git describe --abbrev=0)
export PROJECT_VERSION=${GIT_DESCRIBE_TAG:1}
export GIT_DESCRIBE_NUMBER=$(git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count)
export GIT_DESCRIBE_HASH=$(git rev-parse --short HEAD)

# If there were commits since the tag this is a dev build.
if [[ "${GIT_DESCRIBE_NUMBER}" =~ ^[0-9]+$ ]] && [[ "${GIT_DESCRIBE_NUMBER}" -gt 0 ]]; then
Expand All @@ -27,8 +26,6 @@ rapids-logger "Begin py build"

sccache --zero-stats

rapids-conda-retry build conda/recipes/ast_canopy
rapids-conda-retry build conda/recipes/numbast
rapids-conda-retry build conda/recipes/numbast_extensions
rapids-conda-retry build conda/recipe

sccache --show-adv-stats
13 changes: 8 additions & 5 deletions ci/test_conda_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ fi

GIT_DESCRIBE_TAG=$(git describe --abbrev=0)
PROJECT_VERSION=${GIT_DESCRIBE_TAG:1}
GIT_DESCRIBE_HASH=$(git rev-parse --short HEAD)
GIT_DESCRIBE_NUMBER=$(git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count)

if [[ "${GIT_DESCRIBE_NUMBER}" =~ ^[0-9]+$ ]] && [[ "${GIT_DESCRIBE_NUMBER}" -gt 0 ]]; then
PROJECT_VERSION="${PROJECT_VERSION}.dev${GIT_DESCRIBE_NUMBER}"
fi

rapids-logger "Creating Test Environment"
# TODO: replace this with rapids-dependency-file-generator
Expand All @@ -32,14 +36,13 @@ TEST_ENV_PACKAGES=(
python=${RAPIDS_PY_VERSION}
pip
cffi
ast_canopy="${PROJECT_VERSION}=*g${GIT_DESCRIBE_HASH}*"
numbast="${PROJECT_VERSION}=*g${GIT_DESCRIBE_HASH}*"
ast_canopy="${PROJECT_VERSION}"
numbast="${PROJECT_VERSION}"
)

if [[ "${TEST_BACKEND}" == "numba-cuda" ]]; then
TEST_ENV_PACKAGES+=(
"numba-cuda>=0.25.0"
numbast-extensions="${PROJECT_VERSION}=*g${GIT_DESCRIBE_HASH}*"
)
fi

Expand Down Expand Up @@ -89,7 +92,7 @@ rapids-logger "Run Tests"
if [[ "${TEST_BACKEND}" == "mlir" ]]; then
python ci/run_tests.py --ast-canopy --mlir
else
python ci/run_tests.py --ast-canopy --numbast --cccl
python ci/run_tests.py --ast-canopy --numbast
fi

rapids-logger "Test script exiting with value: $EXITCODE"
Expand Down
14 changes: 0 additions & 14 deletions ci/upload_conda.sh

This file was deleted.

30 changes: 30 additions & 0 deletions conda/recipe/build-astcanopy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set -exuo pipefail

# Use newer style environment variables to initialize.
export CMAKE_GENERATOR="Ninja"
export CMAKE_INSTALL_PREFIX="${PREFIX}"
export CMAKE_PREFIX_PATH="${PREFIX}"

# Build and install C++ astcanopy library first so Python bindings can find it.
pushd ast_canopy
echo "PREFIX: ${PREFIX}"
echo "cmake: $(ls "${PREFIX}/lib/cmake/clang")"
Comment thread
isVoid marked this conversation as resolved.
cmake -S cpp -B cpp/build \
${CMAKE_ARGS:-} \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DCMAKE_CXX_STANDARD=17
pushd cpp/build
ninja install -j${CPU_COUNT}
popd

ls -lh "${PREFIX}/lib"

export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AST_CANOPY="${PKG_VERSION}"
${PYTHON} -m pip install . -vv --no-deps --no-build-isolation
popd
10 changes: 10 additions & 0 deletions conda/recipe/build-numbast.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set -exuo pipefail

pushd numbast
export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_NUMBAST="${PKG_VERSION}"
${PYTHON} -m pip install . -vv --no-deps --no-build-isolation
popd
104 changes: 104 additions & 0 deletions conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

{% set number = environ.get("GIT_DESCRIBE_NUMBER", "0") %}
{% set name = "numbast" %}
{% set version = environ["PROJECT_VERSION"] %}

package:
name: {{ name|lower }}-split
version: {{ version }}

source:
path: ../..

build:
number: {{ number }}
skip: true # [win or osx]

outputs:
- name: ast_canopy
version: {{ version }}
requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ stdlib('c') }}
- cmake >=3.29
- ninja
host:
- python
- pip
- pybind11
- setuptools_scm
- scikit-build-core
- clangdev >=18,<22
- llvmdev >=14
- llvm >=14
run:
- python
- cuda-version >=12.5,<14
- cuda-nvcc
- clangdev >=18,<22
# Needed by clang CUDA wrappers at runtime.
- libcurand-dev
- cuda-pathfinder
build:
number: {{ number }}
skip: true # [win or osx]
script: bash {{ RECIPE_DIR }}/build-astcanopy.sh
test:
imports:
- ast_canopy
files:
- lib/libastcanopy.so
about:
Comment thread
isVoid marked this conversation as resolved.
home: https://github.com/NVIDIA/numbast
summary: CUDA C++ device-function header parser used by Numbast
license: Apache-2.0
license_file: LICENSE

- name: numbast
build:
number: {{ number }}
skip: true # [win or osx]
script: bash {{ RECIPE_DIR }}/build-numbast.sh
requirements:
host:
- python
- pip
- setuptools
- setuptools_scm
- ast_canopy >=0.5.0
run:
- python
- ast_canopy >=0.5.0
- cuda-version >=12.5,<14
- cuda-nvrtc
- numba-cuda >=0.25.0
- pyyaml
- click
- jinja2
test:
imports:
- numbast
commands:
- python -m numbast --help
about:
home: https://github.com/NVIDIA/numbast
summary: CUDA C++ to numba.cuda binding generator
license: Apache-2.0
license_file: LICENSE

about:
home: https://github.com/NVIDIA/numbast
summary: CUDA C++ to numba.cuda binding generator
license: Apache-2.0
license_file: LICENSE

extra:
feedstock-name: numbast
recipe-maintainers:
- cryos
- isvoid
- conda-forge/cuda-python
45 changes: 0 additions & 45 deletions conda/recipes/ast_canopy/build.sh

This file was deleted.

Loading
Loading