From 7742c2a17b3e68e484ec40c25a16e4fa9c4a0a44 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 22 Jul 2022 13:28:04 -0700 Subject: [PATCH 01/12] make Linux (de)activate scripts standalone like Windows --- recipe/install_nvcc.sh | 189 -------------------------------- recipe/linux/activate.sh | 110 +++++++++++++++++++ recipe/linux/deactivate.sh | 54 +++++++++ recipe/linux/install_nvcc.sh | 17 +++ recipe/linux/nvcc.sh | 9 ++ recipe/{ => linux}/test_nvcc.sh | 0 recipe/meta.yaml | 4 +- 7 files changed, 192 insertions(+), 191 deletions(-) delete mode 100755 recipe/install_nvcc.sh create mode 100644 recipe/linux/activate.sh create mode 100644 recipe/linux/deactivate.sh create mode 100755 recipe/linux/install_nvcc.sh create mode 100644 recipe/linux/nvcc.sh rename recipe/{ => linux}/test_nvcc.sh (100%) mode change 100755 => 100644 recipe/meta.yaml diff --git a/recipe/install_nvcc.sh b/recipe/install_nvcc.sh deleted file mode 100755 index 1bdf526..0000000 --- a/recipe/install_nvcc.sh +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash - -set -xeuo pipefail - -# Set `CUDA_HOME` in an activation script. -mkdir -p "${PREFIX}/etc/conda/activate.d" -cat > "${PREFIX}/etc/conda/activate.d/${PKG_NAME}_activate.sh" < "${PREFIX}/etc/conda/deactivate.d/${PKG_NAME}_deactivate.sh" < "${PREFIX}/bin/nvcc" <<'EOF' -#!/bin/bash -for arg in "${@}" ; do - case ${arg} in -ccbin) - # If -ccbin argument is already provided, don't add an additional one. - exec "${CUDA_HOME}/bin/nvcc" "${@}" - esac -done -exec "${CUDA_HOME}/bin/nvcc" -ccbin "${CXX}" "${@}" -EOF -chmod +x "${PREFIX}/bin/nvcc" diff --git a/recipe/linux/activate.sh b/recipe/linux/activate.sh new file mode 100644 index 0000000..2939701 --- /dev/null +++ b/recipe/linux/activate.sh @@ -0,0 +1,110 @@ +#!/bin/bash + +# Set `CUDA_HOME` in an activation script. + +# Backup environment variables (only if the variables are set) +if [[ ! -z "${CUDA_HOME+x}" ]] +then + export CUDA_HOME_CONDA_NVCC_BACKUP="${CUDA_HOME:-}" +fi + +if [[ ! -z "${CUDA_PATH+x}" ]] +then + export CUDA_PATH_CONDA_NVCC_BACKUP="${CUDA_PATH:-}" +fi + +if [[ ! -z "${CFLAGS+x}" ]] +then + export CFLAGS_CONDA_NVCC_BACKUP="${CFLAGS:-}" +fi + +if [[ ! -z "${CPPFLAGS+x}" ]] +then + export CPPFLAGS_CONDA_NVCC_BACKUP="${CPPFLAGS:-}" +fi + +if [[ ! -z "${CXXFLAGS+x}" ]] +then + export CXXFLAGS_CONDA_NVCC_BACKUP="${CXXFLAGS:-}" +fi + +if [[ ! -z "${CMAKE_ARGS+x}" ]] +then + export CMAKE_ARGS_CONDA_NVCC_BACKUP="${CMAKE_ARGS:-}" +fi + +# Default to using $(cuda-gdb) to specify $(CUDA_HOME). +if [[ -z "${CUDA_HOME+x}" ]] +then + CUDA_GDB_EXECUTABLE=$(which cuda-gdb || exit 0) + if [[ -n "$CUDA_GDB_EXECUTABLE" ]] + then + CUDA_HOME=$(dirname $(dirname $CUDA_GDB_EXECUTABLE)) + else + echo "Cannot determine CUDA_HOME: cuda-gdb not in PATH" + return 1 + fi +fi + +if [[ ! -d "${CUDA_HOME}" ]] +then + echo "Directory specified in CUDA_HOME(=${CUDA_HOME}) doesn't exist" + return 1 +fi + +if [[ ! -f "${CUDA_HOME}/lib64/stubs/libcuda.so" ]] +then + echo "File ${CUDA_HOME}/lib64/stubs/libcuda.so doesn't exist" + return 1 +fi + +if [[ -z "$(${CUDA_HOME}/bin/nvcc --version | grep "Cuda compilation tools, release __PKG_VERSION__")" ]] +then + if [[ "${CONDA_BUILD}" = "1" ]] + then + echo "Error: Version of installed CUDA didn't match package" + return 1 + else + echo "Warning: Version of installed CUDA didn't match package" + fi +fi + +export CUDA_HOME="${CUDA_HOME}" +export CFLAGS="${CFLAGS} -isystem ${CUDA_HOME}/include" +export CPPFLAGS="${CPPFLAGS} -isystem ${CUDA_HOME}/include" +export CXXFLAGS="${CXXFLAGS} -isystem ${CUDA_HOME}/include" + +### CMake configurations + +# CMake looks up components in CUDA_PATH, not CUDA_HOME +export CUDA_PATH="${CUDA_HOME}" +# New-style CUDA integrations in CMake +CMAKE_ARGS="${CMAKE_ARGS:-} -DCUDAToolkit_ROOT=${CUDA_HOME}" +# Old-style CUDA integrations in CMake +## See https://github.com/conda-forge/nvcc-feedstock/pull/58#issuecomment-752179349 +CMAKE_ARGS+=" -DCUDA_TOOLKIT_ROOT_DIR=${CUDA_HOME}" +## Avoid https://github.com/conda-forge/openmm-feedstock/pull/44#issuecomment-753560234 +## We need CUDA_HOME in _front_ of CMAKE_FIND_ROOT_PATH +CMAKE_ARGS="$(echo ${CMAKE_ARGS} | sed -E -e "s|(-DCMAKE_FIND_ROOT_PATH=)(\S+)|\1$CUDA_HOME;\2|")" +export CMAKE_ARGS="${CMAKE_ARGS}" + +### /CMake configurations + +# Add $(libcuda.so) shared object stub to the compiler sysroot. +# Needed for things that want to link to $(libcuda.so). +# Stub is used to avoid getting driver code linked into binaries. + +if [[ ! -z "${CONDA_BUILD_SYSROOT+x}" ]] +then + mkdir -p "${CONDA_BUILD_SYSROOT}/lib" + # Make a backup of $(libcuda.so) + LIBCUDA_SO_CONDA_NVCC_BACKUP="${CONDA_BUILD_SYSROOT}/lib/libcuda.so-conda-nvcc-backup" + if [[ -f "${CONDA_BUILD_SYSROOT}/lib/libcuda.so" ]] + then + mv -f "${CONDA_BUILD_SYSROOT}/lib/libcuda.so" "${LIBCUDA_SO_CONDA_NVCC_BACKUP}" + fi + ln -s "${CUDA_HOME}/lib64/stubs/libcuda.so" "${CONDA_BUILD_SYSROOT}/lib/libcuda.so" +else + mkdir -p "${CONDA_PREFIX}/lib/stubs" + ln -sf "${CUDA_HOME}/lib64/stubs/libcuda.so" "${CONDA_PREFIX}/lib/stubs/libcuda.so" +fi diff --git a/recipe/linux/deactivate.sh b/recipe/linux/deactivate.sh new file mode 100644 index 0000000..f19ce84 --- /dev/null +++ b/recipe/linux/deactivate.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# Unset `CUDA_HOME` in a deactivation script. + +# Restore environment variables (if there is anything to restore) +if [[ ! -z "${CUDA_HOME_CONDA_NVCC_BACKUP+x}" ]] +then + export CUDA_HOME="${CUDA_HOME_CONDA_NVCC_BACKUP}" + unset CUDA_HOME_CONDA_NVCC_BACKUP +fi + +if [[ ! -z "${CUDA_PATH_CONDA_NVCC_BACKUP+x}" ]] +then + export CUDA_PATH="${CUDA_PATH_CONDA_NVCC_BACKUP}" + unset CUDA_PATH_CONDA_NVCC_BACKUP +fi + +if [[ ! -z "${CFLAGS_CONDA_NVCC_BACKUP+x}" ]] +then + export CFLAGS="${CFLAGS_CONDA_NVCC_BACKUP}" + unset CFLAGS_CONDA_NVCC_BACKUP +fi + +if [[ ! -z "${CPPFLAGS_CONDA_NVCC_BACKUP+x}" ]] +then + export CPPFLAGS="${CPPFLAGS_CONDA_NVCC_BACKUP}" + unset CPPFLAGS_CONDA_NVCC_BACKUP +fi + +if [[ ! -z "${CXXFLAGS_CONDA_NVCC_BACKUP+x}" ]] +then + export CXXFLAGS="${CXXFLAGS_CONDA_NVCC_BACKUP}" + unset CXXFLAGS_CONDA_NVCC_BACKUP +fi + +if [[ ! -z "${CMAKE_ARGS_CONDA_NVCC_BACKUP+x}" ]] +then + export CMAKE_ARGS="${CMAKE_ARGS_CONDA_NVCC_BACKUP}" + unset CMAKE_ARGS_CONDA_NVCC_BACKUP +fi + +# Remove or restore $(libcuda.so) shared object stub from the compiler sysroot. +LIBCUDA_SO_CONDA_NVCC_BACKUP="${CONDA_BUILD_SYSROOT}/lib/libcuda.so-conda-nvcc-backup" +if [[ -f ""${LIBCUDA_SO_CONDA_NVCC_BACKUP}"" ]] +then + mv -f "${LIBCUDA_SO_CONDA_NVCC_BACKUP}" "${CONDA_BUILD_SYSROOT}/lib/libcuda.so" +else + if [[ ! -z "${CONDA_BUILD_SYSROOT+x}" ]] + then + rm -f "${CONDA_BUILD_SYSROOT}/lib/libcuda.so" + else + rm -f "${CONDA_PREFIX}/lib/stubs/libcuda.so" + fi +fi diff --git a/recipe/linux/install_nvcc.sh b/recipe/linux/install_nvcc.sh new file mode 100755 index 0000000..9ad367f --- /dev/null +++ b/recipe/linux/install_nvcc.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -xeuo pipefail + +# Activation script +mkdir -p "${PREFIX}/etc/conda/activate.d" +sed -i "s/__PKG_VERSION__/$PKG_VERSION/g" linux/activate.sh +cp $RECIPE_DIR/linux/activate.sh "${PREFIX}/etc/conda/activate.d/${PKG_NAME}_activate.sh" + +# Deactivation script +mkdir -p "${PREFIX}/etc/conda/deactivate.d" +cp $RECIPE_DIR/linux/deactivate.sh "${PREFIX}/etc/conda/deactivate.d/${PKG_NAME}_deactivate.sh" + +# Create `nvcc` script in `bin` so it can be easily run. +mkdir -p "${PREFIX}/bin" +cp $RECIPE_DIR/linux/nvcc.sh "${PREFIX}/bin/nvcc" +chmod +x "${PREFIX}/bin/nvcc" diff --git a/recipe/linux/nvcc.sh b/recipe/linux/nvcc.sh new file mode 100644 index 0000000..4b126d4 --- /dev/null +++ b/recipe/linux/nvcc.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +for arg in "${@}" ; do + case ${arg} in -ccbin) + # If -ccbin argument is already provided, don't add an additional one. + exec "${CUDA_HOME}/bin/nvcc" "${@}" + esac +done +exec "${CUDA_HOME}/bin/nvcc" -ccbin "${CXX}" "${@}" diff --git a/recipe/test_nvcc.sh b/recipe/linux/test_nvcc.sh similarity index 100% rename from recipe/test_nvcc.sh rename to recipe/linux/test_nvcc.sh diff --git a/recipe/meta.yaml b/recipe/meta.yaml old mode 100755 new mode 100644 index ad925b4..06cacd0 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set name = "nvcc" %} -{% set number = 20 %} +{% set number = 21 %} {% if cuda_compiler_version in (None, "None", True, False) %} {% set cuda_major = 0 %} @@ -26,7 +26,7 @@ outputs: - name: "{{ name }}_{{ target_platform }}" version: "{{ cuda_compiler_version }}" number: {{ number }} - script: install_nvcc.sh # [linux] + script: linux/install_nvcc.sh # [linux] script: windows/install_nvcc.bat # [win] build: ignore_run_exports: From 4e5d179d0f7499247f185266504826ee43714b03 Mon Sep 17 00:00:00 2001 From: "conda-forge-webservices[bot]" <91080706+conda-forge-webservices[bot]@users.noreply.github.com> Date: Fri, 22 Jul 2022 21:27:20 +0000 Subject: [PATCH 02/12] MNT: Re-rendered with conda-build 3.21.9, conda-smithy 3.21.0, and conda-forge-pinning 2022.07.22.15.28.03 --- .azure-pipelines/azure-pipelines-win.yml | 4 +++- .scripts/build_steps.sh | 9 ++++++- LICENSE.txt | 30 +++++++++++++++++------- README.md | 9 ++++--- build-locally.py | 19 ++++++++++----- 5 files changed, 52 insertions(+), 19 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 0417ef5..dbbaddb 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -83,10 +83,12 @@ jobs: call activate base run_conda_forge_build_setup displayName: conda-forge build setup - - script: | call activate base + if EXIST LICENSE.txt ( + copy LICENSE.txt "recipe\\recipe-scripts-license.txt" + ) conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables displayName: Build recipe env: diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index d71d6ae..595f8b5 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -24,7 +24,10 @@ export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" cat >~/.condarc < /dev/null +if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then + cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" +fi + if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" diff --git a/LICENSE.txt b/LICENSE.txt index 6ec1401..2ec51d7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,13 +1,27 @@ -BSD 3-clause license +BSD-3-Clause license Copyright (c) 2015-2022, conda-forge contributors All rights reserved. -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/README.md b/README.md index a5a7c96..bd818be 100644 --- a/README.md +++ b/README.md @@ -320,6 +320,9 @@ Current release info | Name | Downloads | Version | Platforms | | --- | --- | --- | --- | | [![Conda Recipe](https://img.shields.io/badge/recipe-nvcc_linux--64-green.svg)](https://anaconda.org/conda-forge/nvcc_linux-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/nvcc_linux-64.svg)](https://anaconda.org/conda-forge/nvcc_linux-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/nvcc_linux-64.svg)](https://anaconda.org/conda-forge/nvcc_linux-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/nvcc_linux-64.svg)](https://anaconda.org/conda-forge/nvcc_linux-64) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-nvcc_linux--aarch64-green.svg)](https://anaconda.org/conda-forge/nvcc_linux-aarch64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/nvcc_linux-aarch64.svg)](https://anaconda.org/conda-forge/nvcc_linux-aarch64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/nvcc_linux-aarch64.svg)](https://anaconda.org/conda-forge/nvcc_linux-aarch64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/nvcc_linux-aarch64.svg)](https://anaconda.org/conda-forge/nvcc_linux-aarch64) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-nvcc_linux--ppc64le-green.svg)](https://anaconda.org/conda-forge/nvcc_linux-ppc64le) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/nvcc_linux-ppc64le.svg)](https://anaconda.org/conda-forge/nvcc_linux-ppc64le) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/nvcc_linux-ppc64le.svg)](https://anaconda.org/conda-forge/nvcc_linux-ppc64le) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/nvcc_linux-ppc64le.svg)](https://anaconda.org/conda-forge/nvcc_linux-ppc64le) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-nvcc_win--64-green.svg)](https://anaconda.org/conda-forge/nvcc_win-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/nvcc_win-64.svg)](https://anaconda.org/conda-forge/nvcc_win-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/nvcc_win-64.svg)](https://anaconda.org/conda-forge/nvcc_win-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/nvcc_win-64.svg)](https://anaconda.org/conda-forge/nvcc_win-64) | Installing nvcc =============== @@ -331,16 +334,16 @@ conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `nvcc_linux-64` can be installed with `conda`: +Once the `conda-forge` channel has been enabled, `nvcc_linux-64, nvcc_linux-aarch64, nvcc_linux-ppc64le, nvcc_win-64` can be installed with `conda`: ``` -conda install nvcc_linux-64 +conda install nvcc_linux-64 nvcc_linux-aarch64 nvcc_linux-ppc64le nvcc_win-64 ``` or with `mamba`: ``` -mamba install nvcc_linux-64 +mamba install nvcc_linux-64 nvcc_linux-aarch64 nvcc_linux-ppc64le nvcc_win-64 ``` It is possible to list all of the versions of `nvcc_linux-64` available on your platform with `conda`: diff --git a/build-locally.py b/build-locally.py index eec38a0..3f4b7a7 100755 --- a/build-locally.py +++ b/build-locally.py @@ -86,12 +86,19 @@ def main(args=None): verify_config(ns) setup_environment(ns) - if ns.config.startswith("linux") or ( - ns.config.startswith("osx") and platform.system() == "Linux" - ): - run_docker_build(ns) - elif ns.config.startswith("osx"): - run_osx_build(ns) + try: + if ns.config.startswith("linux") or ( + ns.config.startswith("osx") and platform.system() == "Linux" + ): + run_docker_build(ns) + elif ns.config.startswith("osx"): + run_osx_build(ns) + finally: + recipe_license_file = os.path.join( + "recipe", "recipe-scripts-license.txt" + ) + if os.path.exists(recipe_license_file): + os.remove(recipe_license_file) if __name__ == "__main__": From 3d1c2e7b83c46007a34b20e62ca7f6355ebfdb11 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 22 Jul 2022 17:51:14 -0400 Subject: [PATCH 03/12] fix path --- recipe/linux/install_nvcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/linux/install_nvcc.sh b/recipe/linux/install_nvcc.sh index 9ad367f..f58e142 100755 --- a/recipe/linux/install_nvcc.sh +++ b/recipe/linux/install_nvcc.sh @@ -4,7 +4,7 @@ set -xeuo pipefail # Activation script mkdir -p "${PREFIX}/etc/conda/activate.d" -sed -i "s/__PKG_VERSION__/$PKG_VERSION/g" linux/activate.sh +sed -i "s/__PKG_VERSION__/$PKG_VERSION/g" $RECIPE_DIR/linux/activate.sh cp $RECIPE_DIR/linux/activate.sh "${PREFIX}/etc/conda/activate.d/${PKG_NAME}_activate.sh" # Deactivation script From 49d750e8c70669560d3b94e8bbd6f24f5e4e6515 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 25 Jul 2022 11:51:09 -0400 Subject: [PATCH 04/12] fix test file path --- recipe/meta.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 06cacd0..468689b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -67,11 +67,11 @@ outputs: {% endif %} # [linux] files: - test.cu - - test_nvcc.sh # [linux] + - linux/test_nvcc.sh # [linux] - windows\test_nvcc.bat # [win] commands: - - bash test_nvcc.sh # [linux] - - windows\test_nvcc.bat # [win] + - linux/bash test_nvcc.sh # [linux] + - windows\test_nvcc.bat # [win] about: home: https://github.com/conda-forge/nvcc-feedstock license: BSD-3-Clause From f4a26456e96834558f7ce4f0f25e093ae6b713c6 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 25 Jul 2022 12:01:26 -0400 Subject: [PATCH 05/12] fix test file path --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 468689b..6bd0e36 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -70,7 +70,7 @@ outputs: - linux/test_nvcc.sh # [linux] - windows\test_nvcc.bat # [win] commands: - - linux/bash test_nvcc.sh # [linux] + - bash linux/test_nvcc.sh # [linux] - windows\test_nvcc.bat # [win] about: home: https://github.com/conda-forge/nvcc-feedstock From dfb132bc63f78315fbab5d3cd43b84561d681e96 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 25 Jul 2022 21:31:24 -0700 Subject: [PATCH 06/12] Build test packages on CI --- conda-forge.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conda-forge.yml b/conda-forge.yml index f0a10ac..1fe023b 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,5 +1,8 @@ conda_forge_output_validation: true provider: {linux_ppc64le: azure, linux_aarch64: azure} +# remove the `azure` section and re-render before merging +azure: + store_build_artifacts: False github: branch_name: main tooling_branch_name: main From 9eda616f4e61bd4d3abd4d6468be8e503909725a Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Tue, 26 Jul 2022 01:24:51 -0400 Subject: [PATCH 07/12] Update conda-forge.yml --- conda-forge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda-forge.yml b/conda-forge.yml index 1fe023b..6405d76 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -2,7 +2,7 @@ conda_forge_output_validation: true provider: {linux_ppc64le: azure, linux_aarch64: azure} # remove the `azure` section and re-render before merging azure: - store_build_artifacts: False + store_build_artifacts: true github: branch_name: main tooling_branch_name: main From faa66da20d427b28c0cbfaed74f0179d30d69b1a Mon Sep 17 00:00:00 2001 From: "conda-forge-webservices[bot]" <91080706+conda-forge-webservices[bot]@users.noreply.github.com> Date: Tue, 26 Jul 2022 06:05:03 +0000 Subject: [PATCH 08/12] MNT: Re-rendered with conda-build 3.21.9, conda-smithy 3.21.0, and conda-forge-pinning 2022.07.25.22.44.11 --- .azure-pipelines/azure-pipelines-linux.yml | 60 ++++++++++- .azure-pipelines/azure-pipelines-win.yml | 38 +++++++ .scripts/create_conda_build_artifacts.bat | 80 +++++++++++++++ .scripts/create_conda_build_artifacts.sh | 113 +++++++++++++++++++++ 4 files changed, 290 insertions(+), 1 deletion(-) create mode 100755 .scripts/create_conda_build_artifacts.bat create mode 100755 .scripts/create_conda_build_artifacts.sh diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index 9b6a16b..a58c4c0 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -12,118 +12,147 @@ jobs: CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.0 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-cuda:10.0 + SHORT_CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.0 linux_64_cdt_namecos6cuda_compiler_version10.1: CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.1 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-cuda:10.1 + SHORT_CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.1 linux_64_cdt_namecos6cuda_compiler_version10.2: CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-cuda:10.2 + SHORT_CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.2 linux_64_cdt_namecos6cuda_compiler_version9.2: CONFIG: linux_64_cdt_namecos6cuda_compiler_version9.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-cuda:9.2 + SHORT_CONFIG: linux_64_cdt_namecos6cuda_compiler_version9.2 linux_64_cdt_namecos7cuda_compiler_version11.0: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.0 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.0 + SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.0 linux_64_cdt_namecos7cuda_compiler_version11.1: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.1 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.1 + SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.1 linux_64_cdt_namecos7cuda_compiler_version11.2: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.2 + SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.2 linux_64_cdt_namecos7cuda_compiler_version11.3: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.3 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.3 + SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.3 linux_64_cdt_namecos7cuda_compiler_version11.4: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.4 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.4 + SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.4 linux_64_cdt_namecos7cuda_compiler_version11.5: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.5 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.5 + SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.5 linux_64_cdt_namecos7cuda_compiler_version11.6: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.6 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.6 + SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.6 linux_64_cdt_namecos7cuda_compiler_version11.7: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.7 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.7 + SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.7 linux_aarch64_cuda_compiler_version11.0: CONFIG: linux_aarch64_cuda_compiler_version11.0 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.0 + SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.0 linux_aarch64_cuda_compiler_version11.1: CONFIG: linux_aarch64_cuda_compiler_version11.1 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.1 + SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.1 linux_aarch64_cuda_compiler_version11.2: CONFIG: linux_aarch64_cuda_compiler_version11.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.2 + SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.2 linux_aarch64_cuda_compiler_version11.3: CONFIG: linux_aarch64_cuda_compiler_version11.3 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.3 + SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.3 linux_aarch64_cuda_compiler_version11.4: CONFIG: linux_aarch64_cuda_compiler_version11.4 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.4 + SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.4 linux_aarch64_cuda_compiler_version11.5: CONFIG: linux_aarch64_cuda_compiler_version11.5 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.5 + SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.5 linux_aarch64_cuda_compiler_version11.6: CONFIG: linux_aarch64_cuda_compiler_version11.6 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.6 + SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.6 linux_aarch64_cuda_compiler_version11.7: CONFIG: linux_aarch64_cuda_compiler_version11.7 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.7 + SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.7 linux_ppc64le_cuda_compiler_version10.2: CONFIG: linux_ppc64le_cuda_compiler_version10.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:10.2 + SHORT_CONFIG: linux_ppc64le_cuda_compiler_version10.2 linux_ppc64le_cuda_compiler_version11.0: CONFIG: linux_ppc64le_cuda_compiler_version11.0 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.0 + SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.0 linux_ppc64le_cuda_compiler_version11.1: CONFIG: linux_ppc64le_cuda_compiler_version11.1 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.1 + SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.1 linux_ppc64le_cuda_compiler_version11.2: CONFIG: linux_ppc64le_cuda_compiler_version11.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.2 + SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.2 linux_ppc64le_cuda_compiler_version11.3: CONFIG: linux_ppc64le_cuda_compiler_version11.3 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.3 + SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.3 linux_ppc64le_cuda_compiler_version11.4: CONFIG: linux_ppc64le_cuda_compiler_version11.4 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.4 + SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.4 linux_ppc64le_cuda_compiler_version11.5: CONFIG: linux_ppc64le_cuda_compiler_version11.5 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.5 + SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.5 linux_ppc64le_cuda_compiler_version11.6: CONFIG: linux_ppc64le_cuda_compiler_version11.6 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.6 + SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.6 linux_ppc64le_cuda_compiler_version11.7: CONFIG: linux_ppc64le_cuda_compiler_version11.7 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.7 + SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.7 timeoutInMinutes: 360 steps: @@ -154,4 +183,33 @@ jobs: env: BINSTAR_TOKEN: $(BINSTAR_TOKEN) FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) + - script: | + export CI=azure + export CI_RUN_ID=$(build.BuildNumber).$(system.JobAttempt) + export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) + export CONDA_BLD_DIR=build_artifacts + export ARTIFACT_STAGING_DIR="$(Build.ArtifactStagingDirectory)" + # Archive everything in CONDA_BLD_DIR except environments + export BLD_ARTIFACT_PREFIX=conda_artifacts + if [[ "$AGENT_JOBSTATUS" == "Failed" ]]; then + # Archive the CONDA_BLD_DIR environments only when the job fails + export ENV_ARTIFACT_PREFIX=conda_envs + fi + ./.scripts/create_conda_build_artifacts.sh + displayName: Prepare conda build artifacts + condition: succeededOrFailed() + + - task: PublishPipelineArtifact@1 + displayName: Store conda build artifacts + condition: not(eq(variables.BLD_ARTIFACT_PATH, '')) + inputs: + targetPath: $(BLD_ARTIFACT_PATH) + artifactName: $(BLD_ARTIFACT_NAME) + + - task: PublishPipelineArtifact@1 + displayName: Store conda build environment artifacts + condition: not(eq(variables.ENV_ARTIFACT_PATH, '')) + inputs: + targetPath: $(ENV_ARTIFACT_PATH) + artifactName: $(ENV_ARTIFACT_NAME) \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index dbbaddb..f859a77 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -11,36 +11,47 @@ jobs: win_64_cuda_compiler_version10.0: CONFIG: win_64_cuda_compiler_version10.0 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version10.0 win_64_cuda_compiler_version10.1: CONFIG: win_64_cuda_compiler_version10.1 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version10.1 win_64_cuda_compiler_version10.2: CONFIG: win_64_cuda_compiler_version10.2 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version10.2 win_64_cuda_compiler_version11.0: CONFIG: win_64_cuda_compiler_version11.0 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version11.0 win_64_cuda_compiler_version11.1: CONFIG: win_64_cuda_compiler_version11.1 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version11.1 win_64_cuda_compiler_version11.2: CONFIG: win_64_cuda_compiler_version11.2 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version11.2 win_64_cuda_compiler_version11.3: CONFIG: win_64_cuda_compiler_version11.3 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version11.3 win_64_cuda_compiler_version11.4: CONFIG: win_64_cuda_compiler_version11.4 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version11.4 win_64_cuda_compiler_version11.5: CONFIG: win_64_cuda_compiler_version11.5 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version11.5 win_64_cuda_compiler_version11.6: CONFIG: win_64_cuda_compiler_version11.6 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version11.6 win_64_cuda_compiler_version11.7: CONFIG: win_64_cuda_compiler_version11.7 UPLOAD_PACKAGES: 'True' + SHORT_CONFIG: win_64_cuda_compiler_version11.7 timeoutInMinutes: 360 variables: CONDA_BLD_PATH: D:\\bld\\ @@ -93,6 +104,33 @@ jobs: displayName: Build recipe env: PYTHONUNBUFFERED: 1 + - script: | + set CI=azure + set CI_RUN_ID=$(build.BuildNumber).$(system.JobAttempt) + set FEEDSTOCK_NAME=$(build.Repository.Name) + set ARTIFACT_STAGING_DIR=$(Build.ArtifactStagingDirectory) + set CONDA_BLD_DIR=$(CONDA_BLD_PATH) + set BLD_ARTIFACT_PREFIX=conda_artifacts + if "%AGENT_JOBSTATUS%" == "Failed" ( + set ENV_ARTIFACT_PREFIX=conda_envs + ) + call ".scripts\create_conda_build_artifacts.bat" + displayName: Prepare conda build artifacts + condition: succeededOrFailed() + + - task: PublishPipelineArtifact@1 + displayName: Store conda build artifacts + condition: not(eq(variables.BLD_ARTIFACT_PATH, '')) + inputs: + targetPath: $(BLD_ARTIFACT_PATH) + artifactName: $(BLD_ARTIFACT_NAME) + + - task: PublishPipelineArtifact@1 + displayName: Store conda build environment artifacts + condition: not(eq(variables.ENV_ARTIFACT_PATH, '')) + inputs: + targetPath: $(ENV_ARTIFACT_PATH) + artifactName: $(ENV_ARTIFACT_NAME) - script: | set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" call activate base diff --git a/.scripts/create_conda_build_artifacts.bat b/.scripts/create_conda_build_artifacts.bat new file mode 100755 index 0000000..79ce625 --- /dev/null +++ b/.scripts/create_conda_build_artifacts.bat @@ -0,0 +1,80 @@ +setlocal enableextensions enabledelayedexpansion + +rem INPUTS (environment variables that need to be set before calling this script): +rem +rem CI (azure/github_actions/UNSET) +rem CI_RUN_ID (unique identifier for the CI job run) +rem FEEDSTOCK_NAME +rem CONFIG (build matrix configuration string) +rem SHORT_CONFIG (uniquely-shortened configuration string) +rem CONDA_BLD_DIR (path to the conda-bld directory) +rem ARTIFACT_STAGING_DIR (use working directory if unset) +rem BLD_ARTIFACT_PREFIX (prefix for the conda build artifact name, skip if unset) +rem ENV_ARTIFACT_PREFIX (prefix for the conda build environments artifact name, skip if unset) + +rem OUTPUTS +rem +rem BLD_ARTIFACT_NAME +rem BLD_ARTIFACT_PATH +rem ENV_ARTIFACT_NAME +rem ENV_ARTIFACT_PATH + +rem Check that the conda-build directory exists +if not exist %CONDA_BLD_DIR% ( + echo conda-build directory does not exist + exit 1 +) + +if not defined ARTIFACT_STAGING_DIR ( + rem Set staging dir to the working dir + set ARTIFACT_STAGING_DIR=%cd% +) + +rem Set a unique ID for the artifact(s), specialized for this particular job run +set ARTIFACT_UNIQUE_ID=%CI_RUN_ID%_%CONFIG% +if not "%ARTIFACT_UNIQUE_ID%" == "%ARTIFACT_UNIQUE_ID:~0,80%" ( + set ARTIFACT_UNIQUE_ID=%CI_RUN_ID%_%SHORT_CONFIG% +) + +rem Set a descriptive ID for the archive(s), specialized for this particular job run +set ARCHIVE_UNIQUE_ID=%CI_RUN_ID%_%CONFIG% + +rem Make the build artifact zip +if defined BLD_ARTIFACT_PREFIX ( + set BLD_ARTIFACT_NAME=%BLD_ARTIFACT_PREFIX%_%ARTIFACT_UNIQUE_ID% + echo BLD_ARTIFACT_NAME: !BLD_ARTIFACT_NAME! + + set "BLD_ARTIFACT_PATH=%ARTIFACT_STAGING_DIR%\%FEEDSTOCK_NAME%_%BLD_ARTIFACT_PREFIX%_%ARCHIVE_UNIQUE_ID%.zip" + 7z a "!BLD_ARTIFACT_PATH!" "%CONDA_BLD_DIR%" -xr^^!.git/ -xr^^!_*_env*/ -xr^^!*_cache/ -bb + if errorlevel 1 exit 1 + echo BLD_ARTIFACT_PATH: !BLD_ARTIFACT_PATH! + + if "%CI%" == "azure" ( + echo ##vso[task.setVariable variable=BLD_ARTIFACT_NAME]!BLD_ARTIFACT_NAME! + echo ##vso[task.setVariable variable=BLD_ARTIFACT_PATH]!BLD_ARTIFACT_PATH! + ) + if "%CI%" == "github_actions" ( + echo ::set-output name=BLD_ARTIFACT_NAME::!BLD_ARTIFACT_NAME! + echo ::set-output name=BLD_ARTIFACT_PATH::!BLD_ARTIFACT_PATH! + ) +) + +rem Make the environments artifact zip +if defined ENV_ARTIFACT_PREFIX ( + set ENV_ARTIFACT_NAME=!ENV_ARTIFACT_PREFIX!_%ARTIFACT_UNIQUE_ID% + echo ENV_ARTIFACT_NAME: !ENV_ARTIFACT_NAME! + + set "ENV_ARTIFACT_PATH=%ARTIFACT_STAGING_DIR%\%FEEDSTOCK_NAME%_%ENV_ARTIFACT_PREFIX%_%ARCHIVE_UNIQUE_ID%.zip" + 7z a "!ENV_ARTIFACT_PATH!" -r "%CONDA_BLD_DIR%"/_*_env*/ -bb + if errorlevel 1 exit 1 + echo ENV_ARTIFACT_PATH: !ENV_ARTIFACT_PATH! + + if "%CI%" == "azure" ( + echo ##vso[task.setVariable variable=ENV_ARTIFACT_NAME]!ENV_ARTIFACT_NAME! + echo ##vso[task.setVariable variable=ENV_ARTIFACT_PATH]!ENV_ARTIFACT_PATH! + ) + if "%CI%" == "github_actions" ( + echo ::set-output name=ENV_ARTIFACT_NAME::!ENV_ARTIFACT_NAME! + echo ::set-output name=ENV_ARTIFACT_PATH::!ENV_ARTIFACT_PATH! + ) +) \ No newline at end of file diff --git a/.scripts/create_conda_build_artifacts.sh b/.scripts/create_conda_build_artifacts.sh new file mode 100755 index 0000000..cba0fae --- /dev/null +++ b/.scripts/create_conda_build_artifacts.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash + +# INPUTS (environment variables that need to be set before calling this script): +# +# CI (azure/github_actions/UNSET) +# CI_RUN_ID (unique identifier for the CI job run) +# FEEDSTOCK_NAME +# CONFIG (build matrix configuration string) +# SHORT_CONFIG (uniquely-shortened configuration string) +# CONDA_BLD_DIR (path to the conda-bld directory) +# ARTIFACT_STAGING_DIR (use working directory if unset) +# BLD_ARTIFACT_PREFIX (prefix for the conda build artifact name, skip if unset) +# ENV_ARTIFACT_PREFIX (prefix for the conda build environments artifact name, skip if unset) + +# OUTPUTS +# +# BLD_ARTIFACT_NAME +# BLD_ARTIFACT_PATH +# ENV_ARTIFACT_NAME +# ENV_ARTIFACT_PATH + +source .scripts/logging_utils.sh + +# DON'T do set -x, because it results in double echo-ing pipeline commands +# and that might end up inserting extraneous quotation marks in output variables +set -e + +# Check that the conda-build directory exists +if [ ! -d "$CONDA_BLD_DIR" ]; then + echo "conda-build directory does not exist" + exit 1 +fi + +# Set staging dir to the working dir, in Windows style if applicable +if [[ -z "${ARTIFACT_STAGING_DIR}" ]]; then + if pwd -W; then + ARTIFACT_STAGING_DIR=$(pwd -W) + else + ARTIFACT_STAGING_DIR=$PWD + fi +fi +echo "ARTIFACT_STAGING_DIR: $ARTIFACT_STAGING_DIR" + +FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) +if [ -z ${FEEDSTOCK_NAME} ]; then + export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) +fi + +# Set a unique ID for the artifact(s), specialized for this particular job run +ARTIFACT_UNIQUE_ID="${CI_RUN_ID}_${CONFIG}" +if [[ ${#ARTIFACT_UNIQUE_ID} -gt 80 ]]; then + ARTIFACT_UNIQUE_ID="${CI_RUN_ID}_${SHORT_CONFIG}" +fi +echo "ARTIFACT_UNIQUE_ID: $ARTIFACT_UNIQUE_ID" + +# Set a descriptive ID for the archive(s), specialized for this particular job run +ARCHIVE_UNIQUE_ID="${CI_RUN_ID}_${CONFIG}" + +# Make the build artifact zip +if [[ ! -z "$BLD_ARTIFACT_PREFIX" ]]; then + export BLD_ARTIFACT_NAME="${BLD_ARTIFACT_PREFIX}_${ARTIFACT_UNIQUE_ID}" + export BLD_ARTIFACT_PATH="${ARTIFACT_STAGING_DIR}/${FEEDSTOCK_NAME}_${BLD_ARTIFACT_PREFIX}_${ARCHIVE_UNIQUE_ID}.zip" + + ( startgroup "Archive conda build directory" ) 2> /dev/null + + # Try 7z and fall back to zip if it fails (for cross-platform use) + if ! 7z a "$BLD_ARTIFACT_PATH" "$CONDA_BLD_DIR" '-xr!.git/' '-xr!_*_env*/' '-xr!*_cache/' -bb; then + pushd "$CONDA_BLD_DIR" + zip -r -y -T "$BLD_ARTIFACT_PATH" . -x '*.git/*' '*_*_env*/*' '*_cache/*' + popd + fi + + ( endgroup "Archive conda build directory" ) 2> /dev/null + + echo "BLD_ARTIFACT_NAME: $BLD_ARTIFACT_NAME" + echo "BLD_ARTIFACT_PATH: $BLD_ARTIFACT_PATH" + + if [[ "$CI" == "azure" ]]; then + echo "##vso[task.setVariable variable=BLD_ARTIFACT_NAME]$BLD_ARTIFACT_NAME" + echo "##vso[task.setVariable variable=BLD_ARTIFACT_PATH]$BLD_ARTIFACT_PATH" + elif [[ "$CI" == "github_actions" ]]; then + echo "::set-output name=BLD_ARTIFACT_NAME::$BLD_ARTIFACT_NAME" + echo "::set-output name=BLD_ARTIFACT_PATH::$BLD_ARTIFACT_PATH" + fi +fi + +# Make the environments artifact zip +if [[ ! -z "$ENV_ARTIFACT_PREFIX" ]]; then + export ENV_ARTIFACT_NAME="${ENV_ARTIFACT_PREFIX}_${ARTIFACT_UNIQUE_ID}" + export ENV_ARTIFACT_PATH="${ARTIFACT_STAGING_DIR}/${FEEDSTOCK_NAME}_${ENV_ARTIFACT_PREFIX}_${ARCHIVE_UNIQUE_ID}.zip" + + ( startgroup "Archive conda build environments" ) 2> /dev/null + + # Try 7z and fall back to zip if it fails (for cross-platform use) + if ! 7z a "$ENV_ARTIFACT_PATH" -r "$CONDA_BLD_DIR"/'_*_env*/' -bb; then + pushd "$CONDA_BLD_DIR" + zip -r -y -T "$ENV_ARTIFACT_PATH" . -i '*_*_env*/*' + popd + fi + + ( endgroup "Archive conda build environments" ) 2> /dev/null + + echo "ENV_ARTIFACT_NAME: $ENV_ARTIFACT_NAME" + echo "ENV_ARTIFACT_PATH: $ENV_ARTIFACT_PATH" + + if [[ "$CI" == "azure" ]]; then + echo "##vso[task.setVariable variable=ENV_ARTIFACT_NAME]$ENV_ARTIFACT_NAME" + echo "##vso[task.setVariable variable=ENV_ARTIFACT_PATH]$ENV_ARTIFACT_PATH" + elif [[ "$CI" == "github_actions" ]]; then + echo "::set-output name=ENV_ARTIFACT_NAME::$ENV_ARTIFACT_NAME" + echo "::set-output name=ENV_ARTIFACT_PATH::$ENV_ARTIFACT_PATH" + fi +fi \ No newline at end of file From 9566bb7967a8c915bd589f611aa7ee1640c9e9cf Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 27 Jul 2022 10:29:06 -0400 Subject: [PATCH 09/12] nit: double equal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jaime Rodríguez-Guerra --- recipe/linux/activate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/linux/activate.sh b/recipe/linux/activate.sh index 2939701..b9fb17c 100644 --- a/recipe/linux/activate.sh +++ b/recipe/linux/activate.sh @@ -60,7 +60,7 @@ fi if [[ -z "$(${CUDA_HOME}/bin/nvcc --version | grep "Cuda compilation tools, release __PKG_VERSION__")" ]] then - if [[ "${CONDA_BUILD}" = "1" ]] + if [[ "${CONDA_BUILD}" == "1" ]] then echo "Error: Version of installed CUDA didn't match package" return 1 From dfa1726319df4826066c1eb64704ff82ce7c82d5 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 27 Jul 2022 20:10:54 -0400 Subject: [PATCH 10/12] Revert to follow POSIX convention Co-authored-by: jakirkham --- recipe/linux/activate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/linux/activate.sh b/recipe/linux/activate.sh index b9fb17c..f09ebe2 100644 --- a/recipe/linux/activate.sh +++ b/recipe/linux/activate.sh @@ -60,7 +60,7 @@ fi if [[ -z "$(${CUDA_HOME}/bin/nvcc --version | grep "Cuda compilation tools, release __PKG_VERSION__")" ]] then - if [[ "${CONDA_BUILD}" == "1" ]] + if [ "${CONDA_BUILD}" = "1" ] then echo "Error: Version of installed CUDA didn't match package" return 1 From c9cbe02fb3afbde0fe63b6bf01d01e279b72efee Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 1 Aug 2022 15:20:57 -0400 Subject: [PATCH 11/12] clean up --- conda-forge.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/conda-forge.yml b/conda-forge.yml index 6405d76..f0a10ac 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,8 +1,5 @@ conda_forge_output_validation: true provider: {linux_ppc64le: azure, linux_aarch64: azure} -# remove the `azure` section and re-render before merging -azure: - store_build_artifacts: true github: branch_name: main tooling_branch_name: main From 6185f9470a3a460c7bdb69950729f185544ab6b4 Mon Sep 17 00:00:00 2001 From: "conda-forge-webservices[bot]" <91080706+conda-forge-webservices[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 20:01:33 +0000 Subject: [PATCH 12/12] MNT: Re-rendered with conda-build 3.21.9, conda-smithy 3.21.1, and conda-forge-pinning 2022.08.01.12.11.42 --- .azure-pipelines/azure-pipelines-linux.yml | 60 +---------- .azure-pipelines/azure-pipelines-win.yml | 38 ------- .scripts/create_conda_build_artifacts.bat | 80 --------------- .scripts/create_conda_build_artifacts.sh | 113 --------------------- 4 files changed, 1 insertion(+), 290 deletions(-) delete mode 100755 .scripts/create_conda_build_artifacts.bat delete mode 100755 .scripts/create_conda_build_artifacts.sh diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index a58c4c0..9b6a16b 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -12,147 +12,118 @@ jobs: CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.0 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-cuda:10.0 - SHORT_CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.0 linux_64_cdt_namecos6cuda_compiler_version10.1: CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.1 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-cuda:10.1 - SHORT_CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.1 linux_64_cdt_namecos6cuda_compiler_version10.2: CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-cuda:10.2 - SHORT_CONFIG: linux_64_cdt_namecos6cuda_compiler_version10.2 linux_64_cdt_namecos6cuda_compiler_version9.2: CONFIG: linux_64_cdt_namecos6cuda_compiler_version9.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-cuda:9.2 - SHORT_CONFIG: linux_64_cdt_namecos6cuda_compiler_version9.2 linux_64_cdt_namecos7cuda_compiler_version11.0: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.0 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.0 - SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.0 linux_64_cdt_namecos7cuda_compiler_version11.1: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.1 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.1 - SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.1 linux_64_cdt_namecos7cuda_compiler_version11.2: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.2 - SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.2 linux_64_cdt_namecos7cuda_compiler_version11.3: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.3 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.3 - SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.3 linux_64_cdt_namecos7cuda_compiler_version11.4: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.4 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.4 - SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.4 linux_64_cdt_namecos7cuda_compiler_version11.5: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.5 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.5 - SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.5 linux_64_cdt_namecos7cuda_compiler_version11.6: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.6 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.6 - SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.6 linux_64_cdt_namecos7cuda_compiler_version11.7: CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.7 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.7 - SHORT_CONFIG: linux_64_cdt_namecos7cuda_compiler_version11.7 linux_aarch64_cuda_compiler_version11.0: CONFIG: linux_aarch64_cuda_compiler_version11.0 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.0 - SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.0 linux_aarch64_cuda_compiler_version11.1: CONFIG: linux_aarch64_cuda_compiler_version11.1 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.1 - SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.1 linux_aarch64_cuda_compiler_version11.2: CONFIG: linux_aarch64_cuda_compiler_version11.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.2 - SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.2 linux_aarch64_cuda_compiler_version11.3: CONFIG: linux_aarch64_cuda_compiler_version11.3 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.3 - SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.3 linux_aarch64_cuda_compiler_version11.4: CONFIG: linux_aarch64_cuda_compiler_version11.4 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.4 - SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.4 linux_aarch64_cuda_compiler_version11.5: CONFIG: linux_aarch64_cuda_compiler_version11.5 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.5 - SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.5 linux_aarch64_cuda_compiler_version11.6: CONFIG: linux_aarch64_cuda_compiler_version11.6 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.6 - SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.6 linux_aarch64_cuda_compiler_version11.7: CONFIG: linux_aarch64_cuda_compiler_version11.7 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64-cuda:11.7 - SHORT_CONFIG: linux_aarch64_cuda_compiler_version11.7 linux_ppc64le_cuda_compiler_version10.2: CONFIG: linux_ppc64le_cuda_compiler_version10.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:10.2 - SHORT_CONFIG: linux_ppc64le_cuda_compiler_version10.2 linux_ppc64le_cuda_compiler_version11.0: CONFIG: linux_ppc64le_cuda_compiler_version11.0 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.0 - SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.0 linux_ppc64le_cuda_compiler_version11.1: CONFIG: linux_ppc64le_cuda_compiler_version11.1 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.1 - SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.1 linux_ppc64le_cuda_compiler_version11.2: CONFIG: linux_ppc64le_cuda_compiler_version11.2 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.2 - SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.2 linux_ppc64le_cuda_compiler_version11.3: CONFIG: linux_ppc64le_cuda_compiler_version11.3 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.3 - SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.3 linux_ppc64le_cuda_compiler_version11.4: CONFIG: linux_ppc64le_cuda_compiler_version11.4 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.4 - SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.4 linux_ppc64le_cuda_compiler_version11.5: CONFIG: linux_ppc64le_cuda_compiler_version11.5 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.5 - SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.5 linux_ppc64le_cuda_compiler_version11.6: CONFIG: linux_ppc64le_cuda_compiler_version11.6 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.6 - SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.6 linux_ppc64le_cuda_compiler_version11.7: CONFIG: linux_ppc64le_cuda_compiler_version11.7 UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le-cuda:11.7 - SHORT_CONFIG: linux_ppc64le_cuda_compiler_version11.7 timeoutInMinutes: 360 steps: @@ -183,33 +154,4 @@ jobs: env: BINSTAR_TOKEN: $(BINSTAR_TOKEN) FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) - - script: | - export CI=azure - export CI_RUN_ID=$(build.BuildNumber).$(system.JobAttempt) - export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) - export CONDA_BLD_DIR=build_artifacts - export ARTIFACT_STAGING_DIR="$(Build.ArtifactStagingDirectory)" - # Archive everything in CONDA_BLD_DIR except environments - export BLD_ARTIFACT_PREFIX=conda_artifacts - if [[ "$AGENT_JOBSTATUS" == "Failed" ]]; then - # Archive the CONDA_BLD_DIR environments only when the job fails - export ENV_ARTIFACT_PREFIX=conda_envs - fi - ./.scripts/create_conda_build_artifacts.sh - displayName: Prepare conda build artifacts - condition: succeededOrFailed() - - - task: PublishPipelineArtifact@1 - displayName: Store conda build artifacts - condition: not(eq(variables.BLD_ARTIFACT_PATH, '')) - inputs: - targetPath: $(BLD_ARTIFACT_PATH) - artifactName: $(BLD_ARTIFACT_NAME) - - - task: PublishPipelineArtifact@1 - displayName: Store conda build environment artifacts - condition: not(eq(variables.ENV_ARTIFACT_PATH, '')) - inputs: - targetPath: $(ENV_ARTIFACT_PATH) - artifactName: $(ENV_ARTIFACT_NAME) \ No newline at end of file + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index f859a77..dbbaddb 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -11,47 +11,36 @@ jobs: win_64_cuda_compiler_version10.0: CONFIG: win_64_cuda_compiler_version10.0 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version10.0 win_64_cuda_compiler_version10.1: CONFIG: win_64_cuda_compiler_version10.1 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version10.1 win_64_cuda_compiler_version10.2: CONFIG: win_64_cuda_compiler_version10.2 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version10.2 win_64_cuda_compiler_version11.0: CONFIG: win_64_cuda_compiler_version11.0 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version11.0 win_64_cuda_compiler_version11.1: CONFIG: win_64_cuda_compiler_version11.1 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version11.1 win_64_cuda_compiler_version11.2: CONFIG: win_64_cuda_compiler_version11.2 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version11.2 win_64_cuda_compiler_version11.3: CONFIG: win_64_cuda_compiler_version11.3 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version11.3 win_64_cuda_compiler_version11.4: CONFIG: win_64_cuda_compiler_version11.4 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version11.4 win_64_cuda_compiler_version11.5: CONFIG: win_64_cuda_compiler_version11.5 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version11.5 win_64_cuda_compiler_version11.6: CONFIG: win_64_cuda_compiler_version11.6 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version11.6 win_64_cuda_compiler_version11.7: CONFIG: win_64_cuda_compiler_version11.7 UPLOAD_PACKAGES: 'True' - SHORT_CONFIG: win_64_cuda_compiler_version11.7 timeoutInMinutes: 360 variables: CONDA_BLD_PATH: D:\\bld\\ @@ -104,33 +93,6 @@ jobs: displayName: Build recipe env: PYTHONUNBUFFERED: 1 - - script: | - set CI=azure - set CI_RUN_ID=$(build.BuildNumber).$(system.JobAttempt) - set FEEDSTOCK_NAME=$(build.Repository.Name) - set ARTIFACT_STAGING_DIR=$(Build.ArtifactStagingDirectory) - set CONDA_BLD_DIR=$(CONDA_BLD_PATH) - set BLD_ARTIFACT_PREFIX=conda_artifacts - if "%AGENT_JOBSTATUS%" == "Failed" ( - set ENV_ARTIFACT_PREFIX=conda_envs - ) - call ".scripts\create_conda_build_artifacts.bat" - displayName: Prepare conda build artifacts - condition: succeededOrFailed() - - - task: PublishPipelineArtifact@1 - displayName: Store conda build artifacts - condition: not(eq(variables.BLD_ARTIFACT_PATH, '')) - inputs: - targetPath: $(BLD_ARTIFACT_PATH) - artifactName: $(BLD_ARTIFACT_NAME) - - - task: PublishPipelineArtifact@1 - displayName: Store conda build environment artifacts - condition: not(eq(variables.ENV_ARTIFACT_PATH, '')) - inputs: - targetPath: $(ENV_ARTIFACT_PATH) - artifactName: $(ENV_ARTIFACT_NAME) - script: | set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" call activate base diff --git a/.scripts/create_conda_build_artifacts.bat b/.scripts/create_conda_build_artifacts.bat deleted file mode 100755 index 79ce625..0000000 --- a/.scripts/create_conda_build_artifacts.bat +++ /dev/null @@ -1,80 +0,0 @@ -setlocal enableextensions enabledelayedexpansion - -rem INPUTS (environment variables that need to be set before calling this script): -rem -rem CI (azure/github_actions/UNSET) -rem CI_RUN_ID (unique identifier for the CI job run) -rem FEEDSTOCK_NAME -rem CONFIG (build matrix configuration string) -rem SHORT_CONFIG (uniquely-shortened configuration string) -rem CONDA_BLD_DIR (path to the conda-bld directory) -rem ARTIFACT_STAGING_DIR (use working directory if unset) -rem BLD_ARTIFACT_PREFIX (prefix for the conda build artifact name, skip if unset) -rem ENV_ARTIFACT_PREFIX (prefix for the conda build environments artifact name, skip if unset) - -rem OUTPUTS -rem -rem BLD_ARTIFACT_NAME -rem BLD_ARTIFACT_PATH -rem ENV_ARTIFACT_NAME -rem ENV_ARTIFACT_PATH - -rem Check that the conda-build directory exists -if not exist %CONDA_BLD_DIR% ( - echo conda-build directory does not exist - exit 1 -) - -if not defined ARTIFACT_STAGING_DIR ( - rem Set staging dir to the working dir - set ARTIFACT_STAGING_DIR=%cd% -) - -rem Set a unique ID for the artifact(s), specialized for this particular job run -set ARTIFACT_UNIQUE_ID=%CI_RUN_ID%_%CONFIG% -if not "%ARTIFACT_UNIQUE_ID%" == "%ARTIFACT_UNIQUE_ID:~0,80%" ( - set ARTIFACT_UNIQUE_ID=%CI_RUN_ID%_%SHORT_CONFIG% -) - -rem Set a descriptive ID for the archive(s), specialized for this particular job run -set ARCHIVE_UNIQUE_ID=%CI_RUN_ID%_%CONFIG% - -rem Make the build artifact zip -if defined BLD_ARTIFACT_PREFIX ( - set BLD_ARTIFACT_NAME=%BLD_ARTIFACT_PREFIX%_%ARTIFACT_UNIQUE_ID% - echo BLD_ARTIFACT_NAME: !BLD_ARTIFACT_NAME! - - set "BLD_ARTIFACT_PATH=%ARTIFACT_STAGING_DIR%\%FEEDSTOCK_NAME%_%BLD_ARTIFACT_PREFIX%_%ARCHIVE_UNIQUE_ID%.zip" - 7z a "!BLD_ARTIFACT_PATH!" "%CONDA_BLD_DIR%" -xr^^!.git/ -xr^^!_*_env*/ -xr^^!*_cache/ -bb - if errorlevel 1 exit 1 - echo BLD_ARTIFACT_PATH: !BLD_ARTIFACT_PATH! - - if "%CI%" == "azure" ( - echo ##vso[task.setVariable variable=BLD_ARTIFACT_NAME]!BLD_ARTIFACT_NAME! - echo ##vso[task.setVariable variable=BLD_ARTIFACT_PATH]!BLD_ARTIFACT_PATH! - ) - if "%CI%" == "github_actions" ( - echo ::set-output name=BLD_ARTIFACT_NAME::!BLD_ARTIFACT_NAME! - echo ::set-output name=BLD_ARTIFACT_PATH::!BLD_ARTIFACT_PATH! - ) -) - -rem Make the environments artifact zip -if defined ENV_ARTIFACT_PREFIX ( - set ENV_ARTIFACT_NAME=!ENV_ARTIFACT_PREFIX!_%ARTIFACT_UNIQUE_ID% - echo ENV_ARTIFACT_NAME: !ENV_ARTIFACT_NAME! - - set "ENV_ARTIFACT_PATH=%ARTIFACT_STAGING_DIR%\%FEEDSTOCK_NAME%_%ENV_ARTIFACT_PREFIX%_%ARCHIVE_UNIQUE_ID%.zip" - 7z a "!ENV_ARTIFACT_PATH!" -r "%CONDA_BLD_DIR%"/_*_env*/ -bb - if errorlevel 1 exit 1 - echo ENV_ARTIFACT_PATH: !ENV_ARTIFACT_PATH! - - if "%CI%" == "azure" ( - echo ##vso[task.setVariable variable=ENV_ARTIFACT_NAME]!ENV_ARTIFACT_NAME! - echo ##vso[task.setVariable variable=ENV_ARTIFACT_PATH]!ENV_ARTIFACT_PATH! - ) - if "%CI%" == "github_actions" ( - echo ::set-output name=ENV_ARTIFACT_NAME::!ENV_ARTIFACT_NAME! - echo ::set-output name=ENV_ARTIFACT_PATH::!ENV_ARTIFACT_PATH! - ) -) \ No newline at end of file diff --git a/.scripts/create_conda_build_artifacts.sh b/.scripts/create_conda_build_artifacts.sh deleted file mode 100755 index cba0fae..0000000 --- a/.scripts/create_conda_build_artifacts.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env bash - -# INPUTS (environment variables that need to be set before calling this script): -# -# CI (azure/github_actions/UNSET) -# CI_RUN_ID (unique identifier for the CI job run) -# FEEDSTOCK_NAME -# CONFIG (build matrix configuration string) -# SHORT_CONFIG (uniquely-shortened configuration string) -# CONDA_BLD_DIR (path to the conda-bld directory) -# ARTIFACT_STAGING_DIR (use working directory if unset) -# BLD_ARTIFACT_PREFIX (prefix for the conda build artifact name, skip if unset) -# ENV_ARTIFACT_PREFIX (prefix for the conda build environments artifact name, skip if unset) - -# OUTPUTS -# -# BLD_ARTIFACT_NAME -# BLD_ARTIFACT_PATH -# ENV_ARTIFACT_NAME -# ENV_ARTIFACT_PATH - -source .scripts/logging_utils.sh - -# DON'T do set -x, because it results in double echo-ing pipeline commands -# and that might end up inserting extraneous quotation marks in output variables -set -e - -# Check that the conda-build directory exists -if [ ! -d "$CONDA_BLD_DIR" ]; then - echo "conda-build directory does not exist" - exit 1 -fi - -# Set staging dir to the working dir, in Windows style if applicable -if [[ -z "${ARTIFACT_STAGING_DIR}" ]]; then - if pwd -W; then - ARTIFACT_STAGING_DIR=$(pwd -W) - else - ARTIFACT_STAGING_DIR=$PWD - fi -fi -echo "ARTIFACT_STAGING_DIR: $ARTIFACT_STAGING_DIR" - -FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) -if [ -z ${FEEDSTOCK_NAME} ]; then - export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) -fi - -# Set a unique ID for the artifact(s), specialized for this particular job run -ARTIFACT_UNIQUE_ID="${CI_RUN_ID}_${CONFIG}" -if [[ ${#ARTIFACT_UNIQUE_ID} -gt 80 ]]; then - ARTIFACT_UNIQUE_ID="${CI_RUN_ID}_${SHORT_CONFIG}" -fi -echo "ARTIFACT_UNIQUE_ID: $ARTIFACT_UNIQUE_ID" - -# Set a descriptive ID for the archive(s), specialized for this particular job run -ARCHIVE_UNIQUE_ID="${CI_RUN_ID}_${CONFIG}" - -# Make the build artifact zip -if [[ ! -z "$BLD_ARTIFACT_PREFIX" ]]; then - export BLD_ARTIFACT_NAME="${BLD_ARTIFACT_PREFIX}_${ARTIFACT_UNIQUE_ID}" - export BLD_ARTIFACT_PATH="${ARTIFACT_STAGING_DIR}/${FEEDSTOCK_NAME}_${BLD_ARTIFACT_PREFIX}_${ARCHIVE_UNIQUE_ID}.zip" - - ( startgroup "Archive conda build directory" ) 2> /dev/null - - # Try 7z and fall back to zip if it fails (for cross-platform use) - if ! 7z a "$BLD_ARTIFACT_PATH" "$CONDA_BLD_DIR" '-xr!.git/' '-xr!_*_env*/' '-xr!*_cache/' -bb; then - pushd "$CONDA_BLD_DIR" - zip -r -y -T "$BLD_ARTIFACT_PATH" . -x '*.git/*' '*_*_env*/*' '*_cache/*' - popd - fi - - ( endgroup "Archive conda build directory" ) 2> /dev/null - - echo "BLD_ARTIFACT_NAME: $BLD_ARTIFACT_NAME" - echo "BLD_ARTIFACT_PATH: $BLD_ARTIFACT_PATH" - - if [[ "$CI" == "azure" ]]; then - echo "##vso[task.setVariable variable=BLD_ARTIFACT_NAME]$BLD_ARTIFACT_NAME" - echo "##vso[task.setVariable variable=BLD_ARTIFACT_PATH]$BLD_ARTIFACT_PATH" - elif [[ "$CI" == "github_actions" ]]; then - echo "::set-output name=BLD_ARTIFACT_NAME::$BLD_ARTIFACT_NAME" - echo "::set-output name=BLD_ARTIFACT_PATH::$BLD_ARTIFACT_PATH" - fi -fi - -# Make the environments artifact zip -if [[ ! -z "$ENV_ARTIFACT_PREFIX" ]]; then - export ENV_ARTIFACT_NAME="${ENV_ARTIFACT_PREFIX}_${ARTIFACT_UNIQUE_ID}" - export ENV_ARTIFACT_PATH="${ARTIFACT_STAGING_DIR}/${FEEDSTOCK_NAME}_${ENV_ARTIFACT_PREFIX}_${ARCHIVE_UNIQUE_ID}.zip" - - ( startgroup "Archive conda build environments" ) 2> /dev/null - - # Try 7z and fall back to zip if it fails (for cross-platform use) - if ! 7z a "$ENV_ARTIFACT_PATH" -r "$CONDA_BLD_DIR"/'_*_env*/' -bb; then - pushd "$CONDA_BLD_DIR" - zip -r -y -T "$ENV_ARTIFACT_PATH" . -i '*_*_env*/*' - popd - fi - - ( endgroup "Archive conda build environments" ) 2> /dev/null - - echo "ENV_ARTIFACT_NAME: $ENV_ARTIFACT_NAME" - echo "ENV_ARTIFACT_PATH: $ENV_ARTIFACT_PATH" - - if [[ "$CI" == "azure" ]]; then - echo "##vso[task.setVariable variable=ENV_ARTIFACT_NAME]$ENV_ARTIFACT_NAME" - echo "##vso[task.setVariable variable=ENV_ARTIFACT_PATH]$ENV_ARTIFACT_PATH" - elif [[ "$CI" == "github_actions" ]]; then - echo "::set-output name=ENV_ARTIFACT_NAME::$ENV_ARTIFACT_NAME" - echo "::set-output name=ENV_ARTIFACT_PATH::$ENV_ARTIFACT_PATH" - fi -fi \ No newline at end of file