Skip to content

Commit 4144d22

Browse files
authored
Merge pull request #288 from IntelPython/feature/disable_channel_priority
Disable channel priority
2 parents 7d8f730 + 1f762a7 commit 4144d22

File tree

4 files changed

+40
-63
lines changed

4 files changed

+40
-63
lines changed

.github/workflows/build_and_run.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,26 @@ jobs:
5151
with:
5252
fetch-depth: 0
5353

54-
- name: Setup conda
54+
- name: Setup miniconda
5555
uses: conda-incubator/setup-miniconda@v2
5656
with:
57-
auto-update-conda: true
5857
python-version: ${{ matrix.python }}
59-
mamba-version: "*"
60-
activate-environment: dpbench-dev
58+
miniforge-variant: Mambaforge
59+
miniforge-version: latest
60+
activate-environment: "build"
61+
channel-priority: "disabled"
6162
environment-file: environments/${{ matrix.environment }}
63+
run-post: false
6264

6365
- name: Conda info
6466
shell: bash -el {0}
6567
run: |
6668
conda info
6769
conda list
6870
69-
- name: Configure Intel OpenCL CPU RT
70-
if: matrix.os == 'windows-latest'
71+
72+
- name: Setup OpenCL CPU device
73+
if: runner.os == 'Windows'
7174
shell: pwsh
7275
run: |
7376
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
@@ -80,14 +83,14 @@ jobs:
8083
Get-Content -Tail 5 -Path $cl_cfg
8184
8285
- name: Configure Python
83-
if: matrix.os == 'windows-latest'
86+
if: runner.os == 'Windows'
8487
shell: pwsh
8588
run: |
8689
# Set python encoding to support utf-8 symblos like ms.
8790
echo "PYTHONIOENCODING=utf-8" >> $env:GITHUB_ENV
8891
8992
- name: Patch IntelLLVM cmake
90-
if: matrix.os == 'windows-latest' && matrix.sycl == 'sycl'
93+
if: runner.os == 'Windows' && matrix.sycl == 'sycl'
9194
shell: pwsh
9295
run: |
9396
$env:PATCHED_CMAKE_VERSION="3.26"

.github/workflows/conda-package.yml

Lines changed: 27 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ on:
1313
env:
1414
PACKAGE_NAME: dpbench
1515
MODULE_NAME: dpbench
16-
CHANNELS: '-c dppy/label/dev -c conda-forge -c intel -c nodefaults --override-channels'
16+
# There is a separate action that removes defaults.
17+
CHANNELS: 'dppy/label/dev,conda-forge,intel'
1718
VER_JSON_NAME: 'version.json'
1819
VER_SCRIPT1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "
1920
VER_SCRIPT2: "d = j['dpbench'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
@@ -48,33 +49,28 @@ jobs:
4849
fetch-depth: 0
4950

5051
- name: Setup miniconda
51-
uses: conda-incubator/setup-miniconda@v2.2.0
52+
uses: conda-incubator/setup-miniconda@v2
5253
with:
53-
auto-update-conda: true
5454
python-version: ${{ matrix.python }}
55-
miniconda-version: 'latest'
56-
activate-environment: 'build'
55+
miniforge-variant: Mambaforge
56+
miniforge-version: latest
57+
activate-environment: "build"
58+
channels: ${{ env.CHANNELS }}
59+
channel-priority: "disabled"
60+
run-post: false
61+
62+
- name: Disable defautls
63+
run: conda config --remove channels defaults
5764

5865
- name: Store conda paths as envs
5966
run: echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/${{ runner.os == 'Linux' && 'linux' || 'win' }}-64/" | tr "\\" '/' >> $GITHUB_ENV
6067

68+
# boa is an extention to conda so we can use mamba resolver in conda build
6169
- name: Install conda-build
62-
run: conda install conda-build
63-
64-
- name: Cache conda packages
65-
uses: actions/[email protected]
66-
env:
67-
CACHE_NUMBER: 1 # Increase to reset cache
68-
with:
69-
path: ${{ env.CONDA_PKGS_DIR }}
70-
key:
71-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
72-
restore-keys: |
73-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
74-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
70+
run: mamba install boa
7571

