Skip to content

Commit

Permalink
add binary build
Browse files Browse the repository at this point in the history
  • Loading branch information
mthrok committed May 13, 2020
1 parent 32bc374 commit e94e1a2
Show file tree
Hide file tree
Showing 12 changed files with 609 additions and 32 deletions.
267 changes: 259 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
# will set environment variables which we need to propagate
# to build_wheel.sh
command: |
brew install cmake
curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
sh conda.sh -b
source $HOME/miniconda3/bin/activate
Expand Down Expand Up @@ -287,13 +288,48 @@ jobs:


workflows:
# build:
# jobs:
# - circleci_consistency
#
# - binary_win_conda:
# name: torchtext_win_py3.6
# python_version: "3.6"
build:
jobs:
- circleci_consistency
- binary_linux_wheel:
name: binary_linux_wheel_py3.6
python_version: '3.6'
- binary_linux_wheel:
name: binary_linux_wheel_py3.7
python_version: '3.7'
- binary_linux_wheel:
name: binary_linux_wheel_py3.8
python_version: '3.8'
- binary_macos_wheel:
name: binary_macos_wheel_py3.6
python_version: '3.6'
- binary_macos_wheel:
name: binary_macos_wheel_py3.7
python_version: '3.7'
- binary_macos_wheel:
name: binary_macos_wheel_py3.8
python_version: '3.8'
- binary_linux_conda:
name: binary_linux_conda_py3.6
python_version: '3.6'
- binary_linux_conda:
name: binary_linux_conda_py3.7
python_version: '3.7'
- binary_linux_conda:
name: binary_linux_conda_py3.8
python_version: '3.8'
- binary_macos_conda:
name: binary_macos_conda_py3.6
python_version: '3.6'
- binary_macos_conda:
name: binary_macos_conda_py3.7
python_version: '3.7'
- binary_macos_conda:
name: binary_macos_conda_py3.8
python_version: '3.8'
# - binary_win_conda:
# name: torchtext_win_py3.6
# python_version: "3.6"
unittest:
jobs:
- unittest_linux:
Expand All @@ -311,7 +347,222 @@ workflows:
filters:
branches:
only: nightly
#
- binary_linux_wheel:
filters:
branches:
only: nightly
name: nightly_binary_linux_wheel_py3.6
python_version: '3.6'
- binary_wheel_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_linux_wheel_py3.6_upload
requires:
- nightly_binary_linux_wheel_py3.6
- smoke_test_linux_pip:
filters:
branches:
only: nightly
name: nightly_binary_linux_wheel_py3.6_smoke_test_pip
python_version: '3.6'
requires:
- nightly_binary_linux_wheel_py3.6_upload
- binary_linux_wheel:
filters:
branches:
only: nightly
name: nightly_binary_linux_wheel_py3.7
python_version: '3.7'
- binary_wheel_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_linux_wheel_py3.7_upload
requires:
- nightly_binary_linux_wheel_py3.7
- smoke_test_linux_pip:
filters:
branches:
only: nightly
name: nightly_binary_linux_wheel_py3.7_smoke_test_pip
python_version: '3.7'
requires:
- nightly_binary_linux_wheel_py3.7_upload
- binary_linux_wheel:
filters:
branches:
only: nightly
name: nightly_binary_linux_wheel_py3.8
python_version: '3.8'
- binary_wheel_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_linux_wheel_py3.8_upload
requires:
- nightly_binary_linux_wheel_py3.8
- smoke_test_linux_pip:
filters:
branches:
only: nightly
name: nightly_binary_linux_wheel_py3.8_smoke_test_pip
python_version: '3.8'
requires:
- nightly_binary_linux_wheel_py3.8_upload
- binary_macos_wheel:
filters:
branches:
only: nightly
name: nightly_binary_macos_wheel_py3.6
python_version: '3.6'
- binary_wheel_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_macos_wheel_py3.6_upload
requires:
- nightly_binary_macos_wheel_py3.6
- binary_macos_wheel:
filters:
branches:
only: nightly
name: nightly_binary_macos_wheel_py3.7
python_version: '3.7'
- binary_wheel_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_macos_wheel_py3.7_upload
requires:
- nightly_binary_macos_wheel_py3.7
- binary_macos_wheel:
filters:
branches:
only: nightly
name: nightly_binary_macos_wheel_py3.8
python_version: '3.8'
- binary_wheel_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_macos_wheel_py3.8_upload
requires:
- nightly_binary_macos_wheel_py3.8
- binary_linux_conda:
filters:
branches:
only: nightly
name: nightly_binary_linux_conda_py3.6
python_version: '3.6'
- binary_conda_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_linux_conda_py3.6_upload
requires:
- nightly_binary_linux_conda_py3.6
- smoke_test_linux_conda:
filters:
branches:
only: nightly
name: nightly_binary_linux_conda_py3.6_smoke_test_conda
python_version: '3.6'
requires:
- nightly_binary_linux_conda_py3.6_upload
- binary_linux_conda:
filters:
branches:
only: nightly
name: nightly_binary_linux_conda_py3.7
python_version: '3.7'
- binary_conda_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_linux_conda_py3.7_upload
requires:
- nightly_binary_linux_conda_py3.7
- smoke_test_linux_conda:
filters:
branches:
only: nightly
name: nightly_binary_linux_conda_py3.7_smoke_test_conda
python_version: '3.7'
requires:
- nightly_binary_linux_conda_py3.7_upload
- binary_linux_conda:
filters:
branches:
only: nightly
name: nightly_binary_linux_conda_py3.8
python_version: '3.8'
- binary_conda_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_linux_conda_py3.8_upload
requires:
- nightly_binary_linux_conda_py3.8
- smoke_test_linux_conda:
filters:
branches:
only: nightly
name: nightly_binary_linux_conda_py3.8_smoke_test_conda
python_version: '3.8'
requires:
- nightly_binary_linux_conda_py3.8_upload
- binary_macos_conda:
filters:
branches:
only: nightly
name: nightly_binary_macos_conda_py3.6
python_version: '3.6'
- binary_conda_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_macos_conda_py3.6_upload
requires:
- nightly_binary_macos_conda_py3.6
- binary_macos_conda:
filters:
branches:
only: nightly
name: nightly_binary_macos_conda_py3.7
python_version: '3.7'
- binary_conda_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_macos_conda_py3.7_upload
requires:
- nightly_binary_macos_conda_py3.7
- binary_macos_conda:
filters:
branches:
only: nightly
name: nightly_binary_macos_conda_py3.8
python_version: '3.8'
- binary_conda_upload:
context: org-member
filters:
branches:
only: nightly
name: nightly_binary_macos_conda_py3.8_upload
requires:
- nightly_binary_macos_conda_py3.8
docker_build:
triggers:
- schedule:
Expand Down
17 changes: 9 additions & 8 deletions .circleci/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
# will set environment variables which we need to propagate
# to build_wheel.sh
command: |
brew install cmake
curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
sh conda.sh -b
source $HOME/miniconda3/bin/activate
Expand Down Expand Up @@ -287,13 +288,13 @@ jobs:


