py-jaxlib: patch bazel server cpu limit (#37548) (#38090)

This commit is contained in:
Pariksheet Nanda 2023-06-04 19:28:41 -04:00 committed by GitHub
parent c3fb998414
commit c08f9fd6fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,6 +50,16 @@ class PyJaxlib(PythonPackage, CudaPackage):
def patch(self): def patch(self):
self.tmp_path = tempfile.mkdtemp(prefix="spack") self.tmp_path = tempfile.mkdtemp(prefix="spack")
self.buildtmp = tempfile.mkdtemp(prefix="spack") self.buildtmp = tempfile.mkdtemp(prefix="spack")
filter_file(
"build --spawn_strategy=standalone",
f"""
# Limit CPU workers to spack jobs instead of using all HOST_CPUS.
build --spawn_strategy=standalone
build --local_cpu_resources={make_jobs}
""".strip(),
".bazelrc",
string=True,
)
filter_file( filter_file(
'f"--output_path={output_path}",', 'f"--output_path={output_path}",',
'f"--output_path={output_path}",' 'f"--output_path={output_path}",'