Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Core ]Fix bug for set gcs port environment variable #34367

Conversation

XiaodongLv
Copy link
Contributor

@XiaodongLv XiaodongLv commented Apr 13, 2023

Why are these changes needed?

When RAY_GCS_SERVER_PORT is set, ray.init() is executed locally will failed.
TypeError: '>' not supported between instances of 'str' and 'int'.

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@XiaodongLv XiaodongLv force-pushed the Fix_env_GCS_PORT_ENVIRONMENT_VARIABLE_to_support_change_port_for_starting_ray branch from 48ed97e to 21ba161 Compare April 13, 2023 16:05
@XiaodongLv XiaodongLv force-pushed the Fix_env_GCS_PORT_ENVIRONMENT_VARIABLE_to_support_change_port_for_starting_ray branch from 21ba161 to 508efed Compare April 13, 2023 16:10
Signed-off-by: XiaodongLv <[email protected]>
Signed-off-by: XiaodongLv <[email protected]>
…env_GCS_PORT_ENVIRONMENT_VARIABLE_to_support_change_port_for_starting_ray
Signed-off-by: XiaodongLv <[email protected]>
@@ -304,6 +304,7 @@ py_test_module_list(
"test_usage_stats.py",
"test_placement_group_3.py",
"test_placement_group_5.py",
"test_env.py",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"test_env.py",
"test_set_gcs_server_port.py",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed it.

Signed-off-by: XiaodongLv <[email protected]>
@@ -270,7 +270,16 @@ def __init__(

# Pick a GCS server port.
if head:
gcs_server_port = os.getenv(ray_constants.GCS_PORT_ENVIRONMENT_VARIABLE)
gcs_server_port_environment = os.getenv(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ray_constants.py has a helper function called env_integer(), lets use that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thankyou, I will change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jjyao I have completed it

Signed-off-by: XiaodongLv <[email protected]>
@@ -270,7 +270,11 @@ def __init__(

# Pick a GCS server port.
if head:
gcs_server_port = os.getenv(ray_constants.GCS_PORT_ENVIRONMENT_VARIABLE)
from ray.autoscaler._private.constants import env_integer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use the method under ray._private.ray_constants, not the autoscaler package? (not sure why it has the same method there)

ray.shutdown()


# If RAY_GCS_SERVER_PORT is set as string, it will be ignored so that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment and test doesn't seem to match?

@rkooo567
Copy link
Contributor

Hmm it seems duplicate of #34482 (comment). cc @scv119 to confirm

@jovany-wang
Copy link
Contributor

Duplicate to #34482 . closing

@jovany-wang jovany-wang closed this May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants