Skip to content

Commit

Permalink
Add workflow to build the package and upload to dppy/label/dev
Browse files Browse the repository at this point in the history
Fix post-link script so that tests pass.
  • Loading branch information
oleksandr-pavlyk committed Aug 16, 2024
1 parent 6bf9a5f commit 305c5ee
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @oleksandr-pavlyk @xaleryb @ZzEeKkAa @ndgrigorian
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Summary of the proposed change

### Additional details

### Example illustrating what changed

76 changes: 76 additions & 0 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Conda package

on:
push:
branches:
- master
pull_request:

permissions: read-all

env:
PACKAGE_NAME: intel-gpu-ocl-icd-system


jobs:
build_and_test_linux:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
with:
fetch-depth: 0

- name: Set pkgs_dirs
run: |
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
- name: Add conda to system path
run: echo $CONDA/bin >> $GITHUB_PATH

- name: Install conda-build
run: conda install conda-build -c conda-forge --override-channels

- name: Build conda package
run: |
# use bootstrap channel to pull NumPy linked with OpenBLAS
CHANNELS="-c conda-forge --override-channels"
conda build \
$CHANNELS \
conda-recipe
- name: Upload artifact
uses: actions/[email protected]
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }}
path: /usr/share/miniconda/conda-bld/noarch/${{ env.PACKAGE_NAME }}-*.tar.bz2

upload_linux:
needs: build_and_test_linux
if: ${{github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')}}
runs-on: ubuntu-latest
steps:
- name: Download conda artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }}

- name: Install anaconda-client
run: conda install anaconda-client -c conda-forge --override-channels
- name: Add conda to system path
run: echo $CONDA/bin >> $GITHUB_PATH
- name: Package version
run: echo "PACKAGE_VERSION=$(basename ${{ env.PACKAGE_NAME }}-*.tar.bz2 | sed 's/^${{ env.PACKAGE_NAME }}-\([^-]*\).*/\1/')" >> $GITHUB_ENV

- name: Upload
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
anaconda --token $ANACONDA_TOKEN upload --user dppy --label dev ${PACKAGE_NAME}-*.tar.bz2
- name: Upload Wheels
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.whl --version ${{ env.PACKAGE_VERSION }}


12 changes: 12 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Security Policy

## Report a Vulnerability

Please report security issues or vulnerabilities to the [Intel® Security Center].

For more information on how Intel® works to resolve security issues, see
[Vulnerability Handling Guidelines].

[Intel® Security Center]:https://www.intel.com/content/www/us/en/security-center/default.html

[Vulnerability Handling Guidelines]:https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html
3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package:
version: {{ version }}

build:
noarch: generic
number: 0
skip: True # [not linux]

Expand All @@ -16,7 +17,7 @@ requirements:
test:
commands:
- export ICD_FN=${CONDA_PREFIX}/etc/OpenCL/vendors/intel-ocl-gpu.icd
- test -h ${ICD_FN} || test ! -a ${ICD_FN}
- test -h ${ICD_FN}

about:
home: https://github.com/IntelPython/{{ name|lower }}-feedstock
Expand Down
12 changes: 8 additions & 4 deletions recipe/post-link.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@

systemwide_vendors=/etc/OpenCL/vendors
env_vendors=${PREFIX}/etc/OpenCL/vendors
env_icd_fn=$local_vendors/intel-ocl-gpu.icd
env_icd_fn=$env_vendors/intel-ocl-gpu.icd

if [[ -d $systemwide_vendors ]]
then
systemwide_icd_fn=$(grep -rl "libigdrcl" ${systemwide_vendors})
if [[ -f $systemwide_icd_fn ]]
then
ln -s $systemwide_icd_fn $env_icd_fn
echo "Symbolic link was successfully created. OpenCL GPU device should be discoverable by OpenCL loader." >> ${PREFIX}/.messages.txt
echo "Symbolic link was successfully created. OpenCL GPU device should be discoverable by OpenCL loader.\n" >> ${PREFIX}/.messages.txt
else
echo "No ICD file for Intel(R) GPU device was found in '${systemwise_vendors}'." >> ${PREFIX}/.messages.txt
echo "No ICD file for Intel(R) GPU device was found in '${systemwise_vendors}'.\n" >> ${PREFIX}/.messages.txt
echo "Creating default symbolic link.\n" >> ${PREFIX}/.messages.txt
ln -s ${systemwide_vendors}/intel.icd $env_icd_fn
fi
else
echo "Folder '${systemwide_vendors}' does not exist. Try installing GPU drivers and then reinstall intel-gpu-ocl-icd-system conda package" >> $PREFIX/.messages.txt
echo "Folder '${systemwide_vendors}' does not exist. \n" >> $PREFIX/.messages.txt
echo "Creating default symbolic link. \n" >> ${PREFIX}/.messages.txt
ln -s ${systemwide_vendors}/intel.icd $env_icd_fn
fi

0 comments on commit 305c5ee

Please sign in to comment.