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

Delete conda builds #1367

Merged
merged 21 commits into from
Nov 25, 2024
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
15 changes: 2 additions & 13 deletions .github/scripts/validate_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,10 @@
# LICENSE file in the root directory of this source tree.

AWS_ENABLED=1
if [[ ${MATRIX_PACKAGE_TYPE} = "conda" ]]; then

if [[ "${MATRIX_PYTHON_VERSION}" = "3.11" ]]; then
PYTORCH_CONDA_CHANNEL="malfet -c ${PYTORCH_CONDA_CHANNEL}"
fi
# shellcheck disable=SC2086
pip install ${PYTORCH_PIP_PREFIX:-} torchdata --extra-index-url "${PYTORCH_PIP_DOWNLOAD_URL}"

# shellcheck disable=SC2086
conda install -y torchdata -c ${PYTORCH_CONDA_CHANNEL}
if [[ ${TARGET_OS:-} = "windows" ]]; then
AWS_ENABLED=0
fi
else
# shellcheck disable=SC2086
pip install ${PYTORCH_PIP_PREFIX:-} torchdata --extra-index-url "${PYTORCH_PIP_DOWNLOAD_URL}"
fi

case "${AWS_ENABLED}" in
"0")
Expand Down
155 changes: 2 additions & 153 deletions .github/workflows/_build_test_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ on:
secrets:
PYPI_TOKEN:
required: false
CONDA_PYTORCHBOT_TOKEN:
required: false
CONDA_TEST_PYTORCHBOT_TOKEN:
required: false
CONDA_NIGHTLY_PYTORCHBOT_TOKEN:
required: false

permissions:
id-token: write
Expand Down Expand Up @@ -214,156 +208,11 @@ jobs:
--password "$PYPI_TOKEN" \
torchdata*.whl

