Skip to content

Add windows ci build #1049

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 1 commit into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
version: 2.1

executors:
windows-with-nvidia-gpu:
machine:
resource_class: windows.gpu.nvidia.medium
image: windows-server-2019-nvidia:stable
shell: bash.exe

install_official_git_client: &install_official_git_client
name: Install Official Git Client
no_output_timeout: "1h"
Expand Down Expand Up @@ -175,6 +182,20 @@ pytorch_tutorial_build_manager_defaults: &pytorch_tutorial_build_manager_default
resource_class: medium
<<: *pytorch_tutorial_build_defaults

pytorch_windows_build: &pytorch_windows_build
executor: windows-with-nvidia-gpu
steps:
- checkout
- run:
name: Install Cuda
no_output_timeout: 30m
command: |
.circleci/scripts/windows_cuda_install.sh
- run:
name: test
command: |
.circleci/scripts/build_for_windows.sh

jobs:
pytorch_tutorial_pr_build_worker_0:
<<: *pytorch_tutorial_build_worker_defaults
Expand Down Expand Up @@ -302,6 +323,9 @@ jobs:
pytorch_tutorial_master_build_manager:
<<: *pytorch_tutorial_build_manager_defaults

pytorch_windows_build_worker:
<<: *pytorch_windows_build

workflows:
build:
jobs:
Expand Down Expand Up @@ -538,3 +562,10 @@ workflows:
branches:
only:
- master
- pytorch_windows_build_worker:
name: win_test_worker
filters:
branches:
only:
- master

49 changes: 49 additions & 0 deletions .circleci/scripts/build_for_windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
set -eux -o pipefail

retry () {
$* || (sleep 1 && $*) || (sleep 2 && $*)
}

SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
PROJECT_DIR="${SOURCE_DIR}/../.."
pushd $SOURCE_DIR

#install wget and make
curl -k https://ymu.dl.osdn.jp/mingw/68260/mingw-get-0.6.3-mingw32-pre-20170905-1-bin.zip -o mingw32.zip
unzip mingw32.zip -d mingw32
mingw32/bin/mingw-get.exe install mingw32-make
mingw32/bin/mingw-get.exe install msys-findutils
mv mingw32/bin/mingw32-make.exe mingw32/bin/make.exe
curl -k https://eternallybored.org/misc/wget/1.20.3/64/wget.exe -o mingw32/bin/wget.exe
export PATH="${SOURCE_DIR}/mingw32/bin:$PATH"

#install anaconda3
export CONDA_HOME="${SOURCE_DIR}/conda"
export tmp_conda="${SOURCE_DIR}/conda"
export miniconda_exe="${SOURCE_DIR}/miniconda.exe"
rm -rf conda miniconda.exe
curl -k https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o miniconda.exe
./install_conda.bat
export PATH="${tmp_conda}:${tmp_conda}/Library/usr/bin:${tmp_conda}/Library/bin:${tmp_conda}/Scripts:${tmp_conda}/bin:$PATH"

eval "$(conda shell.bash hook)"
conda create -qyn testenv python=3.7
conda activate testenv

conda install sphinx
pip install sphinx_gallery==0.3.1 flask pandas spacy ipython scipy pySoundFile scikit-image
pip install -e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
conda install -yq -c pytorch "cudatoolkit=10.1" pytorch torchvision torchtext
conda install torchaudio -c pytorch-test
python -m spacy download de
python -m spacy download en
pushd ${PROJECT_DIR}
DIR=.jenkins
python $DIR/remove_runnable_code.py beginner_source/aws_distributed_training_tutorial.py beginner_source/aws_distributed_training_tutorial.py || true
python $DIR/remove_runnable_code.py beginner_source/data_loading_tutorial.py beginner_source/data_loading_tutorial.py || true
python $DIR/remove_runnable_code.py beginner_source/dcgan_faces_tutorial.py beginner_source/dcgan_faces_tutorial.py || true
python $DIR/remove_runnable_code.py intermediate_source/model_parallel_tutorial.py intermediate_source/model_parallel_tutorial.py || true
python $DIR/remove_runnable_code.py advanced_source/static_quantization_tutorial.py advanced_source/static_quantization_tutorial.py || true

make docs
1 change: 1 addition & 0 deletions .circleci/scripts/install_conda.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
start /wait "" "%miniconda_exe%" /S /InstallationType=JustMe /RegisterPython=0 /AddToPath=0 /D=%tmp_conda%
31 changes: 31 additions & 0 deletions .circleci/scripts/windows_cuda_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
set -eux -o pipefail

curl --retry 3 -kLO https://ossci-windows.s3.amazonaws.com/cuda_10.1.243_426.00_win10.exe
7z x cuda_10.1.243_426.00_win10.exe -ocuda_10.1.243_426.00_win10
cd cuda_10.1.243_426.00_win10
mkdir cuda_install_logs

set +e

./setup.exe -s nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 cublas_10.1 cublas_dev_10.1 cudart_10.1 cufft_10.1 cufft_dev_10.1 curand_10.1 curand_dev_10.1 cusolver_10.1 cusolver_dev_10.1 cusparse_10.1 cusparse_dev_10.1 nvgraph_10.1 nvgraph_dev_10.1 npp_10.1 npp_dev_10.1 nvrtc_10.1 nvrtc_dev_10.1 nvml_dev_10.1 -loglevel:6 -log:"$(pwd -W)/cuda_install_logs"

set -e

curl --retry 3 -kLO https://ossci-windows.s3.amazonaws.com/NvToolsExt.7z
7z x NvToolsExt.7z -oNvToolsExt
mkdir -p "C:/Program Files/NVIDIA Corporation/NvToolsExt"
cp -r NvToolsExt/* "C:/Program Files/NVIDIA Corporation/NvToolsExt/"
export NVTOOLSEXT_PATH="C:\\Program Files\\NVIDIA Corporation\\NvToolsExt\\"

if ! ls "/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe"
then
echo "CUDA installation failed"
mkdir -p /c/w/build-results
7z a "c:\\w\\build-results\\cuda_install_logs.7z" cuda_install_logs
exit 1
fi

cd ..
rm -rf ./cuda_10.1.243_426.00_win10
rm -f ./cuda_10.1.243_426.00_win10.exe