From 9d75557c286d35e8e4acbed79801a66b675b87b2 Mon Sep 17 00:00:00 2001 From: Alexander Clegg Date: Mon, 9 Dec 2024 08:15:21 -1000 Subject: [PATCH] [CI] fix nightly conda deployment (#2515) --- .github/workflows/install_and_test.yml | 37 ++++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/install_and_test.yml b/.github/workflows/install_and_test.yml index f1a02206a6..8147e949fb 100644 --- a/.github/workflows/install_and_test.yml +++ b/.github/workflows/install_and_test.yml @@ -311,21 +311,21 @@ jobs: path: "./habitat-sim" - name: Set CI_TEST variable based on "main merge" vs. "pull_request" workflow run: |- - echo "NIGHTLY=''" >> $GITHUB_ENV - echo "CI_TEST='true'" >> $GITHUB_ENV + echo "NIGHTLY=" >> $GITHUB_ENV + echo "CI_TEST=true" >> $GITHUB_ENV if [[ ${{ github.event_name }} == 'push' ]]; then if [[ ${GITHUB_REF} == refs/heads/* ]]; then echo "trigger: a push to main branch" elif [[ ${GITHUB_REF} == refs/tags/* ]]; then echo "trigger: a version tag push" - echo "CI_TEST='false'" >> $GITHUB_ENV + echo "CI_TEST=false" >> $GITHUB_ENV echo "CONDA_USERNAME=$AIHABITAT_CONDA_USERNAME" >> $GITHUB_ENV echo "CONDA_PWD=$AIHABITAT_CONDA_PWD" >> $GITHUB_ENV fi elif [[ ${{ github.event_name }} == 'schedule' ]]; then echo "trigger: a nightly build" - echo "CI_TEST='false'" >> $GITHUB_ENV - echo "NIGHTLY='--nightly'" >> $GITHUB_ENV + echo "CI_TEST=false" >> $GITHUB_ENV + echo "NIGHTLY=--nightly" >> $GITHUB_ENV echo "CONDA_USERNAME=$AIHABITAT_NIGHTLY_CONDA_USERNAME" >> $GITHUB_ENV echo "CONDA_PWD=$AIHABITAT_NIGHTLY_CONDA_PWD" >> $GITHUB_ENV elif [[ ${{ github.event_name }} == 'pull_request' ]]; then @@ -339,7 +339,7 @@ jobs: echo ${{ env.NIGHTLY }} #pivot on the build type - if [[ ${{ env.CI_TEST }} ]]; then + if [[ ${{ env.CI_TEST }} == true ]]; then echo "This is a CI test." else echo "This is a full conda build with deployment." @@ -348,9 +348,9 @@ jobs: bash Anaconda3-2020.11-Linux-x86_64.sh -b -p $HOME/anaconda export PATH=$HOME/anaconda/bin:$PATH - # Delete old nightly builds - #NOTE: The ${{ env.NIGHTLY }} == "--nightly" variable is necessary to trigger this - #python common/delete_old_night_packages.py --username ${{ env.CONDA_USERNAME }} --password ${{ env.CONDA_PWD }} ${{ env.NIGHTLY }} + echo "Delete old nightly builds" + python common/delete_old_night_packages.py --username ${{ env.CONDA_USERNAME }} --password ${{ env.CONDA_PWD }} ${{ env.NIGHTLY }} + fi #install Docker @@ -361,12 +361,15 @@ jobs: sudo apt-get install -y docker-ce #build the container + echo "Building the docker container" docker build -t hsim_condabuild_dcontainer -f Dockerfile . - if [[ ${{ env.CI_TEST }} ]]; then + if [[ ${{ env.CI_TEST }} == true ]]; then + echo "Running matrix_builder for CI test." docker run --ipc=host --rm -v $(pwd)/../../:/remote hsim_condabuild_dcontainer /bin/bash -c "source ~/.bashrc && conda activate py39 && cd /remote/habitat-sim/ && git config --global --add safe.directory '*' && cd /remote/habitat-sim/conda-build && python matrix_builder.py --ci_test" else - docker run --ipc=host --rm -v $(pwd)/../../:/remote --env ${{ env.CONDA_PWD }} hsim_condabuild_dcontainer /bin/bash -c "source ~/.bashrc && conda activate py39 && cd /remote/habitat-sim/ && git config --global --add safe.directory '*' && cd /remote/habitat-sim/conda-build && yes | anaconda login --username ${{ env.CONDA_USERNAME }} --password ${{ env.CONDA_PWD }} --hostname "aihabitat-conda-ci-builder-linux" && python matrix_builder.py --conda_upload ${{ env.NIGHTLY }}" + echo "Running matrix_builder for deployment." + docker run --ipc=host --rm -v $(pwd)/../../:/remote --env ${{ env.CONDA_PWD }} hsim_condabuild_dcontainer /bin/bash -c "source ~/.bashrc && conda activate py39 && cd /remote/habitat-sim/ && git config --global --add safe.directory '*' && cd /remote/habitat-sim/conda-build && yes | anaconda login --username ${{ env.CONDA_USERNAME }} --password ${{ env.CONDA_PWD }} --hostname aihabitat-conda-ci-builder-linux && python matrix_builder.py --conda_upload ${{ env.NIGHTLY }}" fi build_conda_osx: @@ -391,8 +394,8 @@ jobs: activate-environment: "habitat" - name: Set CI_TEST variable based on "main merge" vs. "pull_request" workflow run: |- - echo "NIGHTLY=''" >> $GITHUB_ENV - echo "CI_TEST='true'" >> $GITHUB_ENV + echo "NIGHTLY=" >> $GITHUB_ENV + echo "CI_TEST=true" >> $GITHUB_ENV echo "CONDA_USERNAME=$AIHABITAT_CONDA_USERNAME" >> $GITHUB_ENV echo "CONDA_PWD=$AIHABITAT_CONDA_PWD" >> $GITHUB_ENV if [[ ${{ github.event_name }} == 'push' ]]; then @@ -400,12 +403,12 @@ jobs: echo "trigger: a push to main branch" elif [[ ${GITHUB_REF} == refs/tags/* ]]; then echo "trigger: a version tag push" - echo "CI_TEST='false'" >> $GITHUB_ENV + echo "CI_TEST=false" >> $GITHUB_ENV fi elif [[ ${{ github.event_name }} == 'schedule' ]]; then echo "trigger: a nightly build" - echo "CI_TEST='false'" >> $GITHUB_ENV - echo "NIGHTLY='--nightly'" >> $GITHUB_ENV + echo "CI_TEST=false" >> $GITHUB_ENV + echo "NIGHTLY=--nightly" >> $GITHUB_ENV echo "CONDA_USERNAME=$AIHABITAT_NIGHTLY_CONDA_USERNAME" >> $GITHUB_ENV echo "CONDA_PWD=$AIHABITAT_NIGHTLY_CONDA_PWD" >> $GITHUB_ENV elif [[ ${{ github.event_name }} == 'pull_request' ]]; then @@ -426,7 +429,7 @@ jobs: rm -rf build (yes || true) | anaconda login --username ${{ env.CONDA_USERNAME }} --password ${{ env.CONDA_PWD }} --hostname "aihabitat-conda-ci-builder-macos" #pivot on the build type - if [[ ${{ env.CI_TEST }} ]]; then + if [[ ${{ env.CI_TEST }} == true ]]; then echo "This is a CI test." cd conda-build export PYTHONIOENCODING="utf-8"