Skip to content

Commit

Permalink
Figure it out
Browse files Browse the repository at this point in the history
  • Loading branch information
huydhn committed Dec 20, 2023
1 parent cd8857a commit fb406e1
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 29 deletions.
41 changes: 21 additions & 20 deletions .github/workflows/_build_test_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ jobs:
- 3.9
- "3.10"
- "3.11"
- "3.12"
- pure
exclude:
- os: macos-latest
Expand Down Expand Up @@ -108,13 +107,12 @@ jobs:
bash "${MINICONDA_INSTALL_PATH_MACOS}/miniconda.sh" -b -u -p "${MINICONDA_INSTALL_PATH_MACOS}"
rm -rf "${MINICONDA_INSTALL_PATH_MACOS}/miniconda.sh"
echo "${MINICONDA_INSTALL_PATH_MACOS}/bin" >> "$GITHUB_PATH"
echo "CONDA_EXE=${MINICONDA_INSTALL_PATH_MACOS}/bin/conda" >> "$GITHUB_ENV"
- name: Setup Python ${{ matrix.python-version }} on MacOS
if: ${{ startsWith( matrix.os, 'macos' ) }}
shell: bash -l {0}
run: |
$CONDA_EXE init bash
$CONDA_EXE create -y --name wheel_build_env python=${{ matrix.python-version }}
conda init bash
conda create -y --name wheel_build_env python=${{ matrix.python-version }}
- name: Setup msbuild on Windows
if: startsWith( matrix.os, 'windows' )
uses: microsoft/[email protected]
Expand All @@ -139,7 +137,7 @@ jobs:
fi
else
if ${{ startsWith( matrix.os, 'macos' ) }}; then
$CONDA_EXE activate wheel_build_env
conda activate wheel_build_env
fi
pip install cmake ninja
echo "/home/runner/.local/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -171,8 +169,8 @@ jobs:
fi
fi
if ${{ startsWith( matrix.os, 'macos' ) }}; then
$CONDA_EXE activate wheel_build_env
$CONDA_EXE run -n wheel_build_env packaging/build_wheel.sh
conda activate wheel_build_env
conda run -n wheel_build_env packaging/build_wheel.sh
else
packaging/build_wheel.sh
fi
Expand All @@ -189,7 +187,7 @@ jobs:
pip3 install auditwheel
fi
if ${{ startsWith( matrix.os, 'macos' ) }}; then
$CONDA_EXE activate wheel_build_env
conda activate wheel_build_env
fi
pip3 install pkginfo
for pkg in dist/torchdata*.whl; do
Expand All @@ -216,8 +214,8 @@ jobs:
source packaging/manylinux/python_helper.sh
fi
if ${{ startsWith( matrix.os, 'macos' ) }}; then
$CONDA_EXE activate wheel_build_env
$CONDA_EXE run -n wheel_build_env pip3 install dist/torchdata*.whl
conda activate wheel_build_env
conda run -n wheel_build_env pip3 install dist/torchdata*.whl
else
pip3 install dist/torchdata*.whl
fi
Expand All @@ -233,8 +231,8 @@ jobs:
source packaging/manylinux/python_helper.sh
fi
if ${{ startsWith( matrix.os, 'macos' ) }}; then
$CONDA_EXE activate wheel_build_env
$CONDA_EXE run -n wheel_build_env python test/smoke_test/smoke_test.py
conda activate wheel_build_env
conda run -n wheel_build_env python test/smoke_test/smoke_test.py
else
if ${{ matrix.python-version == 'pure' }}; then
python test/smoke_test/smoke_test.py --no-s3
Expand Down Expand Up @@ -320,7 +318,6 @@ jobs:
- 3.9
- "3.10"
- "3.11"
- "3.12"
steps:
- name: Checkout Source Repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -363,18 +360,17 @@ jobs:
bash "${MINICONDA_INSTALL_PATH}/miniconda.sh" -b -u -p "${MINICONDA_INSTALL_PATH}"
rm -rf "${MINICONDA_INSTALL_PATH}/miniconda.sh"
echo "${MINICONDA_INSTALL_PATH}/bin" >> "$GITHUB_PATH"
echo "CONDA_EXE=${MINICONDA_INSTALL_PATH}/bin/conda" >> "$GITHUB_ENV"
${MINICONDA_INSTALL_PATH}/bin/conda init bash
- name: Create Conda Env on MacOS and Linux
if: ${{ ! startsWith( matrix.os, 'windows' ) }}
shell: bash -l {0}
run: |
source "${MINICONDA_INSTALL_PATH}/etc/profile.d/conda.sh"
if [[ ${{ matrix.python-version }} = "3.12" ]]; then
$CONDA_EXE create -y -p "${CONDA_ENV_PATH}" python=3.9
if [[ ${{ matrix.python-version }} = "3.11" ]]; then
conda create -y -p "${CONDA_ENV_PATH}" python=3.8
else
$CONDA_EXE create -y -p "${CONDA_ENV_PATH}" python=${{ matrix.python-version }}
conda create -y -p "${CONDA_ENV_PATH}" python=${{ matrix.python-version }}
fi
- name: Build TorchData for Conda
shell: bash -l {0}
Expand All @@ -387,10 +383,15 @@ jobs:
if ${{ ! startsWith( matrix.os, 'windows' ) }}; then
source "${MINICONDA_INSTALL_PATH}/etc/profile.d/conda.sh"
fi
$CONDA_EXE activate "${CONDA_ENV_PATH}"
$CONDA_EXE install -yq conda-build
conda activate "${CONDA_ENV_PATH}"
if [[ "${PYTHON_VERSION}" = "3.11" ]]; then
conda install -yq conda-build -c malfet -c conda-forge
export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c malfet"
else
conda install -yq conda-build
fi
packaging/build_conda.sh
$CONDA_EXE index ./conda-bld
conda index ./conda-bld
- name: Upload Conda Package to Github
if: always()
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-conda-m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ jobs:
env-var-script: packaging/env-var-script.txt
smoke-test-script: test/smoke_test/smoke_test.py
runner-type: macos-m1-12
trigger-event: dev
trigger-event: ${{ github.event_name }}
secrets:
CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels-m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
env-var-script: packaging/env-var-script.txt
runner-type: macos-m1-12
smoke-test-script: test/smoke_test/smoke_test.py
trigger-event: dev
trigger-event: ${{ github.event_name }}
secrets:
AWS_PYTORCH_UPLOADER_ACCESS_KEY_ID: ${{ secrets.AWS_PYTORCH_UPLOADER_ACCESS_KEY_ID }}
AWS_PYTORCH_UPLOADER_SECRET_ACCESS_KEY: ${{ secrets.AWS_PYTORCH_UPLOADER_SECRET_ACCESS_KEY }}
4 changes: 1 addition & 3 deletions .github/workflows/build_conda_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:
smoke-test-script: ${{ matrix.smoke-test-script }}
package-name: ${{ matrix.package-name }}
env-var-script: packaging/env-var-script.txt
# Using "development" as trigger event so these binaries are not uploaded
# to official channels yet
trigger-event: development
trigger-event: ${{ github.event_name }}
secrets:
CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/build_wheels_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ jobs:
smoke-test-script: ${{ matrix.smoke-test-script }}
package-name: ${{ matrix.package-name }}
env-var-script: packaging/env-var-script.txt
# Using "development" as trigger event so these binaries are not uploaded to official channels yet
trigger-event: development
trigger-event: ${{ github.event_name }}
secrets:
AWS_PYTORCH_UPLOADER_ACCESS_KEY_ID: ${{ secrets.PYTORCH_BINARY_AWS_ACCESS_KEY_ID }}
AWS_PYTORCH_UPLOADER_SECRET_ACCESS_KEY: ${{ secrets.PYTORCH_BINARY_AWS_SECRET_ACCESS_KEY }}
3 changes: 1 addition & 2 deletions packaging/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export BUILD_TYPE="wheel"

export SOURCE_ROOT_DIR="$PWD"
setup_env
# Python 3.12 does comes with distutils anymore
pip_install future wheel setuptools
pip_install future wheel
setup_pip_pytorch_version

git submodule update --init --recursive
Expand Down

0 comments on commit fb406e1

Please sign in to comment.