workflows:
# build:
# jobs:
# - circleci_consistency
# {{ build_workflows() }}
# - binary_win_conda:
# name: torchtext_win_py3.6
# python_version: "3.6"
build:
jobs:
- circleci_consistency
{{ build_workflows() }}
# - binary_win_conda:
# name: torchtext_win_py3.6
# python_version: "3.6"
unittest:
jobs:
{{ unittest_workflows() }}
Expand All @@ -303,7 +304,7 @@ workflows:
filters:
branches:
only: nightly
# {{ build_workflows(prefix="nightly_", filter_branch="nightly", upload=True) }}
{{ build_workflows(prefix="nightly_", filter_branch="nightly", upload=True) }}
docker_build:
triggers:
- schedule:
Expand Down
4 changes: 0 additions & 4 deletions .circleci/regenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@


def build_workflows(prefix='', upload=False, filter_branch=None, indentation=6):
'''
w = []
for btype in ["wheel", "conda"]:
for os_type in ["linux", "macos"]:
for python_version in PYTHON_VERSIONS:
w += build_workflow_pair(btype, os_type, python_version, filter_branch, prefix, upload)
return indent(indentation, w)
'''
return ''


def build_workflow_pair(btype, os_type, python_version, filter_branch, prefix='', upload=False):
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,5 @@ venv.bak/
# vim
*.swp
*.swo

torchtext/version.py
12 changes: 12 additions & 0 deletions packaging/build_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -ex

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
. "$script_dir/pkg_helpers.bash"

export BUILD_TYPE="conda"
export NO_CUDA_PACKAGE=1
setup_env 0.6.0
export SOURCE_ROOT_DIR="$PWD"
setup_conda_pytorch_constraint
conda build $CONDA_CHANNEL_FLAGS --no-anaconda-upload --python "$PYTHON_VERSION" packaging/torchtext
15 changes: 15 additions & 0 deletions packaging/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -ex

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
. "$script_dir/pkg_helpers.bash"

export BUILD_TYPE="wheel"
export NO_CUDA_PACKAGE=1
setup_env 0.6.0
setup_wheel_python
pip_install numpy future
setup_pip_pytorch_version
git submodule update --init --recursive
python setup.py clean
python setup.py bdist_wheel
Loading

0 comments on commit e94e1a2

Please sign in to comment.