Skip to content

Commit ff87e16

Browse files
authored
AZURE use conda env to build DPNP (#667)
* AZURE use conda env to build DPNP part4
1 parent fb949fb commit ff87e16

File tree

4 files changed

+78
-29
lines changed

4 files changed

+78
-29
lines changed

scripts/azure-pipelines.yml

Lines changed: 71 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ jobs:
99
steps:
1010

1111
- bash: |
12-
. ./scripts/set_ci_env.sh 3.8
13-
conda install -y conda-build conda-verify numpy cython pytest pycodestyle autopep8 black
14-
echo ========================= Run style check ===============================
12+
echo ========================= Conda ENV ====================================
13+
conda create -q -y -n CondaCodeStyle python=3.8 conda-build conda-verify \
14+
numpy cython pytest \
15+
pycodestyle autopep8 black
16+
. /usr/share/miniconda/etc/profile.d/conda.sh
17+
conda activate CondaCodeStyle
18+
echo ========================= CI ENV =======================================
19+
. ./scripts/set_ci_env.sh
20+
echo ========================= Run style check ==============================
1521
# variables are not used but have to be installed for setuptools
1622
# export ONEAPI_ROOT=/opt/intel
1723
# export MKLROOT=/opt/intel
1824
python ./setup.py style
19-
echo ========================= style check finished ===============================
25+
echo ========================= style check finished =========================
2026
2127
- job: test_valgrind
2228
displayName: Valgrind
@@ -27,10 +33,15 @@ jobs:
2733
steps:
2834

2935
- bash: |
36+
echo ========================= Conda ENV =======================================
37+
conda create -q -y -n dpnp
38+
. /usr/share/miniconda/etc/profile.d/conda.sh
39+
conda activate dpnp
40+
echo ========================= CI ENV ==========================================
3041
. ./scripts/set_ci_env.sh
31-
echo ========================= build DPNP ===============================
42+
echo ========================= build DPNP ======================================
3243
./0.build.sh
33-
echo ========================= run valgrind ===============================
44+
echo ========================= run valgrind ====================================
3445
export PYTHONMALLOC=malloc
3546
valgrind --show-leak-kinds=definite --log-file=/tmp/valgrind-output \
3647
python -m pytest tests/third_party/cupy/math_tests/test_arithmetic.py \
@@ -42,11 +53,18 @@ jobs:
4253
vmImage: 'ubuntu-20.04'
4354
steps:
4455
- bash: |
45-
. ./scripts/set_ci_env.sh 3.8
46-
conda install -y conda-build conda-verify numpy cython pytest pycodestyle autopep8 cython pytest pytest-cov
47-
echo ========================= build DPNP ===============================
56+
echo ========================= Conda ENV =================================
57+
conda create -q -y -n CondaCodeCov python=3.8 conda-build conda-verify \
58+
numpy cython pytest \
59+
pycodestyle autopep8 \
60+
cython pytest pytest-cov
61+
. /usr/share/miniconda/etc/profile.d/conda.sh
62+
conda activate CondaCodeCov
63+
echo ========================= CI ENV ====================================
64+
. ./scripts/set_ci_env.sh
65+
echo ========================= build DPNP ================================
4866
./0.build.sh
49-
echo ========================= run code coverage ===============================
67+
echo ========================= run code coverage =========================
5068
pytest --cov-report xml:coverage.xml --cov-report term-missing --cov=dpnp
5169
export CODECOV_TOKEN="1158b545-b00a-4a84-a6f9-2bc2c4265d8b"
5270
bash <(curl -s https://codecov.io/bash) -f coverage.xml
@@ -69,10 +87,15 @@ jobs:
6987
versionSpec: '$(python.version)'
7088
displayName: 'Use Python $(python.version)'
7189
- bash: |
72-
. ./scripts/set_ci_env.sh $(python.version)
73-
echo ========================= build DPNP ===============================
90+
echo ========================= Conda ENV ===========================
91+
conda create -q -y -n dpnp$(python.version) python=$(python.version)
92+
. /usr/share/miniconda/etc/profile.d/conda.sh
93+
conda activate dpnp$(python.version)
94+
echo ========================= CI ENV ==============================
95+
. ./scripts/set_ci_env.sh
96+
echo ========================= build DPNP ==========================
7497
./0.build.sh
75-
echo ========================= run pytest ===============================
98+
echo ========================= run pytest ==========================
7699
pytest
77100
78101
- job: ubuntu2004_tests_external
@@ -93,10 +116,15 @@ jobs:
93116
versionSpec: '$(python.version)'
94117
displayName: 'Use Python $(python.version)'
95118
- bash: |
96-
. ./scripts/set_ci_env.sh $(python.version)
97-
echo ========================= build DPNP ===============================
119+
echo ========================= Conda ENV ===========================
120+
conda create -q -y -n dpnp$(python.version) python=$(python.version)
121+
. /usr/share/miniconda/etc/profile.d/conda.sh
122+
conda activate dpnp$(python.version)
123+
echo ========================= CI ENV ==============================
124+
. ./scripts/set_ci_env.sh
125+
echo ========================= build DPNP ==========================
98126
./0.build.sh
99-
echo ========================= run tests ===============================
127+
echo ========================= run tests ===========================
100128
python -m tests_external.numpy.runtests
101129
102130
# test python ./setup.py bdist_wheel command with no dpctl
@@ -106,14 +134,20 @@ jobs:
106134
vmImage: 'ubuntu-20.04'
107135
steps:
108136
- bash: |
137+
echo ========================= Conda ENV =======================================
138+
conda create -q -y -n dpnp
139+
. /usr/share/miniconda/etc/profile.d/conda.sh
140+
conda activate dpnp
141+
142+
echo ========================= CI ENV ==========================================
109143
./scripts/install_system_deps.sh
110144
. ./scripts/install_cmake_lin.sh
111145
. /opt/intel/oneapi/setvars.sh
112146
113147
./scripts/install_python_deps.sh
114148
# ./scripts/build_deps_dpctl.sh
115149
116-
echo ========================= make DPNP bdist package ===============================
150+
echo ========================= make DPNP bdist package =========================
117151
python ./setup.py bdist_wheel
118152
- publish: dist
119153
artifact: 'package_$(Agent.JobName)_$(Agent.OS)'
@@ -218,6 +252,12 @@ jobs:
218252
vmImage: 'ubuntu-20.04'
219253
steps:
220254
- bash: |
255+
echo ========================= Conda ENV =============================================
256+
conda create -q -y -n dpnp
257+
. /usr/share/miniconda/etc/profile.d/conda.sh
258+
conda activate dpnp
259+
260+
echo ========================= CI ENV ================================================
221261
./scripts/install_system_deps.sh
222262
./scripts/install_system_deps_intelpython.sh
223263
@@ -227,7 +267,7 @@ jobs:
227267
./scripts/install_python_deps.sh
228268
./scripts/build_deps_dpctl.sh
229269
230-
echo ========================= make DPNP+DPCTL bdist package ===============================
270+
echo ========================= make DPNP+DPCTL bdist package =========================
231271
python ./setup.py bdist_wheel
232272
- publish: dist
233273
artifact: 'package_dpnp_dpctl_$(Agent.JobName)_$(Agent.OS)'
@@ -239,6 +279,12 @@ jobs:
239279
vmImage: 'ubuntu-20.04'
240280
steps:
241281
- bash: |
282+
echo ========================= Conda ENV =================================
283+
conda create -q -y -n dpnp
284+
. /usr/share/miniconda/etc/profile.d/conda.sh
285+
conda activate dpnp
286+
287+
echo ========================= CI ENV ====================================
242288
./scripts/install_system_deps.sh
243289
. ./scripts/install_cmake_lin.sh
244290
./scripts/install_system_deps_intelpython.sh
@@ -249,7 +295,7 @@ jobs:
249295
./scripts/build_deps_dpctl.sh
250296
251297
conda list
252-
echo ========================= make DPNP package ===============================
298+
echo ========================= make DPNP package =========================
253299
conda-build conda-recipe/
254300
- publish: /opt/intel/oneapi/intelpython/latest/conda-bld
255301
artifact: 'package_$(Agent.JobName)_$(Agent.OS)'
@@ -295,10 +341,15 @@ jobs:
295341
vmImage: 'ubuntu-20.04'
296342
steps:
297343
- bash: |
344+
echo ========================= Conda ENV ==================================
345+
conda create -q -y -n dpnp
346+
. /usr/share/miniconda/etc/profile.d/conda.sh
347+
conda activate dpnp
348+
echo ========================= CI ENV =====================================
298349
. ./scripts/install_cmake_lin.sh
299350
./scripts/install_system_deps.sh # no intel python
300351
./scripts/install_python_deps.sh # numpy, conda-build and etc.
301-
echo ========================= build DPNP package ===============================
352+
echo ========================= build DPNP package =========================
302353
./0.build.sh
303354
304355
# DPNP backend clib tests building and running

scripts/install_python_deps.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ THEDIR=$(dirname $(readlink -e ${BASH_SOURCE[0]}))
44

55
echo +++++++++++++++++++++++++ Python prerequisites +++++++++++++++++++++++++++++++++
66

7-
echo ========================= Conda: create environment ============================
8-
PYTHON_VERSION=${1:-3.*}
9-
ENV_NAME=dpnp$PYTHON_VERSION
10-
conda create -q -y -n $ENV_NAME python=$PYTHON_VERSION
11-
. /usr/share/miniconda/etc/profile.d/conda.sh
12-
conda activate $ENV_NAME
13-
147
echo ========================= Conda: install prerequisites =========================
158
# explicitly install mkl blas instead of openblas
169
# because numpy is installed with openblas for Python 3.9 by default

scripts/set_ci_env.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ ${THEDIR}/install_system_deps.sh
1717
echo ========================= setup Intel OneAPI python changed to Intel OneAPI ====
1818
. /opt/intel/oneapi/setvars.sh
1919

20-
PYTHON_VERSION=$1
21-
${THEDIR}/install_python_deps.sh $PYTHON_VERSION
20+
${THEDIR}/install_python_deps.sh
2221

2322
echo ========================= SW versions ===============================
2423
g++ --version

tests_external/skipped_tests_numpy.tbl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ tests/test_datetime.py::TestDateTime::test_datetime_arange_no_dtype
109109
tests/test_datetime.py::TestDateTime::test_datetime_array_find_type
110110
tests/test_datetime.py::TestDateTime::test_datetime_array_str
111111
tests/test_datetime.py::TestDateTime::test_datetime_as_string
112+
tests/test_datetime.py::TestDateTime::test_datetime_as_string_timezone
112113
tests/test_datetime.py::TestDateTime::test_datetime_busdaycalendar
113114
tests/test_datetime.py::TestDateTime::test_datetime_busday_holidays_count
114115
tests/test_datetime.py::TestDateTime::test_datetime_busday_holidays_offset
@@ -403,6 +404,7 @@ tests/test_deprecations.py::TestComparisonDeprecations::test_array_richcompare_l
403404
tests/test_deprecations.py::TestComparisonDeprecations::test_normal_types
404405
tests/test_deprecations.py::TestComparisonDeprecations::test_string
405406
tests/test_deprecations.py::TestComparisonDeprecations::test_void_dtype_equality_failures
407+
tests/test_deprecations.py::TestDatetime64Timezone::test_datetime
406408
tests/test_deprecations.py::TestDatetime64Timezone::test_string
407409
tests/test_deprecations.py::TestDatetimeEvent::test_3_tuple
408410
tests/test_deprecations.py::test_deprecate_ragged_arrays
@@ -428,6 +430,7 @@ tests/test_direct.py::TestMT19937::test_uniform_double
428430
tests/test_direct.py::TestMT19937::test_uniform_float
429431
tests/test_direct.py::TestPCG64::test_advance_symmetry
430432
tests/test_direct.py::TestPCG64::test_benchmark
433+
tests/test_direct.py::TestPCG64::test_cffi
431434
tests/test_direct.py::TestPCG64::test_ctypes
432435
tests/test_direct.py::TestPCG64::test_gauss_inv
433436
tests/test_direct.py::TestPCG64::test_getstate
@@ -443,6 +446,7 @@ tests/test_direct.py::TestPCG64::test_str
443446
tests/test_direct.py::TestPCG64::test_uniform_double
444447
tests/test_direct.py::TestPCG64::test_uniform_float
445448
tests/test_direct.py::TestPhilox::test_benchmark
449+
tests/test_direct.py::TestPhilox::test_cffi
446450
tests/test_direct.py::TestPhilox::test_ctypes
447451
tests/test_direct.py::TestPhilox::test_gauss_inv
448452
tests/test_direct.py::TestPhilox::test_getstate
@@ -459,6 +463,7 @@ tests/test_direct.py::TestPhilox::test_str
459463
tests/test_direct.py::TestPhilox::test_uniform_double
460464
tests/test_direct.py::TestPhilox::test_uniform_float
461465
tests/test_direct.py::TestSFC64::test_benchmark
466+
tests/test_direct.py::TestSFC64::test_cffi
462467
tests/test_direct.py::TestSFC64::test_ctypes
463468
tests/test_direct.py::TestSFC64::test_gauss_inv
464469
tests/test_direct.py::TestSFC64::test_getstate
@@ -600,6 +605,7 @@ tests/test_errstate.py::TestErrstate::test_errstate_decorator
600605
tests/test_errstate.py::TestErrstate::test_invalid
601606
tests/test__exceptions.py::TestArrayMemoryError::test__size_to_string
602607
tests/test__exceptions.py::TestArrayMemoryError::test__total_size
608+
tests/test_extending.py::test_cffi
603609
tests/test_extending.py::test_cython
604610
tests/test_extint128.py::test_add_128
605611
tests/test_extint128.py::test_ceildiv_128_64

0 commit comments

Comments
 (0)