Skip to content

Commit

Permalink
[CI] fix nightly conda deployment (#2515)
Browse files Browse the repository at this point in the history
  • Loading branch information
aclegg3 authored Dec 9, 2024
1 parent 9e8ddf2 commit 9d75557
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions .github/workflows/install_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -391,21 +394,21 @@ 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
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
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
Expand All @@ -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"
Expand Down

0 comments on commit 9d75557

Please sign in to comment.