Skip to content

[docker] Run profiling without sudo#10388

Merged
rkooo567 merged 4 commits intoray-project:masterfrom
ijrsvt:fix-profiling-docker
Aug 29, 2020
Merged

[docker] Run profiling without sudo#10388
rkooo567 merged 4 commits intoray-project:masterfrom
ijrsvt:fix-profiling-docker

Conversation

@ijrsvt
Copy link
Contributor

@ijrsvt ijrsvt commented Aug 28, 2020

Why are these changes needed?

Sudo is not necessary in docker when the current user is root. This PR only uses sudo for profiling when the user is not root.

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/latest/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failure rates at https://ray-travis-tracker.herokuapp.com/.
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested (please justify below)

Copy link
Contributor

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

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

One minor comment.


def get_user():
try:
return pwd.getpwuid(os.getuid())[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like pwd.getpwuid returns named tuple (https://www.geeksforgeeks.org/pwd-module-in-python/)? Can you just use the name instead of index?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@rkooo567 rkooo567 added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Aug 28, 2020
@ijrsvt ijrsvt removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Aug 28, 2020
@rkooo567
Copy link
Contributor

@ijrsvt It seems like it fails tons of Windows tests.

@rkooo567 rkooo567 added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Aug 28, 2020
@ijrsvt ijrsvt removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Aug 28, 2020
@ijrsvt
Copy link
Contributor Author

ijrsvt commented Aug 28, 2020

@rkooo567 Ah, looks like pwd is not on windows, I'll just import it if we are not on windows :)

@rkooo567 rkooo567 merged commit d6f2b0d into ray-project:master Aug 29, 2020
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.

2 participants