Skip to content

add workflow to test conda installs #21

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

Merged
merged 1 commit into from
Oct 19, 2021
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
33 changes: 33 additions & 0 deletions .github/scripts/test_conda_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -eux -o pipefail

case ${GPUARCH_PKG} in
cpuonly)
GPUARCH_IDENTIFIER="cpu"
;;
cudatoolkit=11.3)
GPUARCH_IDENTIFIER='cu.*11\?.3'
;;
esac

TMPFILE=$(mktemp)

EXTRA_CONDA_CHANNEL_FLAGS=${EXTRA_CONDA_CHANNEL_FLAGS:-}
EXTRA_CONDA_PKGS=${EXTRA_CONDA_PKGS:-}
PYTORCH_CONDA_INSTALL_CHANNEL=${PYTORCH_CONDA_INSTALL_CHANNEL:-pytorch-test}

conda create -y \
-n testenv \
--dry-run \
-c "${PYTORCH_CONDA_INSTALL_CHANNEL}" \
${EXTRA_CONDA_CHANNEL_FLAGS} \
python=${PYTHON_VERSION} \
${EXTRA_CONDA_PKGS} \
"pytorch=${PYTORCH_VERSION}" \
"torchvision=${TORCHVISION_VERSION}" \
"${GPUARCH_PKG}" | tee "${TMPFILE}"

# If the pkg wasn't resolved correctly it'll fail out here
grep "${PYTORCH_CONDA_INSTALL_CHANNEL}/linux-64::pytorch-${PYTORCH_VERSION}.*${GPUARCH_IDENTIFIER}" "${TMPFILE}"
grep "${PYTORCH_CONDA_INSTALL_CHANNEL}/linux-64::torchvision-${TORCHVISION_VERSION}.*${GPUARCH_IDENTIFIER}" "${TMPFILE}"
32 changes: 32 additions & 0 deletions .github/workflows/test_conda_installs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test Conda Installations

on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/test_conda_installs.yml

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
gpuarch_pkg: [cpuonly, cudatoolkit=11.3]
container: continuumio/miniconda3
env:
GPUARCH_PKG: ${{ matrix.gpuarch_pkg }}
PYTHON_VERSION: 3.7 # TODO: Update this to include more versions
steps:
- uses: actions/checkout@v2
- name: Populate test versions into env
run:
cat TEST_VERSIONS >> "${GITHUB_ENV}"
- name: Test
run: |
.github/scripts/test_conda_install.sh
- name: Test with conda-forge
run: |
EXTRA_CONDA_CHANNEL_FLAGS="-c conda-forge" .github/scripts/test_conda_install.sh
- name: Test with conda-forge and extra pkgs (opencv, dlib)
run: |
EXTRA_CONDA_CHANNEL_FLAGS="-c conda-forge" EXTRA_CONDA_PKGS="opencv dlib" .github/scripts/test_conda_install.sh
2 changes: 2 additions & 0 deletions TEST_VERSIONS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PYTORCH_VERSION=1.10.0
TORCHVISION_VERSION=0.11.0