diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7b593402..756ef8f2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,9 +10,8 @@ on: branches: - "main" - "release/v[0-9][0-9].[0-9][0-9].[0-9][0-9]" - # run on pushes of new release tags + # run on pushes of any tags tags: - - v[0-9][0-9].[0-9][0-9].[0-9][0-9] # run by clicking buttons in the GitHub Actions UI workflow_dispatch: @@ -22,6 +21,11 @@ jobs: with: script: "ci/build_python.sh" secrets: inherit + upload-conda: + needs: + - conda-python-build + uses: ./.github/workflows/conda-upload-packages.yaml + secrets: inherit docs-build: needs: - conda-python-build diff --git a/.github/workflows/conda-upload-packages.yaml b/.github/workflows/conda-upload-packages.yaml new file mode 100644 index 00000000..48fabde7 --- /dev/null +++ b/.github/workflows/conda-upload-packages.yaml @@ -0,0 +1,39 @@ +# adopted from https://github.com/rapidsai/shared-workflows/blob/branch-24.12/.github/workflows/conda-upload-packages.yaml +# with some notable differences: +# +# * assumes packages were uploaded to GitHub artifact store, not Amazon S3 +# * always publishes to the same channel, but uses different label for non-release packages +# + +on: + # run only when called by other workflows + workflow_call: + +env: + # where jobs that download conda packages store the local channel + RAPIDS_LOCAL_CONDA_CHANNEL: /tmp/local-conda-packages + +jobs: + upload: + runs-on: linux-amd64-cpu4 + container: + image: rapidsai/ci-conda:latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + # the notebooks and PNG files stored in git LFS aren't necessary for package uploads + lfs: false + - name: download conda packages + uses: actions/download-artifact@v4 + with: + # omitting 'name' here means "download all artifacts from this run"... useful to + # avoid having to list the matrix of CUDA / Python versions here + path: ${{ env.RAPIDS_LOCAL_CONDA_CHANNEL }} + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + run-id: ${{ github.run_id }} + - name: Upload packages + run: "ci/upload-to-anaconda.sh" + env: + CONDA_LEGATE_TOKEN: ${{ secrets.CONDA_LEGATE_TOKEN }} diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index b4bfc70a..880fd090 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -23,8 +23,6 @@ jobs: # group together all jobs that must pass for a PR to be merged # (for use by branch protections) pr-builder: - # skip on builds from merges to main - if: github.ref != 'refs/heads/main' needs: - pre-commit - conda-python-build diff --git a/README.md b/README.md index cf3e4f50..fb038698 100644 --- a/README.md +++ b/README.md @@ -75,13 +75,25 @@ model = lb.LBRegressor(base_models=(lb.models.KRR(sigma=0.5), lb.models.Tree(max ## Installation -If you already have `cunumeric` and `legate` installed, run the following: +Install using `conda`. ```shell -pip install \ - --no-build-isolation \ - --no-deps \ - . +# stable release +conda install -c legate -c conda-forge -c nvidia legate-boost + +# nightly release +conda install -c legate/label/experimental -c legate -c conda-forge -c nvidia legate-boost +``` + +On systems without a GPU, the CPU-only package should automatically be installed. +On systems with a GPU and compatible CUDA version, the GPU package should automatically be installed. + +To force `conda` to prefer one, pass the build strings `*_cpu*` or `*_gpu*`, for example: + +```shell +# nightly release (CPU-only) +conda install --dry-run -c legate/label/experimental -c legate -c conda-forge -c nvidia \ + 'legate-boost=*=*_cpu*' ``` -For more details on customizing the build and setting up a development environment, see [`contributing.md`](./contributing.md). +For more details on building from source and setting up a development environment, see [`contributing.md`](./contributing.md). diff --git a/ci/upload-to-anaconda.sh b/ci/upload-to-anaconda.sh new file mode 100755 index 00000000..35a57e0a --- /dev/null +++ b/ci/upload-to-anaconda.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# adopted from https://github.com/rapidsai/gha-tools/blob/main/tools/rapids-upload-to-anaconda, +# with some notable differences: +# +# * assumes artifacts are on GitHub Actions artifact store, not Amazon S3 +# * assumes packages have been unpacked to env variable RAPIDS_LOCAL_CONDA_CHANNEL +# * does not differentiate between pull request and nightly branches +# (relies on workflow triggers to just not run this script when it isn't needed) + +set -e -E -u -o pipefail + +# publish to the 'experimental' label on the 'legate' channel, for all cases except +# releases (builds triggered by pushing a tag matching this regex exactly, e.g. 'v24.09.00') +if [[ "${GITHUB_REF}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + declare -r conda_label="main" +else + declare -r conda_label="experimental" +fi + +PKGS_TO_UPLOAD=$(rapids-find-anaconda-uploads.py "${RAPIDS_LOCAL_CONDA_CHANNEL}") + +if [ -z "${PKGS_TO_UPLOAD}" ]; then + rapids-echo-stderr "Couldn't find any packages to upload in: ${RAPIDS_LOCAL_CONDA_CHANNEL}" + ls -l "${RAPIDS_LOCAL_CONDA_CHANNEL}/"* +fi + +rapids-echo-stderr "Uploading packages to Anaconda.org (channel='legate', label='${conda_label}'):" +rapids-echo-stderr "${PKGS_TO_UPLOAD}" + +# shellcheck disable=SC2086 +RAPIDS_RETRY_SLEEP=180 \ + rapids-retry anaconda \ + -t "${CONDA_LEGATE_TOKEN}" \ + upload \ + --label "${conda_label}" \ + --skip-existing \ + --no-progress \ + ${PKGS_TO_UPLOAD} diff --git a/conda/recipes/legate-boost/conda_build_config.yaml b/conda/recipes/legate-boost/conda_build_config.yaml index 64607b10..c612cd10 100644 --- a/conda/recipes/legate-boost/conda_build_config.yaml +++ b/conda/recipes/legate-boost/conda_build_config.yaml @@ -25,5 +25,11 @@ gpu_enabled: - true - false +cunumeric_version: + # .dev116: https://github.com/nv-legate/legate.core.internal/issues/1409 + - "=24.09.*,>=0.0.0.dev0,!=24.09.00.dev116" + legate_version: - - "=24.09.*,>=0.0.0.dev0" + # .dev319: https://github.com/nv-legate/legate.core.internal/pull/1401 + # .dev329: https://github.com/nv-legate/legate.core.internal/issues/1409 + - "=24.09.*,>=0.0.0.dev0,!=24.09.00.dev319,!=24.09.00.dev329" diff --git a/conda/recipes/legate-boost/meta.yaml b/conda/recipes/legate-boost/meta.yaml index 10156ca7..1db98b4c 100644 --- a/conda/recipes/legate-boost/meta.yaml +++ b/conda/recipes/legate-boost/meta.yaml @@ -79,11 +79,11 @@ requirements: {% if gpu_enabled_bool %} - cuda-version ={{ cuda_version }} - cuda-cudart-dev - - cunumeric {{ legate_version }} =*_gpu* + - cunumeric {{ cunumeric_version }} =*_gpu* - legate {{ legate_version }} =*_gpu* - libcublas-dev {% else %} - - cunumeric {{ legate_version }} =*_cpu* + - cunumeric {{ cunumeric_version }} =*_cpu* - legate {{ legate_version }} =*_cpu* {% endif %} - openblas @@ -99,9 +99,9 @@ requirements: # cuda-version is used to constrain __cuda - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} - __cuda - - cunumeric {{ legate_version }} =*_gpu* + - cunumeric {{ cunumeric_version }} =*_gpu* {% else %} - - cunumeric {{ legate_version }} =*_cpu* + - cunumeric {{ cunumeric_version }} =*_cpu* {% endif %} # Relying on run_exports from legate to pin an appropriate range of versions and # GPU vs. CPU selector. diff --git a/contributing.md b/contributing.md index b33e10a2..1244ba28 100644 --- a/contributing.md +++ b/contributing.md @@ -223,8 +223,8 @@ git push origin update-version ```shell git checkout main git pull upstream main -git tag -a v24.12.00dev -m "v24.12.00dev" -git push upstream v24.12.00dev +git tag -a v24.12.00.dev -m "v24.12.00.dev" +git push upstream v24.12.00.dev ``` From that point forward, all packages produced by CI from the `main` branch will have versions like `v24.12.00.dev{n}`, @@ -251,8 +251,8 @@ git commit -m 'start v24.09.01 [skip ci]' git push upstream release/24.09 # tag the first commit on the new branch as the beginning of the 24.09.01 series -git tag -a v24.09.01dev -m 'v24.09.01dev' -git push upstream v24.09.01dev +git tag -a v24.09.01.dev -m 'v24.09.01.dev' +git push upstream v24.09.01.dev ``` 2. Open pull requests targeting that branch and merge them into that branch. @@ -283,7 +283,7 @@ git cherry-pick release/v24.09 NOTE: The use of `cherry-pick` here is important because it re-writes the commit IDs. That avoids the situation where e.g. the `v24.09.01` hotfix tag points to commits on the `main` branch during `v24.12` development (which could lead to those packages -incorrectly getting `v24.09.01dev{n}` versions). +incorrectly getting `v24.09.01.dev{n}` versions). 3. Open a pull request to merge that branch into `main`. 4. Perform a non-squash merge of that pull request.