Skip to content

Commit

Permalink
Add windows binary jobs (#642)
Browse files Browse the repository at this point in the history
* Add windows binary jobs

* Make wheel package platform-specific and python-version-specific
  • Loading branch information
peterjc123 committed May 16, 2020
1 parent 93cc6da commit e3a4708
Show file tree
Hide file tree
Showing 5 changed files with 191 additions and 4 deletions.
141 changes: 141 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,45 @@ jobs:
paths:
- "*"

binary_windows_wheel:
<<: *binary_common
executor:
name: windows-cpu
steps:
- checkout
- run:
name: build
command: |
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
conda activate base
bash packaging/build_wheel.sh
- store_artifacts:
path: dist
- persist_to_workspace:
root: dist
paths:
- "*"

binary_windows_conda:
<<: *binary_common
executor:
name: windows-cpu
steps:
- checkout
- run:
name: build
command: |
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
conda activate base
conda install -yq conda-build "conda-package-handling!=1.5.0"
bash packaging/build_conda.sh
- store_artifacts:
path: C:/tools/miniconda3/conda-bld/win-64
- persist_to_workspace:
root: C:/tools/miniconda3/conda-bld/win-64
paths:
- "*"

# Requires org-member context
binary_conda_upload:
docker:
Expand Down Expand Up @@ -403,6 +442,15 @@ workflows:
- binary_macos_wheel:
name: binary_macos_wheel_py3.8
python_version: '3.8'
- binary_windows_wheel:
name: binary_windows_wheel_py3.6
python_version: '3.6'
- binary_windows_wheel:
name: binary_windows_wheel_py3.7
python_version: '3.7'
- binary_windows_wheel:
name: binary_windows_wheel_py3.8
python_version: '3.8'
- binary_linux_conda:
name: binary_linux_conda_py3.6
python_version: '3.6'
Expand All @@ -421,6 +469,15 @@ workflows:
- binary_macos_conda:
name: binary_macos_conda_py3.8
python_version: '3.8'
- binary_windows_conda:
name: binary_windows_conda_py3.6
python_version: '3.6'
- binary_windows_conda:
name: binary_windows_conda_py3.7
python_version: '3.7'
- binary_windows_conda:
name: binary_windows_conda_py3.8
python_version: '3.8'
unittest:
jobs:
- unittest_linux_cpu:
Expand Down Expand Up @@ -591,6 +648,48 @@ workflows:
name: nightly_binary_macos_wheel_py3.8_upload
requires:
- nightly_binary_macos_wheel_py3.8
- binary_windows_wheel:
filters:
branches:
only: nightly
name: nightly_binary_windows_wheel_py3.6
python_version: '3.6'
- binary_wheel_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_windows_wheel_py3.6_upload
requires:
- nightly_binary_windows_wheel_py3.6
- binary_windows_wheel:
filters:
branches:
only: nightly
name: nightly_binary_windows_wheel_py3.7
python_version: '3.7'
- binary_wheel_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_windows_wheel_py3.7_upload
requires:
- nightly_binary_windows_wheel_py3.7
- binary_windows_wheel:
filters:
branches:
only: nightly
name: nightly_binary_windows_wheel_py3.8
python_version: '3.8'
- binary_wheel_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_windows_wheel_py3.8_upload
requires:
- nightly_binary_windows_wheel_py3.8
- binary_linux_conda:
filters:
branches:
Expand Down Expand Up @@ -699,6 +798,48 @@ workflows:
name: nightly_binary_macos_conda_py3.8_upload
requires:
- nightly_binary_macos_conda_py3.8
- binary_windows_conda:
filters:
branches:
only: nightly
name: nightly_binary_windows_conda_py3.6
python_version: '3.6'
- binary_conda_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_windows_conda_py3.6_upload
requires:
- nightly_binary_windows_conda_py3.6
- binary_windows_conda:
filters:
branches:
only: nightly
name: nightly_binary_windows_conda_py3.7
python_version: '3.7'
- binary_conda_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_windows_conda_py3.7_upload
requires:
- nightly_binary_windows_conda_py3.7
- binary_windows_conda:
filters:
branches:
only: nightly
name: nightly_binary_windows_conda_py3.8
python_version: '3.8'
- binary_conda_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_windows_conda_py3.8_upload
requires:
- nightly_binary_windows_conda_py3.8
docker_build:
triggers:
- schedule:
Expand Down
39 changes: 39 additions & 0 deletions .circleci/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,45 @@ jobs:
paths:
- "*"

binary_windows_wheel:
<<: *binary_common
executor:
name: windows-cpu
steps:
- checkout
- run:
name: build
command: |
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
conda activate base
bash packaging/build_wheel.sh
- store_artifacts:
path: dist
- persist_to_workspace:
root: dist
paths:
- "*"

binary_windows_conda:
<<: *binary_common
executor:
name: windows-cpu
steps:
- checkout
- run:
name: build
command: |
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
conda activate base
conda install -yq conda-build "conda-package-handling!=1.5.0"
bash packaging/build_conda.sh
- store_artifacts:
path: C:/tools/miniconda3/conda-bld/win-64
- persist_to_workspace:
root: C:/tools/miniconda3/conda-bld/win-64
paths:
- "*"

# Requires org-member context
binary_conda_upload:
docker:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/regenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
def build_workflows(prefix='', upload=False, filter_branch=None, indentation=6):
w = []
for btype in ["wheel", "conda"]:
for os_type in ["linux", "macos"]:
for os_type in ["linux", "macos", "windows"]:
for python_version in PYTHON_VERSIONS:
w += build_workflow_pair(btype, os_type, python_version, filter_branch, prefix, upload)

Expand Down
11 changes: 9 additions & 2 deletions packaging/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ export BUILD_TYPE="wheel"
export NO_CUDA_PACKAGE=1
setup_env 0.6.0
setup_wheel_python
"$script_dir/build_from_source.sh" "$(pwd)" # Build static dependencies
if [[ "$OSTYPE" != "msys" ]]; then
"$script_dir/build_from_source.sh" "$(pwd)" # Build static dependencies
fi
pip_install numpy future
setup_pip_pytorch_version
python setup.py clean
IS_WHEEL=1 python setup.py bdist_wheel
if [[ "$OSTYPE" == "msys" ]]; then
python_tag="$(echo "cp$PYTHON_VERSION" | tr -d '.')"
IS_WHEEL=1 python setup.py bdist_wheel --plat-name win_amd64 --python-tag $python_tag
else
IS_WHEEL=1 python setup.py bdist_wheel
fi
2 changes: 1 addition & 1 deletion packaging/pkg_helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ retry () {
#
# Precondition: If Linux, you are in a soumith/manylinux-cuda* Docker image
setup_wheel_python() {
if [[ "$(uname)" == Darwin ]]; then
if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then
eval "$(conda shell.bash hook)"
conda env remove -n "env$PYTHON_VERSION" || true
conda create -yn "env$PYTHON_VERSION" python="$PYTHON_VERSION"
Expand Down

0 comments on commit e3a4708

Please sign in to comment.