conda_build_test:
needs: get_release_type
runs-on: ${{ matrix.os }}
container: ${{ startsWith( matrix.os, 'ubuntu' ) && 'pytorch/manylinux-cpu' || null }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
python-version:
- 3.9
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- name: Checkout Source Repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
submodules: recursive
- name: Determine if build AWSSDK
shell: bash -l {0}
run: |
BUILD_S3=0
echo "value=$BUILD_S3" >> $GITHUB_OUTPUT
id: build_s3
- name: Add temp runner environment variables
shell: bash -l {0}
run: |
echo "MINICONDA_INSTALL_PATH=${RUNNER_TEMP}/miniconda" >> "${GITHUB_ENV}"
echo "CONDA_ENV_PATH=${RUNNER_TEMP}/conda_build_env" >> "${GITHUB_ENV}"
- name: Create Conda Env on Windows
if: ${{ startsWith( matrix.os, 'windows' ) }}
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
activate-environment: ${{ env.CONDA_ENV_PATH }}
- name: Build TorchData for Conda
shell: bash -l {0}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
PYTORCH_VERSION: ${{ inputs.pytorch_version }}
BUILD_S3: ${{ steps.build_s3.outputs.value }}
run: |
set -ex
if ${{ ! startsWith( matrix.os, 'windows' ) }}; then
source "${MINICONDA_INSTALL_PATH}/etc/profile.d/conda.sh"
fi
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 index ./conda-bld
- name: Upload Conda Package to Github
if: always()
uses: actions/upload-artifact@v3
with:
name: torchdata-artifact
path: conda-bld/*/torchdata-*.tar.bz2

conda_upload:
if: always() && inputs.branch != '' && inputs.do-upload == true
needs: [get_release_type, conda_build_test]
runs-on: ubuntu-latest
container: continuumio/miniconda3
environment: pytorchbot-env
outputs:
upload: ${{ steps.trigger_upload.outputs.value }}
steps:
- name: Download Artifacts from Github
continue-on-error: true
uses: actions/download-artifact@v3
with:
name: torchdata-artifact
- name: Determine if Conda Uploading is needed
run: |
upload=false
for pkg in ./*/torchdata-*.tar.bz2; do
upload=true
break
done
echo "value=$upload" >> $GITHUB_OUTPUT
id: trigger_upload
- name: Display All TorchData Conda Package
if: steps.trigger_upload.outputs.value == 'true'
run: ls -lh ./*/torchdata-*.tar.bz2
- name: Upload Packages to Conda
if: steps.trigger_upload.outputs.value == 'true'
shell: bash -l {0}
env:
CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
CONDA_NIGHTLY_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_NIGHTLY_PYTORCHBOT_TOKEN }}
CONDA_TEST_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_TEST_PYTORCHBOT_TOKEN }}
run: |
conda create -y --name conda_upload_env
conda activate conda_upload_env

conda install -yq anaconda-client
conda install -c conda-forge -yq jq

if [[ ${{ needs.get_release_type.outputs.type }} == 'official' ]]; then
CONDA_CHANNEL=pytorch
CONDA_TOKEN=${CONDA_PYTORCHBOT_TOKEN}
elif [[ ${{ needs.get_release_type.outputs.type }} == 'test' ]]; then
CONDA_CHANNEL=pytorch-${{ needs.get_release_type.outputs.type }}
CONDA_TOKEN=${CONDA_TEST_PYTORCHBOT_TOKEN}
else
CONDA_CHANNEL=pytorch-${{ needs.get_release_type.outputs.type }}
CONDA_TOKEN=${CONDA_NIGHTLY_PYTORCHBOT_TOKEN}
fi

if [[ ${{ needs.get_release_type.outputs.type }} == 'nightly' ]]; then
# Loop over all platforms [win-64, osx-64, linux-64]
for subdir in $(find . -type f -name '*torchdata*.tar.bz2' | sed -r 's|/[^/]+$||' | uniq | cut -f2 -d/) ; do
version=""
# Find existing conda packages on pytorch nightly
for val in $(conda search --json torchdata --channel=$CONDA_CHANNEL --subdir=$subdir | jq -r '.[][] | .version, .build'); do
if [[ -z $version ]]; then
version=$val
else
build=$val
# Check if a new conda package built based on the same Python version and platform exists
for new_package in ./$subdir/torchdata-*-$build.tar.bz2; do
if [[ -f "$new_package" ]]; then
echo "Removing $CONDA_CHANNEL/torchdata/$version/$subdir/torchdata-$version-$build.tar.bz2"
anaconda -t "${CONDA_TOKEN}" remove -f "$CONDA_CHANNEL/torchdata/$version/$subdir/torchdata-$version-$build.tar.bz2"
break
fi
done
version=""
build=""
fi
done
# Upload new conda packages per subdir
anaconda -t "${CONDA_TOKEN}" upload ./$subdir/torchdata-*.tar.bz2 -u "$CONDA_CHANNEL" --label main --no-progress --force
done
else
anaconda -t "${CONDA_TOKEN}" upload ./*/torchdata-*.tar.bz2 -u "$CONDA_CHANNEL" --label main --no-progress --force
fi

build_docs:
if: |
always() && inputs.branch != '' &&
( needs.wheel_upload.outputs.upload == 'true' || needs.conda_upload.outputs.upload == 'true' )
needs: [get_release_type, wheel_upload, conda_upload]
( needs.wheel_upload.outputs.upload == 'true')
needs: [get_release_type, wheel_upload]
runs-on: ubuntu-latest
steps:
- name: Setup Python 3.9
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/build-conda-m1.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/build_conda_linux.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/nightly_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ jobs:
branch: "main"
pre_dev_release: true
pytorch_version: ""
secrets:
CONDA_NIGHTLY_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_NIGHTLY_PYTORCHBOT_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/pull_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- .github/workflows/pull_release.yml
- .github/workflows/_build_test_upload.yml

permissions:
contents: write
id-token: write

Comment on lines +10 to +13
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was getting this error

The workflow is not valid. .github/workflows/pull_release.yml (Line: 11, Col: 3): Error calling workflow 'pytorch/data/.github/workflows/_build_test_upload.yml@45dc471d9a16eb4cf482f38b9167f99a13cd55d4'. The workflow is requesting 'contents: write, id-token: write', but is only allowed 'contents: read, id-token: none'.

https://github.com/pytorch/data/actions/runs/11864790565

After I added these lines it worked. I can try to again remove these and see what happens now.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes this maybe needed

jobs:
build_test_upload:
if: github.repository == 'pytorch/data'
Expand All @@ -16,5 +20,3 @@ jobs:
pre_dev_release: true
pytorch_version: ""
do-upload: false
secrets:
CONDA_TEST_PYTORCHBOT_TOKEN: ""
2 changes: 0 additions & 2 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ jobs:
branch: "release/0.9"
pre_dev_release: true
pytorch_version: "2.5.0"
secrets:
CONDA_TEST_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_TEST_PYTORCHBOT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/validate-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
validate-binaries:
uses: pytorch/test-infra/.github/workflows/validate-domain-library.yml@main
with:
package_type: "conda,wheel"
package_type: "wheel"
os: ${{ inputs.os }}
channel: ${{ inputs.channel }}
repository: "pytorch/data"
Expand Down
4 changes: 2 additions & 2 deletions torchdata/stateful_dataloader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ handles aggregation and distribution of state across multiprocess workers (but n

## Installation

`torchdata.stateful_dataloader` is currently available on the `torchdata` Nightly build.
`torchdata.stateful_dataloader` is currently available in `torchdata>=0.8.0`.

Using pip:

```bash
pip install --pre torchdata --index-url https://download.pytorch.org/whl/nightly/cpu
pip install torchdata>=0.8.0
```

Using conda:
Expand Down
Loading