Skip to content

Commit 85a2437

Browse files
authored
Consolidating validation scripts (#1219)
* Consolidating validation scripts * Fix validate script name * Correct script path * Correct script path * test * testing * testing * testing * testing * test * test * test * testing * testc * test hook * adding wondows use case * windows use case * test * testing * Windows fixes * more fixes * Add package type * testing more
1 parent 0b51c4f commit 85a2437

File tree

4 files changed

+34
-46
lines changed

4 files changed

+34
-46
lines changed

.github/scripts/validate_binaries.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
if [[ ${TARGET_OS} == 'windows' ]]; then
5+
source /c/Jenkins/Miniconda3/etc/profile.d/conda.sh
6+
else
7+
eval "$(conda shell.bash hook)"
8+
fi
9+
10+
if [[ ${PACKAGE_TYPE} == "libtorch" ]]; then
11+
curl ${INSTALLATION} -o libtorch.zip
12+
unzip libtorch.zip
13+
else
14+
conda create -y -n ${ENV_NAME} python=${DESIRED_PYTHON} numpy pillow
15+
conda activate ${ENV_NAME}
16+
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
17+
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
18+
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}
19+
eval $INSTALLATION
20+
python ./test/smoke_test/smoke_test.py
21+
if [[ ${TARGET_OS} != 'macos' && ${TARGET_OS} != 'windows' ]]; then
22+
${PWD}/check_binary.sh
23+
fi
24+
fi

.github/workflows/validate-linux-binaries.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,4 @@ jobs:
6161
export DESIRED_DEVTOOLSET="${{ matrix.devtoolset }}"
6262
export PACKAGE_TYPE="${{ matrix.package_type }}"
6363
export TARGET_OS="linux"
64-
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
65-
conda activate ${ENV_NAME}
66-
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
67-
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
68-
69-
if [[ ${{ matrix.package_type }} == "libtorch" ]]; then
70-
curl ${{ matrix.installation }} -o libtorch.zip
71-
unzip libtorch.zip
72-
else
73-
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}
74-
eval $INSTALLATION
75-
python ./test/smoke_test/smoke_test.py
76-
${PWD}/check_binary.sh
77-
fi
64+
./.github/scripts/validate_binaries.sh

.github/workflows/validate-macos-binaries.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,7 @@ jobs:
6767
export DESIRED_DEVTOOLSET="${{ matrix.devtoolset }}"
6868
export PACKAGE_TYPE="${{ matrix.package_type }}"
6969
export TARGET_OS="macos"
70-
export LD_LIBRARY_PATH="$(dirname $(which python))/../lib"
71-
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib
72-
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
73-
conda activate ${ENV_NAME}
74-
75-
76-
if [[ ${{ matrix.package_type }} == "libtorch" ]]; then
77-
curl ${{ matrix.installation }} -o libtorch.zip
78-
unzip libtorch.zip
79-
else
80-
eval $INSTALLATION
81-
python ./test/smoke_test/smoke_test.py
82-
${PWD}/check_binary.sh
83-
fi
70+
./.github/scripts/validate_binaries.sh
8471
8572
macos-arm64:
8673
needs: generate-macos-arm64-matrix
@@ -104,11 +91,5 @@ jobs:
10491
export DESIRED_PYTHON="${{ matrix.python_version }}"
10592
export DESIRED_CUDA="${{ matrix.desired_cuda }}"
10693
export PACKAGE_TYPE="${{ matrix.package_type }}"
107-
export TARGET_OS="macos"
108-
export LD_LIBRARY_PATH="$(dirname $(which python))/../lib"
109-
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib
110-
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
111-
conda activate ${ENV_NAME}
112-
eval $INSTALLATION
113-
python ./test/smoke_test/smoke_test.py
114-
${PWD}/check_binary.sh
94+
export TARGET_OS="macos-arm64"
95+
./.github/scripts/validate_binaries.sh

.github/workflows/validate-windows-binaries.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,9 @@ jobs:
5656
export GPU_ARCH_TYPE="${{ matrix.gpu_arch_type }}"
5757
export INSTALLATION="${{ matrix.installation }}"
5858
export CUDA_VER="${{ matrix.desired_cuda }}"
59-
60-
if [[ ${{ matrix.package_type }} == "libtorch" ]]; then
61-
curl ${{ matrix.installation }} -o libtorch.zip
62-
unzip libtorch.zip
63-
else
64-
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
65-
conda activate ${ENV_NAME}
66-
eval $INSTALLATION
67-
python ./test/smoke_test/smoke_test.py
68-
fi
59+
export DESIRED_PYTHON="${{ matrix.python_version }}"
60+
export DESIRED_CUDA="${{ matrix.desired_cuda }}"
61+
export DESIRED_DEVTOOLSET="${{ matrix.devtoolset }}"
62+
export PACKAGE_TYPE="${{ matrix.package_type }}"
63+
export TARGET_OS="windows"
64+
./.github/scripts/validate_binaries.sh

0 commit comments

Comments
 (0)