|
| 1 | +name: Bump open source SYCL build deps |
| 2 | + |
| 3 | +# Syncs the oclcpuexp and oneTBB pins in .github/sycl-build-deps.env, used by |
| 4 | +# os-llvm-sycl-build.yml, with intel/llvm devops/dependencies.json. |
| 5 | + |
| 6 | +on: |
| 7 | + schedule: |
| 8 | + - cron: "0 6 * * 6" |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + llvm-ref: |
| 12 | + description: "intel/llvm branch, tag or commit to read dependencies.json from" |
| 13 | + required: false |
| 14 | + default: sycl |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: read |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +jobs: |
| 24 | + bump: |
| 25 | + name: Bump oclcpuexp and oneTBB pins |
| 26 | + # disable scheduled workflow to be run in forks |
| 27 | + if: github.event_name != 'schedule' || github.repository == 'IntelPython/dpctl' |
| 28 | + |
| 29 | + runs-on: ubuntu-latest |
| 30 | + timeout-minutes: 15 |
| 31 | + |
| 32 | + permissions: |
| 33 | + # push the branch with the updated pins |
| 34 | + contents: write |
| 35 | + # open a pull request from that branch |
| 36 | + pull-requests: write |
| 37 | + |
| 38 | + env: |
| 39 | + PINS: .github/sycl-build-deps.env |
| 40 | + GH_TOKEN: ${{ github.token }} |
| 41 | + |
| 42 | + steps: |
| 43 | + - name: Checkout repo |
| 44 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 45 | + with: |
| 46 | + persist-credentials: false |
| 47 | + |
| 48 | + - name: Read intel/llvm dependencies.json |
| 49 | + id: resolve |
| 50 | + env: |
| 51 | + LLVM_REF: ${{ inputs.llvm-ref || 'sycl' }} |
| 52 | + run: | |
| 53 | + set -euo pipefail |
| 54 | + fail() { echo "::error::$*"; exit 1; } |
| 55 | +
|
| 56 | + [[ "${LLVM_REF}" =~ ^[A-Za-z0-9._/-]+$ && "${LLVM_REF}" != *..* ]] \ |
| 57 | + || fail "invalid intel/llvm ref: ${LLVM_REF}" |
| 58 | + LLVM_SHA=$(gh api "repos/intel/llvm/commits/${LLVM_REF}" --jq .sha) |
| 59 | + [[ "${LLVM_SHA}" =~ ^[0-9a-f]{40}$ ]] || fail "unexpected intel/llvm sha: ${LLVM_SHA}" |
| 60 | + DEPS="${RUNNER_TEMP}/dependencies.json" |
| 61 | + gh api -H "Accept: application/vnd.github.raw" \ |
| 62 | + "repos/intel/llvm/contents/devops/dependencies.json?ref=${LLVM_SHA}" > "${DEPS}" |
| 63 | +
|
| 64 | + OCL_TAG=$(jq -er '.linux.oclcpu.github_tag' "${DEPS}") |
| 65 | + OCL_URL=$(jq -er '.linux.oclcpu.url' "${DEPS}") |
| 66 | + TBB_VER=$(jq -er '.linux.tbb.version' "${DEPS}") |
| 67 | + TBB_FULL_URL=$(jq -er '.linux.tbb.url' "${DEPS}") |
| 68 | + OCLCPUEXP_FN=${OCL_URL##*/} |
| 69 | +
|
| 70 | + # os-llvm-sycl-build.yml rebuilds these URLs from the pins |
| 71 | + [[ "${OCL_TAG}" =~ ^[0-9]{4}-WW[0-9]+$ ]] || fail "unexpected oclcpu tag: ${OCL_TAG}" |
| 72 | + [[ "${OCLCPUEXP_FN}" =~ ^oclcpuexp-[0-9A-Za-z._]+_rel\.tar\.gz$ ]] \ |
| 73 | + || fail "unexpected oclcpu asset: ${OCLCPUEXP_FN}" |
| 74 | + [[ "${OCL_URL}" == "https://github.com/intel/llvm/releases/download/${OCL_TAG}/${OCLCPUEXP_FN}" ]] \ |
| 75 | + || fail "unexpected oclcpu url: ${OCL_URL}" |
| 76 | + [[ "${TBB_VER}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || fail "unexpected tbb version: ${TBB_VER}" |
| 77 | + [[ "${TBB_FULL_URL}" == "https://github.com/uxlfoundation/oneTBB/releases/download/v${TBB_VER}/oneapi-tbb-${TBB_VER}-lin.tgz" ]] \ |
| 78 | + || fail "unexpected tbb url: ${TBB_FULL_URL}" |
| 79 | +
|
| 80 | + { |
| 81 | + echo "llvm_sha=${LLVM_SHA}" |
| 82 | + echo "driver_tag=${OCL_TAG}" |
| 83 | + echo "oclcpuexp_fn=${OCLCPUEXP_FN}" |
| 84 | + echo "tbb_ver=${TBB_VER}" |
| 85 | + echo "tbb_url=${TBB_FULL_URL%/*}/" |
| 86 | + echo "tbb_fn=${TBB_FULL_URL##*/}" |
| 87 | + echo "tbb_dir=oneapi-tbb-${TBB_VER}" |
| 88 | + } | tee -a "${GITHUB_OUTPUT}" |
| 89 | +
|
| 90 | + - name: Apply pins |
| 91 | + env: |
| 92 | + DRIVER_TAG: ${{ steps.resolve.outputs.driver_tag }} |
| 93 | + OCLCPUEXP_FN: ${{ steps.resolve.outputs.oclcpuexp_fn }} |
| 94 | + TBB_URL: ${{ steps.resolve.outputs.tbb_url }} |
| 95 | + TBB_FN: ${{ steps.resolve.outputs.tbb_fn }} |
| 96 | + TBB_DIR: ${{ steps.resolve.outputs.tbb_dir }} |
| 97 | + run: | |
| 98 | + set -euo pipefail |
| 99 | + sed -i -E \ |
| 100 | + -e "s|^(DRIVER_PATH=).*|\1${DRIVER_TAG}|" \ |
| 101 | + -e "s|^(OCLCPUEXP_FN=).*|\1${OCLCPUEXP_FN}|" \ |
| 102 | + -e "s|^(TBB_URL=).*|\1${TBB_URL}|" \ |
| 103 | + -e "s|^(TBB_INSTALL_DIR=).*|\1${TBB_DIR}|" \ |
| 104 | + -e "s|^(TBB_FN=).*|\1${TBB_FN}|" \ |
| 105 | + "${PINS}" |
| 106 | + git diff -- "${PINS}" |
| 107 | +
|
| 108 | + - name: Create pull request |
| 109 | + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 |
| 110 | + with: |
| 111 | + token: ${{ github.token }} |
| 112 | + add-paths: ${{ env.PINS }} |
| 113 | + branch: bot/bump-sycl-build-deps |
| 114 | + delete-branch: true |
| 115 | + labels: autoupdate |
| 116 | + commit-message: | |
| 117 | + Bump oclcpuexp/oneTBB pins for os-llvm-sycl-build workflow |
| 118 | +
|
| 119 | + oclcpuexp: ${{ steps.resolve.outputs.driver_tag }} / ${{ steps.resolve.outputs.oclcpuexp_fn }} |
| 120 | + oneTBB: ${{ steps.resolve.outputs.tbb_ver }} |
| 121 | + intel/llvm: ${{ steps.resolve.outputs.llvm_sha }} |
| 122 | + title: "Bump open source SYCL build dependencies" |
| 123 | + body: | |
| 124 | + Syncs `.github/sycl-build-deps.env` with intel/llvm |
| 125 | + [`devops/dependencies.json`](https://github.com/intel/llvm/blob/${{ steps.resolve.outputs.llvm_sha }}/devops/dependencies.json). |
| 126 | +
|
| 127 | + | dependency | version | |
| 128 | + | --- | --- | |
| 129 | + | intel/llvm driver release | `${{ steps.resolve.outputs.driver_tag }}` | |
| 130 | + | oclcpuexp | `${{ steps.resolve.outputs.oclcpuexp_fn }}` | |
| 131 | + | oneTBB | `${{ steps.resolve.outputs.tbb_ver }}` | |
| 132 | +
|
| 133 | + Pull requests opened by this workflow don't trigger CI: run |
| 134 | + **Build with Open Source LLVM SYCL compiler** on this branch before merging. |
0 commit comments