Skip to content

Commit

Permalink
Update document
Browse files Browse the repository at this point in the history
  • Loading branch information
pang-wu committed Jul 20, 2023
1 parent b7ea407 commit e194fcd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/raydp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ jobs:
- name: Test with pytest
run: |
ray start --head --num-cpus 6
pytest python/raydp/tests/ -v -m"not error_on_custom_resource"
pytest python/raydp/tests/ -v -m"error_on_custom_resource"
pytest python/raydp/tests/ -v
ray stop --force
- name: Test Examples
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.apache.spark.raydp;

import scala.deprecated;

public class SparkOnRayConfigs {
@Deprecated
public static final String RAY_ACTOR_RESOURCE_PREFIX = "spark.ray.actor.resource";

public static final String SPARK_EXECUTOR_ACTOR_RESOURCE_PREFIX = "spark.ray.raydp_spark_executor.actor.resource";
public static final String SPARK_EXECUTOR_ACTOR_RESOURCE_PREFIX =
"spark.ray.raydp_spark_executor.actor.resource";
public static final String SPARK_MASTER_ACTOR_RESOURCE_PREFIX =
"spark.ray.raydp_spark_master.actor.resource";
/**
Expand All @@ -24,7 +24,8 @@ public class SparkOnRayConfigs {
* This is different from spark.executor.cores, which defines the task parallelism
* inside a stage.
*/
public static final String SPARK_EXECUTOR_ACTOR_CPU_RESOURCE = SPARK_EXECUTOR_ACTOR_RESOURCE_PREFIX + ".cpu";
public static final String SPARK_EXECUTOR_ACTOR_CPU_RESOURCE =
SPARK_EXECUTOR_ACTOR_RESOURCE_PREFIX + ".cpu";

public static final int DEFAULT_SPARK_CORES_PER_EXECUTOR = 1;

Expand Down
6 changes: 3 additions & 3 deletions doc/spark_on_ray.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ available_node_types:
### Spark executor actors node affinity
Similar to master actors node affinity, you can also schedule Spark executor to a specific set of nodes
using custom resource:
using custom resource, using configuration `spark.ray.raydp_spark_executor.actor.resource.[RESOURCE_NAME]`:

```python
import raydp
Expand All @@ -51,7 +51,7 @@ And here is the cluster YAML with the customer resource:
available_node_types:
spark_on_spot: # Spark only nodes
resources:
spark_executor: 100 # custom resource indicates these node group is for Spark only
spark_executor: 100 # custom resource, with name matches the one set in spark.ray.raydp_spark_executor.actor.resource.*
min_workers: 2
max_workers: 10 # changing this also need to change the global max_workers
node_config:
Expand All @@ -76,7 +76,7 @@ spark = raydp.init_spark(app_name='RayDP Oversubscribe Example',
executor_memory=1 * 1024 * 1024 * 1024,
configs = {
# ...
'spark.ray.raydp_spark_executor.actor.resource.spark_executor': 1, # The actor only occupy 1 logical CPU slots from Ray
'spark.ray.raydp_spark_executor.actor.resource.cpu': 1, # The actor only occupy 1 logical CPU slots from Ray
})
```

Expand Down
2 changes: 1 addition & 1 deletion python/raydp/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def stop_all():
def spark_on_ray_2_executors(request):
ray.shutdown()
if request.param == "local":
ray.init(address="local", num_cpus=10, include_dashboard=False)
ray.init(address="local", num_cpus=6, include_dashboard=False)
else:
ray.init(address=request.param)
node_ip = ray.util.get_node_ip_address()
Expand Down

0 comments on commit e194fcd

Please sign in to comment.