mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 02:32:08 +08:00
Add password authentication to Redis ports (#2952)
* Implement Redis authentication * Throw exception for legacy Ray * Add test * Formatting * Fix bugs in CLI * Fix bugs in Raylet * Move default password to constants.h * Use pytest.fixture * Fix bug * Authenticate using formatted strings * Add missing passwords * Add test * Improve authentication of async contexts * Disable Redis authentication for credis * Update test for credis * Fix rebase artifacts * Fix formatting * Add workaround for issue #3045 * Increase timeout for test * Improve C++ readability * Fixes for CLI * Add security docs * Address comments * Address comments * Adress comments * Use ray.get * Fix lint
This commit is contained in:
committed by
Philipp Moritz
parent
a9e454f6fd
commit
a41bbc10ef
@@ -35,11 +35,15 @@ class LogMonitor(object):
|
||||
handle for that file.
|
||||
"""
|
||||
|
||||
def __init__(self, redis_ip_address, redis_port, node_ip_address):
|
||||
def __init__(self,
|
||||
redis_ip_address,
|
||||
redis_port,
|
||||
node_ip_address,
|
||||
redis_password=None):
|
||||
"""Initialize the log monitor object."""
|
||||
self.node_ip_address = node_ip_address
|
||||
self.redis_client = redis.StrictRedis(
|
||||
host=redis_ip_address, port=redis_port)
|
||||
host=redis_ip_address, port=redis_port, password=redis_password)
|
||||
self.log_files = {}
|
||||
self.log_file_handles = {}
|
||||
self.files_to_ignore = set()
|
||||
@@ -130,6 +134,12 @@ if __name__ == "__main__":
|
||||
required=True,
|
||||
type=str,
|
||||
help="The IP address of the node this process is on.")
|
||||
parser.add_argument(
|
||||
"--redis-password",
|
||||
required=False,
|
||||
type=str,
|
||||
default=None,
|
||||
help="the password to use for Redis")
|
||||
parser.add_argument(
|
||||
"--logging-level",
|
||||
required=False,
|
||||
@@ -151,6 +161,9 @@ if __name__ == "__main__":
|
||||
redis_ip_address = get_ip_address(args.redis_address)
|
||||
redis_port = get_port(args.redis_address)
|
||||
|
||||
log_monitor = LogMonitor(redis_ip_address, redis_port,
|
||||
args.node_ip_address)
|
||||
log_monitor = LogMonitor(
|
||||
redis_ip_address,
|
||||
redis_port,
|
||||
args.node_ip_address,
|
||||
redis_password=args.redis_password)
|
||||
log_monitor.run()
|
||||
|
||||
Reference in New Issue
Block a user