Skip to content

Commit

Permalink
[CI] Fix conda on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed Dec 20, 2024
1 parent ab4250e commit 7172e40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .github/unittest/windows_optdepts/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ set -ex

this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')"
conda activate ./env
conda activate torchrl

# TODO, refactor the below logic to make it easy to understand how to get correct cuda_version.
if [ "${CU_VERSION:-}" == cpu ] ; then
Expand Down
3 changes: 1 addition & 2 deletions .github/unittest/windows_optdepts/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

set -e

eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')"
conda activate ./env
conda activate torchrl

this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source "$this_dir/set_cuda_envs.sh"
Expand Down
18 changes: 2 additions & 16 deletions .github/unittest/windows_optdepts/scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,17 @@ set -e

this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
root_dir="$(git rev-parse --show-toplevel)"
conda_dir="${root_dir}/conda"
env_dir="${root_dir}/env"

cd "${root_dir}"

# 1. Install conda at ./conda
if [ ! -d "${conda_dir}" ]; then
printf "* Installing conda\n"
export tmp_conda="$(echo $conda_dir | tr '/' '\\')"
export miniconda_exe="$(echo $root_dir | tr '/' '\\')\\miniconda.exe"
curl --output miniconda.exe https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -O
"$this_dir/install_conda.bat"
unset tmp_conda
unset miniconda_exe
fi

eval "$(${conda_dir}/Scripts/conda.exe 'shell.bash' 'hook')"

# 2. Create test environment at ./env
printf "* Creating a test environment\n"
conda create --prefix "${env_dir}" -y python="$PYTHON_VERSION"
conda create --prefix torchrl -y python="$PYTHON_VERSION"

printf "* Activating the environment"
conda deactivate
conda activate "${env_dir}"
conda activate torchrl

printf "Python version"
echo $(which python)
Expand Down

0 comments on commit 7172e40

Please sign in to comment.