7672
- name: Build conda package
77-
run: conda build --no-test --python ${{ matrix.python }} ${{ env.CHANNELS }} conda-recipe
73+
run: conda mambabuild --no-test --python ${{ matrix.python }} conda-recipe
7874

7975
- name: Upload artifact
8076
uses: actions/[email protected]
@@ -104,12 +100,18 @@ jobs:
104100

105101
steps:
106102
- name: Setup miniconda
107-
uses: conda-incubator/setup-miniconda@v2.2.0
103+
uses: conda-incubator/setup-miniconda@v2
108104
with:
109-
auto-update-conda: true
110105
python-version: ${{ matrix.python }}
111-
miniconda-version: 'latest'
112-
activate-environment: 'test'
106+
miniforge-variant: Mambaforge
107+
miniforge-version: latest
108+
activate-environment: "build"
109+
channels: ${{ env.CHANNELS }}
110+
channel-priority: "disabled"
111+
run-post: false
112+
113+
- name: Disable defautls
114+
run: conda config --remove channels defaults
113115

114116
- name: Store conda paths as envs
115117
shell: bash -l {0}
@@ -135,7 +137,7 @@ jobs:
135137
136138
# Needed to be able to run conda index
137139
- name: Install conda-build
138-
run: conda install conda-build
140+
run: mamba install conda-build
139141

140142
- name: Create conda channel
141143
run: conda index ${{ env.CHANNEL_PATH }}
@@ -145,38 +147,8 @@ jobs:
145147
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.CHANNEL_PATH }} --override-channels --info --json > ${{ env.VER_JSON_PATH }}
146148
cat ${{ env.VER_JSON_PATH }}
147149
148-
- name: Collect dependencies
149-
shell: bash -l {0}
150-
run: |
151-
export PACKAGE_VERSION=$(python -c "${{ env.VER_SCRIPT1 }} ${{ env.VER_SCRIPT2 }}")
152-
153-
echo PACKAGE_VERSION=${PACKAGE_VERSION}
154-
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
155-
156-
conda install ${{ env.PACKAGE_NAME }}=${PACKAGE_VERSION} python=${{ matrix.python }} ${{ env.TEST_CHANNELS }} --only-deps --dry-run > lockfile
157-
cat lockfile
158-
env:
159-
TEST_CHANNELS: '-c ${{ env.CHANNEL_PATH }} ${{ env.CHANNELS }}'
160-
161-
- name: Cache conda packages
162-
uses: actions/[email protected]
163-
env:
164-
CACHE_NUMBER: 1 # Increase to reset cache
165-
with:
166-
path: ${{ env.CONDA_PKGS_DIR }}
167-
key:
168-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('lockfile') }}
169-
restore-keys: |
170-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
171-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
172-
173-
- name: Install opencl_rt
174-
run: conda install opencl_rt -c intel --override-channels
175-
176150
- name: Install dpbench
177-
run: conda install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
178-
env:
179-
TEST_CHANNELS: '-c ${{ env.CHANNEL_PATH }} ${{ env.CHANNELS }}'
151+
run: mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest opencl_rt python=${{ matrix.python }} -c ${{ env.CHANNEL_PATH }}
180152

181153
- name: List installed packages
182154
run: conda list

environments/conda-win-sycl.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dependencies:
2727
- cmake
2828
- cython
2929
- scikit-build
30+
- intel::intel-opencl-rt # need for set-intel-ocl-icd-registry.ps1
3031
# https://github.com/scikit-build/scikit-build/issues/981
3132
- setuptools>=42,<64
3233
- pybind11

environments/conda.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dependencies:
1717
- scipy
1818
- scikit-learn
1919
- pandas
20+
- intel::intel-opencl-rt # need for set-intel-ocl-icd-registry.ps1
2021
- intel::numpy
2122
- numba
2223
- dpctl

0 commit comments

Comments
 (0)