Skip to content

Commit 3976d5c

Browse files
Merge pull request #1906 from IntelPython/backport-workflow-changes
Backport workflow changes
2 parents 5e5513f + 77f6c49 commit 3976d5c

File tree

8 files changed

+129
-43
lines changed

8 files changed

+129
-43
lines changed

.github/workflows/conda-package.yml

Lines changed: 107 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,21 @@ env:
1212
PACKAGE_NAME: dpctl
1313
MODULE_NAME: dpctl
1414
TEST_ENV_NAME: test_dpctl
15-
VER_SCRIPT1: "import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); "
16-
VER_SCRIPT2: "d = j['dpctl'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
15+
VER_SCRIPT1: "import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); d = j['dpctl'][0];"
16+
VER_SCRIPT2: "print('='.join((d[s] for s in ('version', 'build'))))"
17+
VER_SCRIPT3: "print(' '.join(map(lambda s: chr(34) + s + chr(34), [comp for comp in d['depends'] if 'dpcpp' in comp][1:])))"
1718
INTEL_CHANNEL: "https://software.repos.intel.com/python/conda/"
1819

1920
jobs:
2021
build_linux:
2122
runs-on: ubuntu-22.04
23+
timeout-minutes: 90
2224

2325
strategy:
2426
matrix:
2527
python: ['3.9', '3.10', '3.11', '3.12']
2628
steps:
27-
- uses: actions/checkout@v4.1.7
29+
- uses: actions/checkout@v4.2.2
2830
with:
2931
fetch-depth: 0
3032

@@ -62,35 +64,43 @@ jobs:
6264
$CHANNELS \
6365
conda-recipe
6466
- name: Upload artifact
65-
uses: actions/upload-artifact@v4.4.0
67+
uses: actions/upload-artifact@v4.4.3
6668
with:
6769
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
6870
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
6971
- name: Upload wheels artifact
70-
uses: actions/upload-artifact@v4.4.0
72+
uses: actions/upload-artifact@v4.4.3
7173
with:
7274
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
7375
path: ${{ env.WHEELS_OUTPUT_FOLDER }}${{ env.PACKAGE_NAME }}-*.whl
7476

7577
build_windows:
7678
runs-on: windows-2019
79+
timeout-minutes: 150
7780

7881
strategy:
7982
matrix:
8083
python: ['3.9', '3.10', '3.11', '3.12']
81-
env:
82-
conda-bld: C:\Miniconda\conda-bld\win-64\
8384
steps:
84-
- uses: actions/checkout@v4.1.7
85+
- uses: actions/checkout@v4.2.2
8586
with:
8687
fetch-depth: 0
88+
8789
- uses: conda-incubator/setup-miniconda@v3
8890
with:
89-
auto-activate-base: true
90-
conda-build-version: "*"
91-
activate-environment: true
91+
miniforge-variant: Miniforge3
92+
miniforge-version: latest
93+
activate-environment: build
94+
channels: conda-forge
95+
conda-remove-defaults: true
9296
python-version: ${{ matrix.python }}
9397

98+
- name: Install conda build
99+
run: |
100+
conda activate
101+
conda install -y conda-build
102+
conda list -n base
103+
94104
- name: Cache conda packages
95105
uses: actions/cache@v4
96106
env:
@@ -102,28 +112,36 @@ jobs:
102112
restore-keys: |
103113
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
104114
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
115+
105116
- name: Store conda paths as envs
106117
shell: bash -l {0}
107118
run: |
119+
echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> $GITHUB_ENV
108120
echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV
121+
109122
- name: Build conda package
110123
env:
111124
OVERRIDE_INTEL_IPO: 1 # IPO requires more resources that GH actions VM provides
112-
run: conda build --no-test --python ${{ matrix.python }} --numpy 2.0 -c conda-forge --override-channels conda-recipe
125+
run: |
126+
conda activate
127+
conda build --no-test --python ${{ matrix.python }} --numpy 2 -c conda-forge --override-channels conda-recipe
128+
113129
- name: Upload artifact
114-
uses: actions/upload-artifact@v4.4.0
130+
uses: actions/upload-artifact@v4.4.3
115131
with:
116132
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
117-
path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
133+
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
134+
118135
- name: Upload wheels artifact
119-
uses: actions/upload-artifact@v4.4.0
136+
uses: actions/upload-artifact@v4.4.3
120137
with:
121138
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
122139
path: ${{ env.WHEELS_OUTPUT_FOLDER }}${{ env.PACKAGE_NAME }}-*.whl
123140

