From 30e26b54e21c0389363b63fc2274d97a14a41368 Mon Sep 17 00:00:00 2001 From: atalman Date: Wed, 29 Nov 2023 13:32:43 -0800 Subject: [PATCH] Add checkchannel where package is installed test test test test test test test test test test test --- .github/workflows/build_conda_linux.yml | 23 +++++++++++++++++++--- .github/workflows/build_conda_macos.yml | 24 +++++++++++++++++++---- .github/workflows/build_conda_windows.yml | 23 +++++++++++++++++++--- 3 files changed, 60 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_conda_linux.yml b/.github/workflows/build_conda_linux.yml index 29b40ab1e1..bc9bc7d555 100644 --- a/.github/workflows/build_conda_linux.yml +++ b/.github/workflows/build_conda_linux.yml @@ -180,14 +180,31 @@ jobs: CONSTRAINTS="cpuonly" fi + # From Conda documnetation: + # https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html#specifying-channels-when-installing-packages + # From the command line use --c + # You may specify multiple channels by passing the argument multiple times. + # Priority decreases from left to right - the first argument is higher priority than the second. + # From the command line use --override-channels to only search the specified channel(s), + # rather than any channels configured in .condarc. + ${CONDA_RUN_SMOKE} conda install \ --yes \ --quiet \ + -c "${CONDA_LOCAL_CHANNEL}" \ -c pytorch-"${CHANNEL}" \ -c nvidia \ - -c "${CONDA_LOCAL_CHANNEL}" \ - distr::"${PACKAGE_NAME}" \ - ${CONSTRAINTS} + -c defaults \ + "${PACKAGE_NAME}" \ + ${CONSTRAINTS} \ + --override-channels + + # check for installed package channel + if [[ -z "$(${CONDA_RUN_SMOKE} conda list | grep ${PACKAGE_NAME} | grep ${CONDA_LOCAL_CHANNEL})" ]]; then + echo "${PACKAGE_NAME} is not installed from local channel" + ${CONDA_RUN_SMOKE} conda list + exit 1 + fi if [[ ! -f "${{ inputs.repository }}"/${SMOKE_TEST_SCRIPT} ]]; then echo "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT} not found" diff --git a/.github/workflows/build_conda_macos.yml b/.github/workflows/build_conda_macos.yml index c5e4778a3c..dffc5a455a 100644 --- a/.github/workflows/build_conda_macos.yml +++ b/.github/workflows/build_conda_macos.yml @@ -182,15 +182,31 @@ jobs: export CONDA_RUN_SMOKE="conda run -p ${CONDA_ENV_SMOKE}" export OLD_PATH=${PATH} export PATH="${CONDA_ENV_SMOKE}/bin:${PATH}" - CONDA_LOCAL_CHANNEL="file://$(readlink -f ${{ inputs.repository }}/distr)" + + # From Conda documnetation: + # https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html#specifying-channels-when-installing-packages + # From the command line use --c + # You may specify multiple channels by passing the argument multiple times. + # Priority decreases from left to right - the first argument is higher priority than the second. + # From the command line use --override-channels to only search the specified channel(s), + # rather than any channels configured in .condarc. + ${CONDA_RUN_SMOKE} conda install \ --quiet \ --yes \ - -c pytorch-${CHANNEL} \ -c "${CONDA_LOCAL_CHANNEL}" \ - "distr::"${PACKAGE_NAME}"" \ - "-—solver=classic" + -c pytorch-${CHANNEL} \ + -c defaults \ + "${PACKAGE_NAME}" \ + "--override-channels" + + # check for installed package channel + if [[ -z "$(${CONDA_RUN_SMOKE} conda list | grep ${PACKAGE_NAME} | grep ${CONDA_LOCAL_CHANNEL})" ]]; then + echo "${PACKAGE_NAME} is not installed from local channel" + ${CONDA_RUN_SMOKE} conda list + exit 1 + fi if [[ ! -f "${{ inputs.repository }}"/${SMOKE_TEST_SCRIPT} ]]; then echo "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT} not found" diff --git a/.github/workflows/build_conda_windows.yml b/.github/workflows/build_conda_windows.yml index 4ac0e5d12f..f8f5160007 100644 --- a/.github/workflows/build_conda_windows.yml +++ b/.github/workflows/build_conda_windows.yml @@ -200,14 +200,31 @@ jobs: CONSTRAINTS="cpuonly" fi + # From Conda documnetation: + # https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html#specifying-channels-when-installing-packages + # From the command line use --c + # You may specify multiple channels by passing the argument multiple times. + # Priority decreases from left to right - the first argument is higher priority than the second. + # From the command line use --override-channels to only search the specified channel(s), + # rather than any channels configured in .condarc. + ${CONDA_RUN_SMOKE} conda install \ --quiet \ --yes \ + -c "${CONDA_LOCAL_CHANNEL}" \ -c pytorch-"${CHANNEL}" \ -c nvidia \ - -c "${CONDA_LOCAL_CHANNEL}" \ - distr::"${PACKAGE_NAME}" \ - ${CONSTRAINTS} + -c defaults \ + "${PACKAGE_NAME}" \ + ${CONSTRAINTS} \ + --override-channels + + # check for installed package channel + if [[ -z "$(${CONDA_RUN_SMOKE} conda list | grep ${PACKAGE_NAME} | grep ${CONDA_LOCAL_CHANNEL})" ]]; then + echo "${PACKAGE_NAME} is not installed from local channel" + ${CONDA_RUN_SMOKE} conda list + exit 1 + fi if [[ ! -f "${{ inputs.repository }}"/${SMOKE_TEST_SCRIPT} ]]; then echo "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT} not found"