[ci/release] Quote pip installs in client runner (#23888)

What: Quotes pip install packages in local environment setup for client runner.

Why: Strings like pyarrow>=6.0.1<7.0.0 currently don't work as they are interpreted as output redirection.
This commit is contained in:
Kai Fricke 2022-04-13 11:07:12 +01:00 committed by GitHub
parent 40d3a62aa1
commit 5e1218aae1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -1,5 +1,6 @@
import json
import os
import shlex
import subprocess
import sys
import tempfile
@ -34,7 +35,10 @@ def install_cluster_env_packages(cluster_env: Dict[Any, Any]):
for package in packages:
subprocess.check_output(
f"pip install -U {package}", shell=True, env=os.environ, text=True
f"pip install -U {shlex.quote(package)}",
shell=True,
env=os.environ,
text=True,
)

View file

@ -1,6 +1,7 @@
import importlib
import os
import re
import shlex
import subprocess
import sys
import tempfile
@ -289,7 +290,10 @@ def install_matching_ray_locally(ray_wheels: Optional[str]):
"pip uninstall -y ray", shell=True, env=os.environ, text=True
)
subprocess.check_output(
f"pip install -U {ray_wheels}", shell=True, env=os.environ, text=True
f"pip install -U {shlex.quote(ray_wheels)}",
shell=True,
env=os.environ,
text=True,
)
for module_name in RELOAD_MODULES:
if module_name in sys.modules: