Skip to content

Fix conda-package workflow #895

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

Merged
merged 2 commits into from
Aug 28, 2022
Merged
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
40 changes: 23 additions & 17 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Cache conda packages
uses: actions/cache@v3
env:
CACHE_NUMBER: 1 # Increase to reset cache
CACHE_NUMBER: 3 # Increase to reset cache
with:
path: ~/.conda/pkgs
key:
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Cache conda packages
uses: actions/cache@v3
env:
CACHE_NUMBER: 1 # Increase to reset cache
CACHE_NUMBER: 3 # Increase to reset cache
with:
path: /home/runner/conda_pkgs_dir
key:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
runner: [ubuntu-latest]
continue-on-error: ${{ matrix.experimental }}
env:
CHANNELS: -c intel -c defaults --override-channels
CHANNELS: -c defaults -c intel --override-channels

steps:
- name: Download artifact
Expand All @@ -132,15 +132,15 @@ jobs:
run: |
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
conda install $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
cat lockfile
- name: Set pkgs_dirs
run: |
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
- name: Cache conda packages
uses: actions/cache@v3
env:
CACHE_NUMBER: 1 # Increase to reset cache
CACHE_NUMBER: 3 # Increase to reset cache
with:
path: ~/.conda/pkgs
key:
Expand All @@ -152,16 +152,20 @@ jobs:
run: |
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
conda install $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
# Test installed packages
conda list
- name: Smoke test
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate test_dpctl
export OCL_ICD_FILENAMES=libintelocl.so
export SYCL_ENABLE_HOST_DEVICE=1
python -c "import dpctl; dpctl.lsplatform()"
- name: Run tests
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate test_dpctl
# echo "libintelocl.so" | tee /etc/OpenCL/vendors/intel-cpu.icd
export OCL_ICD_FILENAMES=libintelocl.so
export SYCL_ENABLE_HOST_DEVICE=1
Expand All @@ -179,7 +183,7 @@ jobs:
runner: [windows-latest]
continue-on-error: ${{ matrix.experimental }}
env:
CHANNELS: -c intel -c defaults --override-channels
CHANNELS: -c defaults -c intel --override-channels

steps:
- name: Download artifact
Expand Down Expand Up @@ -215,7 +219,7 @@ jobs:
- name: Cache conda packages
uses: actions/cache@v3
env:
CACHE_NUMBER: 1 # Increase to reset cache
CACHE_NUMBER: 3 # Increase to reset cache
with:
path: /home/runner/conda_pkgs_dir
key:
Expand Down Expand Up @@ -342,7 +346,7 @@ jobs:
runner: [ubuntu-latest]
continue-on-error: ${{ matrix.experimental }}
env:
CHANNELS: -c intel -c defaults --override-channels
CHANNELS: -c defaults -c intel --override-channels

steps:
- name: Install conda-build
Expand All @@ -361,10 +365,12 @@ jobs:
- name: Create conda channel
run: |
mkdir -p $GITHUB_WORKSPACE/channel/linux-64
mv ${PACKAGE_NAME}-*.tar.bz2 $GITHUB_WORKSPACE/channel/linux-64
conda index $GITHUB_WORKSPACE/channel
conda index $GITHUB_WORKSPACE/channel || exit 1
mv ${PACKAGE_NAME}-*.tar.bz2 $GITHUB_WORKSPACE/channel/linux-64 || exit 1
conda index $GITHUB_WORKSPACE/channel || exit 1
# Test channel
conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels
conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels --info --json > $GITHUB_WORKSPACE/ver.json
cat ver.json
- name: Collect dependencies
run: |
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
Expand All @@ -375,7 +381,7 @@ jobs:
- name: Cache conda packages
uses: actions/cache@v3
env:
CACHE_NUMBER: 1 # Increase to reset cache
CACHE_NUMBER: 3 # Increase to reset cache
with:
path: ~/.conda/pkgs
key:
Expand All @@ -387,7 +393,7 @@ jobs:
shell: bash -l {0}
run: |
CHANNELS="${{ env.CHANNELS }}"
source $CONDA/etc/profile.d/conda.sh
. $CONDA/etc/profile.d/conda.sh
conda create -n examples -y pytest python=${{ matrix.python }} $CHANNELS
conda install -n examples -y cmake">=3.22" $CHANNELS || exit 1
conda install -n examples -y ninja $CHANNELS || exit 1
Expand All @@ -398,9 +404,9 @@ jobs:
shell: bash -l {0}
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel --override-channels"
conda install -n examples -y $CHANNELS numpy dpctl dpnp || exit 1
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c defaults --override-channels"
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
conda install -n examples -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp">=0.10.1" || exit 1
- name: Build and run examples with native extensions
shell: bash -l {0}
run: |
Expand Down
4 changes: 4 additions & 0 deletions dpctl/apis/include/dpctl4pybind11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ struct dpctl_api
namespace memory
{

// since PYBIND11_OBJECT_CVT uses error_already_set without namespace,
// this allows to avoid compilation error
using pybind11::error_already_set;

class usm_memory : public py::object
{
public:
Expand Down