124141
test_linux:
125142
needs: build_linux
126143
runs-on: ${{ matrix.runner }}
144+
timeout-minutes: 30
127145

128146
strategy:
129147
matrix:
@@ -215,6 +233,7 @@ jobs:
215233
test_windows:
216234
needs: build_windows
217235
runs-on: ${{ matrix.runner }}
236+
timeout-minutes: 60
218237
defaults:
219238
run:
220239
shell: cmd /C CALL {0}
@@ -232,38 +251,61 @@ jobs:
232251
shell: pwsh
233252
run: |
234253
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $env:GITHUB_ENV
254+
235255
- name: Display channels line
236256
run: |
237257
echo ${{ env.CHANNELS }}
258+
238259
- name: Download artifact
239260
uses: actions/download-artifact@v4
240261
with:
241262
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
263+
242264
- uses: conda-incubator/setup-miniconda@v3
243265
with:
244-
auto-update-conda: true
245-
conda-build-version: '*'
246-
miniconda-version: 'latest'
266+
miniforge-version: latest
267+
channels: conda-forge
268+
conda-remove-defaults: true
247269
activate-environment: ${{ env.TEST_ENV_NAME }}
248270
python-version: ${{ matrix.python }}
271+
272+
- name: Install conda-index
273+
run: |
274+
conda install -n base conda-index
275+
249276
- name: Create conda channel with the artifact bit
250277
shell: cmd /C CALL {0}
251278
run: |
279+
@echo on
252280
echo ${{ env.workdir }}
281+
mkdir ${{ env.workdir }}\channel
253282
mkdir ${{ env.workdir }}\channel\win-64
254283
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.workdir }}\channel\win-64
255-
dir ${{ env.workdir }}\channel\win-64
284+
dir ${{ env.workdir }}\channel\win-64\
285+
256286
- name: Index the channel
257287
shell: cmd /C CALL {0}
258-
run: conda index ${{ env.workdir }}\channel
288+
run: |
289+
@echo on
290+
conda index ${{ env.workdir }}\channel
291+
292+
- name: List content of the channels
293+
shell: cmd /C CALL {0}
294+
run: |
295+
dir ${{ env.workdir }}\channel
296+
dir ${{ env.workdir }}\channel\win-64
259297
260298
- name: Dump dpctl version info from created channel into ver.json
261299
shell: cmd /C CALL {0}
262300
run: |
301+
@echo on
263302
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json
303+
dir ${{ env.workdir }}
304+
264305
- name: Output content of produced ver.json
265306
shell: pwsh
266307
run: Get-Content -Path ${{ env.workdir }}\ver.json
308+
267309
- name: Collect dependencies
268310
shell: cmd /C CALL {0}
269311
run: |
@@ -275,9 +317,11 @@ jobs:
275317
SET PACKAGE_VERSION=%%F
276318
)
277319
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
320+
278321
- name: Display lockfile content
279322
shell: pwsh
280323
run: Get-Content -Path .\lockfile
324+
281325
- name: Cache conda packages
282326
uses: actions/cache@v4
283327
env:
@@ -289,9 +333,11 @@ jobs:
289333
restore-keys: |
290334
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
291335
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
336+
292337
- name: Install opencl_rt
293338
shell: cmd /C CALL {0}
294339
run: conda install -n ${{ env.TEST_ENV_NAME }} opencl_rt -c ${{ env.INTEL_CHANNEL }} --override-channels
340+
295341
- name: Install dpctl
296342
shell: cmd /C CALL {0}
297343
run: |
@@ -305,37 +351,48 @@ jobs:
305351
)
306352
SET TEST_DEPENDENCIES=pytest"<8" pytest-cov cython setuptools
307353
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
354+
308355
- name: Report content of test environment
309356
shell: cmd /C CALL {0}
310357
run: |
311358
echo "Value of CONDA enviroment variable was: " %CONDA%
312359
echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
313360
conda info && conda list -n ${{ env.TEST_ENV_NAME }}
361+
314362
- name: Configure Intel OpenCL CPU RT
315363
shell: pwsh
316364
run: |
317365
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
318-
&$script_path
366+
if (Test-Path $script_path) {
367+
&$script_path
368+
} else {
369+
Write-Warning "File $script_path was NOT found!"
370+
}
319371
# Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
320372
$cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg"
321373
Get-Content -Tail 5 -Path $cl_cfg
374+
322375
- name: Smoke test, step 1
323376
shell: cmd /C CALL {0}
324377
run: >-
325378
conda activate ${{ env.TEST_ENV_NAME }} && python -c "import sys; print(sys.executable)"
379+
326380
- name: Smoke test, step 2
327381
shell: cmd /C CALL {0}
328382
run: >-
329383
conda activate ${{ env.TEST_ENV_NAME }} && python -m dpctl -f
384+
330385
- name: Create empty temporary directory to run tests from
331386
shell: cmd /C CALL {0}
332387
# create temporary empty folder to runs tests from
333388
# https://github.com/pytest-dev/pytest/issues/11904
334389
run: >-
335390
mkdir "${{ env.workdir }}\test_tmp"
391+
336392
- name: List content of workdir folder
337393
shell: cmd /C CALL {0}
338394
run: dir "${{ env.workdir }}"
395+
339396
- name: Run tests
340397
shell: cmd /C CALL {0}
341398
env:
@@ -348,6 +405,7 @@ jobs:
348405
needs: test_linux
349406
if: ${{github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')}}
350407
runs-on: ubuntu-22.04
408+
timeout-minutes: 20
351409
strategy:
352410
matrix:
353411
python: ['3.9', '3.10', '3.11', '3.12']
@@ -384,6 +442,7 @@ jobs:
384442
needs: test_windows
385443
if: ${{github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')}}
386444
runs-on: windows-2019
445+
timeout-minutes: 20
387446
strategy:
388447
matrix:
389448
python: ['3.9', '3.10', '3.11', '3.12']
@@ -400,6 +459,9 @@ jobs:
400459

401460
- uses: conda-incubator/setup-miniconda@v3
402461
with:
462+
miniforge-version: latest
463+
channels: conda-forge
464+
conda-remove-defaults: true
403465
auto-activate-base: true
404466
activate-environment: ""
405467

@@ -430,6 +492,7 @@ jobs:
430492
experimental: [false]
431493
runner: [ubuntu-22.04]
432494
continue-on-error: ${{ matrix.experimental }}
495+
timeout-minutes: 60
433496
env:
434497
EXAMPLES_ENV_NAME: examples
435498
BUILD_ENV_NAME: build_env
@@ -445,7 +508,7 @@ jobs:
445508
# Needed to be able to run conda index
446509
run: conda install conda-index -c conda-forge --override-channels
447510
- name: Checkout dpctl repo
448-
uses: actions/checkout@v4.1.7
511+
uses: actions/checkout@v4.2.2
449512
with:
450513
fetch-depth: 0
451514
- name: Download artifact
@@ -484,18 +547,28 @@ jobs:
484547
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
485548
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
486549
- name: Install example requirements
487-
shell: bash -l {0}
550+
shell: bash -ex -l {0}
488551
env:
489-
DPCPP_CMPLR: dpcpp_linux-64">=2024.2"
552+
DPCPP_CMPLR: "dpcpp_linux-64>=2024.2"
490553
run: |
491554
CHANNELS="${{ env.CHANNELS }}"
492555
. $CONDA/etc/profile.d/conda.sh
493-
conda create -n ${{ env.EXAMPLES_ENV_NAME }} -y pytest python=${{ matrix.python }} setuptools"<72.2.0" $CHANNELS
494-
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y cmake $CHANNELS || exit 1
495-
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y ninja $CHANNELS || exit 1
556+
DPCTL_DEPENDS="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT3}")"
557+
echo "Dpctl dependencies: ${DPCTL_DEPENDS}"
558+
conda create -n ${{ env.EXAMPLES_ENV_NAME }} -y pytest python=${{ matrix.python }} "setuptools<72.2.0" $CHANNELS
559+
echo "Environment created"
560+
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y cmake ninja $CHANNELS || exit 1
561+
echo "Cmake and Ninja installed"
496562
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y pybind11 cython scikit-build $CHANNELS || exit 1
497-
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y mkl-dpcpp mkl-devel-dpcpp dpcpp_cpp_rt $CHANNELS || exit 1
498-
conda create -y -n ${{ env.BUILD_ENV_NAME }} $CHANNELS gcc_linux-64 gxx_linux-64 ${{ env.DPCPP_CMPLR }} sysroot_linux-64">=2.28"
563+
echo "scikit-build installed"
564+
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y mkl-dpcpp \
565+
mkl-devel-dpcpp dpcpp_cpp_rt "${DPCTL_DEPENDS}" \
566+
$CHANNELS || exit 1
567+
echo "IPL installed"
568+
conda create -y -n ${{ env.BUILD_ENV_NAME }} $CHANNELS gcc_linux-64 gxx_linux-64 \
569+
${{ env.DPCPP_CMPLR }} "${DPCTL_DEPENDS}" \
570+
"sysroot_linux-64>=2.28"
571+
echo "Compiler installed"
499572
- name: Install dpctl
500573
shell: bash -l {0}
501574
run: |
@@ -577,6 +650,7 @@ jobs:
577650
array-api-conformity:
578651
needs: build_linux
579652
runs-on: ${{ matrix.runner }}
653+
timeout-minutes: 90
580654
permissions:
581655
pull-requests: write
582656

@@ -594,7 +668,7 @@ jobs:
594668
run: |
595669
echo ${{ env.CHANNELS }}
596670
- name: Checkout dpctl repo
597-
uses: actions/checkout@v4.1.7
671+
uses: actions/checkout@v4.2.2
598672
with:
599673
fetch-depth: 0
600674
- name: Cache array API tests
@@ -722,6 +796,7 @@ jobs:
722796
name: Clean up anaconda packages
723797
needs: [upload_linux, upload_windows]
724798
runs-on: 'ubuntu-latest'
799+
timeout-minutes: 30
725800
defaults:
726801
run:
727802
shell: bash -el {0}
@@ -731,13 +806,14 @@ jobs:
731806
run-post: false
732807
channel-priority: "disabled"
733808
channels: conda-forge
809+
conda-remove-defaults: true
734810
python-version: '3.11'
735811

736812
- name: Install anaconda-client
737813
run: conda install anaconda-client -c conda-forge --override-channels
738814

739815
- name: Checkout repo
740-
uses: actions/checkout@v4.1.7
816+
uses: actions/checkout@v4.2.2
741817
with:
742818
repository: IntelPython/devops-tools
743819
fetch-depth: 0

.github/workflows/cpp_style_checks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ jobs:
1515
formatting-check:
1616
name: clang-format
1717
runs-on: ubuntu-latest
18+
timeout-minutes: 30
1819
steps:
19-
- uses: actions/checkout@v4.1.7
20+
- uses: actions/checkout@v4.2.2
2021
- name: Run clang-format style check for C/C++ programs.
2122
uses: jidicula/clang-format-action@v4.13.0
2223
with:

0 commit comments

Comments
 (0)