Skip to content

[runtime env] Unify checks for empty runtime env using helper function#22129

Merged
edoakes merged 3 commits intoray-project:masterfrom
architkulkarni:runtime-env-empty-function
Feb 7, 2022
Merged

[runtime env] Unify checks for empty runtime env using helper function#22129
edoakes merged 3 commits intoray-project:masterfrom
architkulkarni:runtime-env-empty-function

Conversation

@architkulkarni
Copy link
Contributor

Why are these changes needed?

Followup from #21788. Previously we had a lot of serialized_runtime_env == "{}" || serialized_runtime_env == "" scattered around the C++ code; this PR puts this in a helper function.

Related issue number

Checks

  • 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 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 :(

Copy link
Collaborator

@edoakes edoakes left a comment

Choose a reason for hiding this comment

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

Nice cleanup, thanks

@edoakes edoakes added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Feb 4, 2022
@edoakes
Copy link
Collaborator

edoakes commented Feb 4, 2022

ping for merge

// Return whether a string representation of a runtime env represents an empty
// runtime env. It could either be "" (from the default string value in protobuf),
// or "{}" (from serializing an empty Python dict or a JSON file.)
bool IsRuntimeEnvEmpty(const std::string &serialized_runtime_env);
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 move it to a common, not runtime_env_manager.h? I think runtime_env_manager.h should be higher layer than things like TaskSpec

Copy link
Collaborator

Choose a reason for hiding this comment

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

agree, good point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rkooo567 @edoakes Updated, how does it look now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

LGTM, not sure if sang had a specific place in mind

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah no preference, tho we can probably name the file just common.h (since it is already under runtime env folder)

@architkulkarni architkulkarni removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Feb 7, 2022
@edoakes edoakes merged commit de2c950 into ray-project:master Feb 7, 2022
simonsays1980 pushed a commit to simonsays1980/ray that referenced this pull request Feb 27, 2022
ray-project#22129)

Followup from ray-project#21788.  Previously we had a lot of `serialized_runtime_env == "{}" || serialized_runtime_env == ""` scattered around the C++ code; this PR puts this in a helper function.
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.

3 participants