Repository: horovod/horovod

Issue:
In the run.py file,  the variable "envs" does not have a attribute "ENV_IGNORE"

![image](https://user-images.githubusercontent.com/24536530/54912344-651b8080-4f2b-11e9-91fa-15d949f73843.png)

![image](https://user-images.githubusercontent.com/24536530/54912371-75cbf680-4f2b-11e9-9f6f-40da57b82c70.png)

![image](https://user-images.githubusercontent.com/24536530/54911665-ed008b00-4f29-11e9-993c-85975d954bba.png)

Maybe there is something wrong with the "env" variable name. How can I solve it?




Discussion:

Resolving patch:
diff --git a/horovod/run/common/util/env_constants.py b/horovod/run/common/util/env_constants.py
new file mode 100644
--- /dev/null
+++ b/horovod/run/common/util/env_constants.py
@@ -0,0 +1,16 @@
+# Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ==============================================================================
+
+IGNORE_LIST = {'BASH_FUNC_module()'}
diff --git a/horovod/run/run.py b/horovod/run/run.py
--- a/horovod/run/run.py
+++ b/horovod/run/run.py
@@ -26,7 +26,7 @@
     from pipes import quote
 import horovod
 
-from horovod.run.common.util import codec, safe_shell_exec, timeout, secret
+from horovod.run.common.util import codec, env_constants, safe_shell_exec, timeout, secret
 from horovod.run.driver import driver_service
 from horovod.run.task import task_service
 from horovod.run.util import cache, threads, network
@@ -468,7 +468,8 @@ def run():
                     tcp_intf_arg=tcp_intf_arg,
                     nccl_socket_intf_arg=nccl_socket_intf_arg,
                     ssh_port_arg=ssh_port_arg,
-                    env=' '.join('-x %s' % key for key in env.keys()),
+                    env=' '.join('-x %s' % key for key in env.keys()
+                                 if key not in env_constants.IGNORE_LIST),
                     command=' '.join(quote(par) for par in args.command))
     )
 
diff --git a/horovod/spark/__init__.py b/horovod/spark/__init__.py
--- a/horovod/spark/__init__.py
+++ b/horovod/spark/__init__.py
@@ -20,8 +20,8 @@
 import threading
 
 from horovod.spark.task import task_service
-from horovod.run.common.util import codec, safe_shell_exec, timeout, host_hash, \
-    secret
+from horovod.run.common.util import codec, env_constants, safe_shell_exec, timeout, \
+    host_hash, secret
 from horovod.spark.driver import driver_service, job_id
 
 
@@ -172,7 +172,8 @@ def run(fn, args=(), kwargs={}, num_proc=None, start_timeout=None, env=None, std
                     hosts=','.join('%s:%d' % (host_hash, len(driver.task_host_hash_indices()[host_hash]))
                                    for host_hash in host_hashes),
                     common_intfs=','.join(common_intfs),
-                    env=' '.join('-x %s' % key for key in env.keys()),
+                    env=' '.join('-x %s' % key for key in env.keys()
+                                 if key not in env_constants.IGNORE_LIST),
                     python=sys.executable,
                     encoded_driver_addresses=codec.dumps_base64(driver.addresses())))
         if verbose >= 2:


Test patch: