Remove default ms-python-release download link, use specific version and not a direct download

This commit is contained in:
allegroai 2024-04-20 23:43:23 +03:00
parent 97d4dd95a1
commit d092209cf6

View File

@ -270,9 +270,10 @@ def start_vscode_server(hostname, hostnames, param, task, env, bind_ip="127.0.0.
env = dict(**env)
env.pop('PYTHONPATH', None)
python_ext_download_link = \
os.environ.get("CLEARML_SESSION_VSCODE_PY_EXT") or \
'https://github.com/microsoft/vscode-python/releases/download/{}/ms-python-release.vsix'
# example of CLEARML_SESSION_VSCODE_PY_EXT value
# 'https://github.com/microsoft/vscode-python/releases/download/{}/ms-python-release.vsix'
python_ext_download_link = os.environ.get("CLEARML_SESSION_VSCODE_PY_EXT")
code_server_deb_download_link = \
os.environ.get("CLEARML_SESSION_VSCODE_SERVER_DEB") or \
'https://github.com/coder/code-server/releases/download/v{version}/code-server_{version}_amd64.deb'
@ -297,7 +298,7 @@ def start_vscode_server(hostname, hostnames, param, task, env, bind_ip="127.0.0.
try:
python_ext = StorageManager.get_local_copy(
python_ext_download_link.format(python_ext_version),
extract_archive=False)
extract_archive=False) if python_ext_download_link else None
code_server_deb = StorageManager.get_local_copy(
code_server_deb_download_link.format(version=vscode_version),
extract_archive=False)