Skip to content

Commit 9645665

Browse files
authored
Merge pull request #526 from KhiopsML/525-failure-to-retrieve-credentials-through-automatic-credentials-discovery
Fix HOME setting for OpenMPI 5 in the Khiops process environment
2 parents b5f2843 + b2ca3bb commit 9645665

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
- Example: 10.2.1.4 is the 5th version that supports khiops 10.2.1.
77
- Internals: Changes in *Internals* sections are unlikely to be of interest for data scientists.
88

9+
## Unreleased
10+
11+
### Fixed
12+
- (General) Automatic Credentials Discovery-based credential retrieval for
13+
Google cloud storage (GCS).
14+
915
## 11.0.0.0 - 2025-12-19
1016

1117
### Added

khiops/core/internals/runner.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,8 @@ def _build_khiops_process_environment():
337337

338338
# Ensure HOME is always set for OpenMPI 5+
339339
# (using KHIOPS_MPI_HOME if it exists)
340-
khiops_env["HOME"] = os.path.pathsep.join(
341-
[khiops_env.get("KHIOPS_MPI_HOME", ""), khiops_env.get("HOME", "")]
342-
)
340+
if "HOME" not in khiops_env:
341+
khiops_env["HOME"] = khiops_env.get("KHIOPS_MPI_HOME", "")
343342
return khiops_env
344343

345344

tests/test_khiops_integrations.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ def test_runner_environment_for_openmpi5(self):
291291
"""Test if KHIOPS_MPI_HOME is actually exported
292292
and HOME is corrected for OpenMPI 5+"""
293293

294+
# Store initial HOME, then delete it from the environment
295+
initial_home = os.environ.pop("HOME", "")
296+
294297
# Trigger the environment initialization
295298
_ = kh.get_runner().khiops_version
296299

@@ -300,13 +303,16 @@ def test_runner_environment_for_openmpi5(self):
300303
self.assertIsNotNone(os.environ.get("KHIOPS_MPI_HOME"))
301304

302305
# Check HOME is corrected in the new process environment
306+
self.assertIn("HOME", khiops_env)
303307
self.assertEqual(
304-
os.path.pathsep.join(
305-
[khiops_env.get("KHIOPS_MPI_HOME", ""), os.environ.get("HOME", "")]
306-
),
307-
khiops_env.get("HOME"),
308+
khiops_env["KHIOPS_MPI_HOME"],
309+
khiops_env["HOME"],
308310
)
309311

312+
# Restore initial HOME in the environment
313+
if initial_home:
314+
os.environ["HOME"] = initial_home
315+
310316
def test_runner_environment_initialization(self):
311317
"""Test that local runner initializes/ed its environment properly
312318

0 commit comments

Comments
 (0)