Skip to content

Commit

Permalink
Fix locale environment variables when launching Ray (#3167)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkvision authored Dec 3, 2020
1 parent 4f1cb42 commit d1d46ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 14 additions & 0 deletions docs/docs/ProgrammingGuide/rayonspark.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,17 @@ print(ray.get([c.increment.remote() for c in counters]))
ray_ctx.stop()
sc.stop()
```

---
### **FAQ**
- If you encounter the following error when initiating RayOnSpark, especially when you are using Spark standalone cluster:
```
This system supports the C.UTF-8 locale which is recommended. You might be able to resolve your issue by exporting the following environment variables:
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
```
Add the environment variables when initiating RayContext would resolve the issue:
```python
ray_ctx = RayContext(sc=sc, object_store_memory="5g", env={"LANG": "C.UTF-8", "LC_ALL": "C.UTF-8"})
```
2 changes: 0 additions & 2 deletions pyzoo/zoo/ray/raycontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ def _prepare_env(self):
modified_env["PATH"] = "{}:{}".format(executor_python_path, os.environ["PATH"])
else:
modified_env["PATH"] = executor_python_path
modified_env["LC_ALL"] = "C.UTF-8"
modified_env["LANG"] = "C.UTF-8"
modified_env.pop("MALLOC_ARENA_MAX", None)
modified_env.pop("RAY_BACKEND_LOG_LEVEL", None)
# Unset all MKL setting as Analytics Zoo would give default values when init env.
Expand Down

0 comments on commit d1d46ae

Please sign in to comment.