Skip to content
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

Rewrite our packaging from scratch #217

Merged
merged 27 commits into from
Aug 7, 2019
Merged

Rewrite our packaging from scratch #217

merged 27 commits into from
Aug 7, 2019

Conversation

ezyang
Copy link
Contributor

@ezyang ezyang commented Aug 7, 2019

Structure of the PR:

  • New entry points are packaging/build_wheel.sh and packaging/build_conda.sh. The only mandatory environment variable you have to set is PYTHON_VERSION
  • CircleCI configuration uses 2.1-style parametrized builds to let you toggle python version, etc. as you do builds. We create a separate job per build configuration for maximum parallelism
  • build_tools/packaging got moved to packaging, to be in-line with directory structure in torchvision
  • The build_conda.sh and build_wheel.sh delegate most of the heavy lifting to pkg_helpers.bash, which defines a number of bash functions for performing common operations. The intent is that I'll copy-paste this file between other domain API projects.
  • TORCHAUDIO_ prefix removed from envvars, so that I can more easily share packaging scripts between projects
  • BUILD_VERSION is completely gone; just change the version number if you need to rebuild
  • No more logic for cloning and checking out a fresh copy of torchaudio

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
setup_python() {
if [[ "$(uname)" == Darwin ]]; then
eval "$(conda shell.bash hook)"
conda create -yn "env$PYTHON_VERSION" python="$PYTHON_VERSION"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if such an env is already created, and potentially corrupted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    conda env remove -n "env$PYTHON_VERSION" || true

:)


build:
number: {{ environ.get('TORCHAUDIO_BUILD_NUMBER') }}
string: py{{py}}_{{environ.get('TORCHAUDIO_BUILD_NUMBER')}}
string: py{{py}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont have a BUILD_NUMBER, are you sure you will never botch a binary build ever?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking is, if I botch build of 1.2.0, then I will next build 1.2.0.post2 (because I don't get build number in pip wheels). Now the version has changed and I don't need it. But I could be wrong!

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
@ezyang ezyang merged commit cd185d1 into master Aug 7, 2019
ezyang added a commit to pytorch/vision that referenced this pull request Aug 7, 2019
Following a similar line of inquiry to pytorch/audio#217
ezyang added a commit to pytorch/vision that referenced this pull request Aug 7, 2019
Following a similar line of inquiry to pytorch/audio#217
@jamarshon jamarshon deleted the pr/packaging-rewrite branch August 8, 2019 02:26
ezyang added a commit that referenced this pull request Aug 8, 2019
* New entry points are packaging/build_wheel.sh and packaging/build_conda.sh. The only mandatory environment variable you have to set is PYTHON_VERSION
* CircleCI configuration uses 2.1-style parametrized builds to let you toggle python version, etc. as you do builds. We create a separate job per build configuration for maximum parallelism
* build_tools/packaging got moved to packaging, to be in-line with directory structure in torchvision
* The build_conda.sh and build_wheel.sh delegate most of the heavy lifting to pkg_helpers.bash, which defines a number of bash functions for performing common operations. The intent is that I'll copy-paste this file between other domain API projects.
* TORCHAUDIO_ prefix removed from envvars, so that I can more easily share packaging scripts between projects
* BUILD_VERSION is completely gone; just change the version number if you need to rebuild
* No more logic for cloning and checking out a fresh copy of torchaudio
ezyang added a commit to pytorch/vision that referenced this pull request Aug 8, 2019
* Rewrite torchvision packaging (#1209)

Following a similar line of inquiry to pytorch/audio#217

* Packaging fixes (#1214)

Add uploading support, make CUDA builds actually work.

* 0.4.0 parameters

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Actually upload wheels (please port to master)

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Put macos binaries in the right place

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Propagate more environment variables.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Change the version number

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Go time

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
ezyang added a commit that referenced this pull request Aug 8, 2019
* Rewrite our packaging from scratch (#217)

* New entry points are packaging/build_wheel.sh and packaging/build_conda.sh. The only mandatory environment variable you have to set is PYTHON_VERSION
* CircleCI configuration uses 2.1-style parametrized builds to let you toggle python version, etc. as you do builds. We create a separate job per build configuration for maximum parallelism
* build_tools/packaging got moved to packaging, to be in-line with directory structure in torchvision
* The build_conda.sh and build_wheel.sh delegate most of the heavy lifting to pkg_helpers.bash, which defines a number of bash functions for performing common operations. The intent is that I'll copy-paste this file between other domain API projects.
* TORCHAUDIO_ prefix removed from envvars, so that I can more easily share packaging scripts between projects
* BUILD_VERSION is completely gone; just change the version number if you need to rebuild
* No more logic for cloning and checking out a fresh copy of torchaudio

* Setup cuda_suffix (#218)

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Add uploading support (#220)

Also bugfixes and updates to the packaging scripts.

* Finish up and set parameters

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Updates from vision

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Go time

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants