ray icon indicating copy to clipboard operation
ray copied to clipboard

Custom Resources from using `ray start` in CLI do not work as intended

Open lavkeshg opened this issue 1 year ago • 4 comments

Running into an issue where the examples for custom resources do not work in Powershell as intended.

ray start --head --num-cpus=3 --num-gpus=4 --resources='{"special_hardware": 1, "custom_label": 1}'

Should be straightforward enough, however it yields the following response, --resources is not a valid JSON string. Valid values look like this: --resources='{"CustomResource3": 1, "CustomResource2": 2}}'

I have also tried the example for "valid" values suggested in the error response, ray start --head --resources='{"CustomResource3": 1, "CustomResource2": 2}}'

This yields the exact same error as well.

I have also tried wrapping the whole text further within quotes looking at some other issues, like so, ray start --head --num-cpus=3 --num-gpus=4 --resources="'{ \"special_hardware\": 1, \"custom_label\": 1 }'" this didn't help either

I have attached the environment.yml used here.

environment.yml name: ray_unpack channels: default dependencies: python=3.8 pip pip: - -r requirements.txt

requirements.txt joblib==1.2.0 numpy==1.24.0 pandas==1.5.2 psycopg2==2.9.5 PyYAML==6.0 ray==2.5.0 SQLAlchemy==1.4.45

I am running this on PSVersion: 5.1.17763.3770

Thank you!

lavkeshg avatar Jun 13 '23 17:06 lavkeshg

There is an error in your example above. The following is correct. You can use the following。

ray start --head --resources='{"CustomResource3": 1, "CustomResource2": 2}'

image

larrylian avatar Jun 14 '23 06:06 larrylian

Thanks for your response! However that didn't work either. The }} typo is something I took from what the error suggests. Please see the screenshot below, where I run the line from your response. image

lavkeshg avatar Jun 14 '23 22:06 lavkeshg

  1. There is an extra } in this error message and we will fix it.
  2. You try to remove the space in the middle. image

larrylian avatar Jun 15 '23 00:06 larrylian

removing whitespaces still gives the same issue, see below image

rather than this back and forth, does this ray start operation generate a log file which I can send you? Let me where would I be able to find that. Thank you!

lavkeshg avatar Jun 15 '23 14:06 lavkeshg

I will try to find a Windows environment and use PowerShell to reproduce the issue you encountered. This will take a few days to complete.

larrylian avatar Jun 19 '23 03:06 larrylian

@lavkeshg Today i reproduce the issue in windows env, you should use follow case:

ray start --head --resources='{\"CustomResource3\": 1, \"CustomResource2\": 2}'

larrylian avatar Jun 25 '23 14:06 larrylian

That worked for me! Thank you so much

lavkeshg avatar Jun 26 '23 03:06 lavkeshg