Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 321
Full CI support for public builds + switch to use cibuildwheel#267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
0141cbf79fd67a92283dc6666e90c96fef3ea77572508a126beff50da935da2df982e5426cd58d167a559cd0803261b1e59134f89762ad760d3c32b37006e80ab5067d42f8dd55c0370f3356f45480f104b1a4317044c8b9fbdff28f77f1729e9e2ee2cffcea7157b5965b23f8ae7bd22175ccb50eb0e7b0046ac49326677cb84c3d97fbdd59e4e0a2ab0877cac9de8a3ef63026af84dcdbdfb58a6103135b88268e42dc41588e57e13854d4f73509128ab126087a54b05e95d0c91ed833f35c34b3341a3503daedc12840c55bdc5bdb3599c8fd3230d554f019445d515626a807b8d1dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -22,51 +22,121 @@ inputs: | ||
| python-version: | ||
| required: true | ||
| type: string | ||
| cuda-version: | ||
| required: true | ||
| type: string | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Set REPO_DIR and Dump environment | ||
| # WAR: setup-python is not relocatable... | ||
| # see https://github.com/actions/setup-python/issues/871 | ||
| - name: Set up Python ${{ inputs.python-version }} | ||
| if: ${{ startsWith(inputs.host-platform, 'linux') }} | ||
| id: setup-python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
Comment on lines
+32
to
+39
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically we don't need this step. However, because | ||
| - name: Set up MSVC | ||
| if: ${{ startsWith(inputs.host-platform, 'win') }} | ||
| uses: ilammy/msvc-dev-cmd@v1 | ||
| - name: Dump environment | ||
| shell: bash --noprofile --norc -xeuo pipefail {0} | ||
| run: | | ||
| echo "REPO_DIR=$(pwd)" >> $GITHUB_ENV | ||
| env | ||
| - name: Set environment variables | ||
| - name: Get CUDA components | ||
| shell: bash --noprofile --norc -xeuo pipefail {0} | ||
| run: | | ||
| CUDA_PATH="./cuda_toolkit" | ||
| mkdir $CUDA_PATH | ||
| WITH_TESTS_STR='' | ||
| if [[ ("${{ inputs.upload-enabled }}" == "false") && ("${{ inputs.build-type }}" != "ci") ]]; then | ||
| WITH_TESTS_STR='-with_tests' | ||
| # The binary archives (redist) are guaranteed to be updated as part of the release posting. | ||
| CTK_BASE_URL="https://developer.download.nvidia.com/compute/cuda/redist/" | ||
| CTK_JSON_URL="$CTK_BASE_URL/redistrib_${{ inputs.cuda-version }}.json" | ||
| if [[ "${{ inputs.host-platform }}" == linux* ]]; then | ||
| if [[ "${{ inputs.host-platform }}" == "linux-x64" ]]; then | ||
| CTK_SUBDIR="linux-x86_64" | ||
| elif [[ "${{ inputs.host-platform }}" == "linux-aarch64" ]]; then | ||
| CTK_SUBDIR="linux-sbsa" | ||
| fi | ||
| function extract() { | ||
| tar -xvf $1 -C $CUDA_PATH --strip-components=1 | ||
| } | ||
| elif [[ "${{ inputs.host-platform }}" == "win-x64" ]]; then | ||
| CTK_SUBDIR="windows-x86_64" | ||
| function extract() { | ||
| _TEMP_DIR_=$(mktemp -d) | ||
| unzip $1 -d $_TEMP_DIR_ | ||
| cp -r $_TEMP_DIR_/*/* $CUDA_PATH | ||
| rm -rf $_TEMP_DIR_ | ||
| } | ||
| fi | ||
| function populate_cuda_path() { | ||
| # take the component name as a argument | ||
| function download() { | ||
| curl -kLSs $1 -o $2 | ||
| } | ||
| CTK_COMPONENT=$1 | ||
| CTK_COMPONENT_REL_PATH="$(curl -s $CTK_JSON_URL | | ||
| python -c "import sys, json; print(json.load(sys.stdin)['${CTK_COMPONENT}']['${CTK_SUBDIR}']['relative_path'])")" | ||
| CTK_COMPONENT_URL="${CTK_BASE_URL}/${CTK_COMPONENT_REL_PATH}" | ||
| CTK_COMPONENT_COMPONENT_FILENAME="$(basename $CTK_COMPONENT_REL_PATH)" | ||
| download $CTK_COMPONENT_URL $CTK_COMPONENT_COMPONENT_FILENAME | ||
| extract $CTK_COMPONENT_COMPONENT_FILENAME | ||
| rm $CTK_COMPONENT_COMPONENT_FILENAME | ||
| } | ||
| TARGET_PLATFORM='linux-64' | ||
| if [[ "${{ inputs.host-platform }}" == "linux-aarch64" ]]; then | ||
| # Get headers and shared libraries in place | ||
| populate_cuda_path cuda_nvcc | ||
| populate_cuda_path cuda_cudart | ||
| populate_cuda_path cuda_nvrtc | ||
| populate_cuda_path cuda_profiler_api | ||
| ls -l $CUDA_PATH | ||
| # Note: the headers will be copied into the cibuildwheel manylinux container, | ||
| # so setting the CUDA_PATH env var here is meaningless. | ||
| - name: Set environment variables | ||
| shell: bash --noprofile --norc -xeuo pipefail {0} | ||
| run: | | ||
| # TODO: just align host-platform names with TARGET_PLATFORM... | ||
| if [[ "${{ inputs.host-platform }}" == "linux-x64" ]]; then | ||
| TARGET_PLATFORM='linux-64' | ||
| elif [[ "${{ inputs.host-platform }}" == "linux-aarch64" ]]; then | ||
| TARGET_PLATFORM='linux-aarch64' | ||
| elif [[ "${{ inputs.host-platform }}" == "win-x64" ]]; then | ||
| TARGET_PLATFORM='win-64' | ||
| fi | ||
| BUILD_MODE="${{ inputs.build-mode }}" | ||
| BUILD_MODE_STR="" | ||
| [ -n "${BUILD_MODE}" ] && BUILD_MODE_STR="-${BUILD_MODE}" | ||
| PYTHON_VERSION_FORMATTED=$(echo '${{ inputs.python-version }}' | tr -d '.') | ||
| if [[ "${{ inputs.host-platform }}" == linux* ]]; then | ||
leofang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-manylinux*" | ||
| REPO_DIR=$(pwd) | ||
| elif [[ "${{ inputs.host-platform }}" == win* ]]; then | ||
| CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-win_amd64" | ||
| PWD=$(pwd) | ||
| REPO_DIR=$(cygpath -w $PWD) | ||
| fi | ||
| BUILD_MODE="${{ inputs.build-mode }}" | ||
| if [[ ("${BUILD_MODE}" == "") || ("${BUILD_MODE}" == "release") ]]; then | ||
| # We upload release versions in the default folder. | ||
| PKG_DIR="${TARGET_PLATFORM}" | ||
| else | ||
| PKG_DIR="${BUILD_MODE}/${TARGET_PLATFORM}" | ||
| fi | ||
| PYTHON_VERSION_FORMATTED=$(echo '${{ inputs.python-version }}' | tr -d '.') | ||
| echo "BINDINGS_ARTIFACT_NAME=${{ inputs.host-platform }}-${{ inputs.build-type }}-cuda_bindings-python${PYTHON_VERSION_FORMATTED}-${{ inputs.target-device }}${BUILD_MODE_STR}${WITH_TESTS_STR}-${{ github.sha }}" >> $GITHUB_ENV | ||
leofang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| echo "BINDINGS_ARTIFACTS_DIR=$(realpath "$(pwd)/cuda_bindings/dist")" >> $GITHUB_ENV | ||
| echo "CORE_ARTIFACT_NAME=${{ inputs.host-platform }}-${{ inputs.build-type }}-cuda_core-python${PYTHON_VERSION_FORMATTED}-${{ inputs.target-device }}${BUILD_MODE_STR}${WITH_TESTS_STR}-${{ github.sha }}" >> $GITHUB_ENV | ||
| echo "CORE_ARTIFACTS_DIR=$(realpath "$(pwd)/cuda_core/dist")" >> $GITHUB_ENV | ||
| echo "USE_CUDA=${{ (inputs.target-device == 'cpu' && 'OFF') || 'ON' }}" >> $GITHUB_ENV | ||
| echo "PARALLEL_LEVEL=$(nproc)" >> $GITHUB_ENV | ||
| echo "REPO_DIR=$REPO_DIR" >> $GITHUB_ENV | ||
| echo "PKG_DIR=${PKG_DIR}" >> $GITHUB_ENV | ||
| echo "CUDA_CORE_ARTIFACT_NAME=cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ inputs.host-platform }}-${{ inputs.build-type }}-${{ github.sha }}" >> $GITHUB_ENV | ||
| echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV | ||
| echo "CUDA_BINDINGS_ARTIFACT_NAME=cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ inputs.build-type }}-${{ github.sha }}" >> $GITHUB_ENV | ||
| echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV | ||
| echo "UPLOAD_ENABLED=${{ (inputs.upload-enabled == 'true' && 'ON') || 'OFF' }}" >> $GITHUB_ENV | ||
| echo "LEGATE_CORE_BUILD_MODE=${BUILD_MODE}" >> $GITHUB_ENV | ||
| echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV | ||
| echo "TARGET_PLATFORM=${TARGET_PLATFORM}" >> $GITHUB_ENV | ||
| echo "PKG_DIR=${PKG_DIR}" >> $GITHUB_ENV | ||
| echo "PYTHON_VERSION=${{ inputs.python-version }}" >> $GITHUB_ENV | ||
| echo "CIBW_BUILD=${CIBW_BUILD}" >> $GITHUB_ENV | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,16 @@ | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| host-platform: | ||
leofang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| target-device: | ||
| type: string | ||
| required: true | ||
| target-device: | ||
| build-type: | ||
| type: string | ||
| required: true | ||
| build-mode: | ||
| host-platform: | ||
| type: string | ||
| required: true | ||
| build-type: | ||
| build-mode: | ||
| type: string | ||
| required: true | ||
| upload-enabled: | ||
| @@ -19,6 +19,10 @@ on: | ||
| python-version: | ||
| type: string | ||
| required: true | ||
| cuda-version: | ||
| type: string | ||
| required: true | ||
| jobs: | ||
| build: | ||
| if: ${{ github.repository_owner == 'nvidia' }} | ||
| @@ -28,13 +32,14 @@ jobs: | ||
| client-repo: ${{ github.event.repository.name }} | ||
| target-device: ${{ inputs.target-device }} | ||
| runs-on: ${{ (inputs.host-platform == 'linux-x64' && 'linux-amd64-cpu8') || | ||
| (inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') }} | ||
| (inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || | ||
| (inputs.host-platform == 'win-x64' && 'windows-2019') }} | ||
| # (inputs.host-platform == 'win-x64' && 'windows-amd64-cpu8') }} | ||
| build-type: ${{ inputs.build-type }} | ||
| use-container: ${{ inputs.host-platform == 'linux-x64' || | ||
| inputs.host-platform == 'linux-aarch64'}} | ||
| host-platform: ${{ inputs.host-platform }} | ||
| dependencies-file: "" | ||
| build-mode: ${{ inputs.build-mode }} | ||
| upload-enabled: ${{ inputs.upload-enabled }} | ||
| python-version: ${{ inputs.python-version }} | ||
| cuda-version: ${{ inputs.cuda-version }} | ||
| dependencies-file: "" | ||
| secrets: inherit | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This was commented out because of #271.