Skip to content

Consolidating validation scripts #1219

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 23 commits into from
Dec 6, 2022
Merged
24 changes: 24 additions & 0 deletions .github/scripts/validate_binaries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -ex

if [[ ${TARGET_OS} == 'windows' ]]; then
source /c/Jenkins/Miniconda3/etc/profile.d/conda.sh
else
eval "$(conda shell.bash hook)"
fi

if [[ ${PACKAGE_TYPE} == "libtorch" ]]; then
curl ${INSTALLATION} -o libtorch.zip
unzip libtorch.zip
else
conda create -y -n ${ENV_NAME} python=${DESIRED_PYTHON} numpy pillow
conda activate ${ENV_NAME}
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}
eval $INSTALLATION
python ./test/smoke_test/smoke_test.py
if [[ ${TARGET_OS} != 'macos' && ${TARGET_OS} != 'windows' ]]; then
${PWD}/check_binary.sh
fi
fi
15 changes: 1 addition & 14 deletions .github/workflows/validate-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,4 @@ jobs:
export DESIRED_DEVTOOLSET="${{ matrix.devtoolset }}"
export PACKAGE_TYPE="${{ matrix.package_type }}"
export TARGET_OS="linux"
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
conda activate ${ENV_NAME}
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH

if [[ ${{ matrix.package_type }} == "libtorch" ]]; then
curl ${{ matrix.installation }} -o libtorch.zip
unzip libtorch.zip
else
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}
eval $INSTALLATION
python ./test/smoke_test/smoke_test.py
${PWD}/check_binary.sh
fi
./.github/scripts/validate_binaries.sh
25 changes: 3 additions & 22 deletions .github/workflows/validate-macos-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,7 @@ jobs:
export DESIRED_DEVTOOLSET="${{ matrix.devtoolset }}"
export PACKAGE_TYPE="${{ matrix.package_type }}"
export TARGET_OS="macos"
export LD_LIBRARY_PATH="$(dirname $(which python))/../lib"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
conda activate ${ENV_NAME}


if [[ ${{ matrix.package_type }} == "libtorch" ]]; then
curl ${{ matrix.installation }} -o libtorch.zip
unzip libtorch.zip
else
eval $INSTALLATION
python ./test/smoke_test/smoke_test.py
${PWD}/check_binary.sh
fi
./.github/scripts/validate_binaries.sh

macos-arm64:
needs: generate-macos-arm64-matrix
Expand All @@ -104,11 +91,5 @@ jobs:
export DESIRED_PYTHON="${{ matrix.python_version }}"
export DESIRED_CUDA="${{ matrix.desired_cuda }}"
export PACKAGE_TYPE="${{ matrix.package_type }}"
export TARGET_OS="macos"
export LD_LIBRARY_PATH="$(dirname $(which python))/../lib"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
conda activate ${ENV_NAME}
eval $INSTALLATION
python ./test/smoke_test/smoke_test.py
${PWD}/check_binary.sh
export TARGET_OS="macos-arm64"
./.github/scripts/validate_binaries.sh
16 changes: 6 additions & 10 deletions .github/workflows/validate-windows-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ jobs:
export GPU_ARCH_TYPE="${{ matrix.gpu_arch_type }}"
export INSTALLATION="${{ matrix.installation }}"
export CUDA_VER="${{ matrix.desired_cuda }}"

if [[ ${{ matrix.package_type }} == "libtorch" ]]; then
curl ${{ matrix.installation }} -o libtorch.zip
unzip libtorch.zip
else
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
conda activate ${ENV_NAME}
eval $INSTALLATION
python ./test/smoke_test/smoke_test.py
fi
export DESIRED_PYTHON="${{ matrix.python_version }}"
export DESIRED_CUDA="${{ matrix.desired_cuda }}"
export DESIRED_DEVTOOLSET="${{ matrix.devtoolset }}"
export PACKAGE_TYPE="${{ matrix.package_type }}"
export TARGET_OS="windows"
./.github/scripts/validate_binaries.sh