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

Validate binaries for nightly/release testing #2010

Merged
merged 1 commit into from
Dec 20, 2022
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
31 changes: 31 additions & 0 deletions .github/scripts/validate_binaries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -ex

if [[ ${TARGET_OS} == 'windows' ]]; then
source /c/Jenkins/Miniconda3/etc/profile.d/conda.sh
else
eval "$(conda shell.bash hook)"
fi

conda create -y -n ${ENV_NAME} python=${DESIRED_PYTHON} numpy
conda activate ${ENV_NAME}
export CONDA_CHANNEL="pytorch"
export PIP_DOWNLOAD_URL="https://download.pytorch.org/whl/cpu"
export PIP_PREFIX=""

if [[ ${CHANNEL} = 'nightly' ]]; then
export PIP_PREFIX="--pre "
export PIP_DOWNLOAD_URL="https://download.pytorch.org/whl/nightly/cpu"
export CONDA_CHANNEL="pytorch-nightly"
elif [[ ${CHANNEL} = 'test' ]]; then
export PIP_DOWNLOAD_URL="https://download.pytorch.org/whl/test/cpu"
export CONDA_CHANNEL="pytorch-test"
fi

if [[ ${PACKAGE_TYPE} = 'conda' ]]; then
conda install -y torchtext pytorch -c ${CONDA_CHANNEL}
else
pip install ${PIP_PREFIX} torchtext torch --extra-index-url ${PIP_DOWNLOAD_URL}
fi

python ./test/smoke_tests/smoke_tests.py
55 changes: 55 additions & 0 deletions .github/workflows/validate-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Validate binaries

on:
workflow_call:
inputs:
channel:
description: "Channel to use (nightly, test, release, all)"
required: false
type: string
default: release
os:
description: "Operating system to generate for (linux, windows, macos, macos-arm64)"
required: true
type: string
ref:
description: 'Reference to checkout, defaults to empty'
default: ""
required: false
type: string
workflow_dispatch:
inputs:
channel:
description: "Channel to use (nightly, test, release, all)"
required: true
type: choice
options:
- release
- nightly
- test
- all
os:
description: "Operating system to generate for (linux, windows, macos)"
required: true
type: choice
default: all
options:
- windows
- linux
- macos
- all
ref:
description: 'Reference to checkout, defaults to empty'
default: ""
required: false
type: string

jobs:
validate-binaries:
uses: pytorch/builder/.github/workflows/validate-domain-library.yml@main
with:
package_type: "conda,wheel"
os: ${{ inputs.os }}
channel: ${{ inputs.channel }}
repository: "pytorch/text"
smoke_test: "./.github/scripts/validate_binaries.sh"
27 changes: 27 additions & 0 deletions .github/workflows/validate-nightly-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Scheduled validation of the nightly binaries
name: cron

on:
schedule:
# At 5:30 pm UTC (7:30 am PDT)
- cron: "30 17 * * *"
# Have the ability to trigger this job manually through the API
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/validate-nightly-binaries.yml
- .github/workflows/validate-binaries.yml
- .github/scripts/validate-binaries.sh
pull_request:
paths:
- .github/workflows/validate-nightly-binaries.yml
- .github/workflows/validate-binaries.yml
- .github/scripts/validate-binaries.sh
jobs:
nightly:
uses: ./.github/workflows/validate-binaries.yml
with:
channel: nightly
os: all