Skip to content

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

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

edoakes merged 3 commits into
ray-project:masterfrom
architkulkarni:runtime-env-empty-function

Conversation

@architkulkarni

Copy link
Copy Markdown
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

@edoakes edoakes left a comment

Copy link
Copy Markdown
Collaborator

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 commented Feb 4, 2022

Copy link
Copy Markdown
Collaborator

ping for merge

Comment thread src/ray/common/runtime_env_manager.h Outdated
// 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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)

@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