forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable redis password in Java worker (ray-project#3943)
* Support Java redis password * Fix * Refine * Fix lint.
- Loading branch information
1 parent
9797028
commit c523bc0
Showing
8 changed files
with
116 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
java/test/src/main/java/org/ray/api/test/RedisPasswordTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.ray.api.test; | ||
|
||
import org.ray.api.Ray; | ||
import org.ray.api.RayObject; | ||
import org.ray.api.annotation.RayRemote; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
public class RedisPasswordTest extends BaseTest { | ||
|
||
@Override | ||
public void beforeInitRay() { | ||
System.setProperty("ray.redis.head-password", "12345678"); | ||
System.setProperty("ray.redis.password", "12345678"); | ||
} | ||
|
||
@Override | ||
public void afterShutdownRay() { | ||
System.clearProperty("ray.redis.head-password"); | ||
System.clearProperty("ray.redis.password"); | ||
} | ||
|
||
@RayRemote | ||
public static String echo(String str) { | ||
return str; | ||
} | ||
|
||
@Test | ||
public void testRedisPassword() { | ||
RayObject<String> obj = Ray.call(RedisPasswordTest::echo, "hello"); | ||
Assert.assertEquals("hello", obj.get()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters