Skip to content

Commit

Permalink
Fix bug on miniconda downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
libowen2121 committed Mar 27, 2024
1 parent f1b4650 commit 1bb85c6
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions harness/context_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import logging, os, platform, subprocess
import os.path
import shutil

from constants import (
APPLY_PATCH_FAIL,
Expand Down Expand Up @@ -196,13 +198,17 @@ def __enter__(self):
cmd_line_install_link = "https://repo.anaconda.com/miniconda/Miniconda3-py311_23.11.0-2-Linux-aarch64.sh"
else:
raise ValueError("Unknown computer platform " + platform.system())
download_cmd = [
"wget",
cmd_line_install_link,
"-O",
miniconda_sh,
]
self.exec(download_cmd)

temp_miniconda_sh = f"{os.getcwd()}/miniconda.sh"
if not os.path.exists(temp_miniconda_sh):
download_cmd = [
"wget",
cmd_line_install_link,
"-O",
temp_miniconda_sh,
]
self.exec(download_cmd)
shutil.copy(temp_miniconda_sh, miniconda_sh)

# Install Miniconda
install_cmd = ["bash", miniconda_sh, "-b", "-u", "-p", self.path_conda]
Expand Down

0 comments on commit 1bb85c6

Please sign in to comment.