-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add more logging to Tools/Scripts/delete-if-too-large #4574
Add more logging to Tools/Scripts/delete-if-too-large #4574
Conversation
EWS run on previous version of this PR (hash a3500d4) |
a3500d4
to
e14e113
Compare
EWS run on previous version of this PR (hash e14e113) |
@@ -216,6 +216,15 @@ class PruneCoreSymbolicationdCacheIfTooLarge(shell.ShellCommand): | |||
"/System/Library/Caches/com.apple.coresymbolicationd"] | |||
|
|||
|
|||
class PruneCoreSymbolicationdDataIfTooLarge(shell.ShellCommand): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is just adding the step. Need to update factory as well to invoke this step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I opened the PR early to get feedback from the Python linter. Related, I implemented the most naive solution to this problem. I'm not sure how to best go about parameterising PruneCoreSymbolicationdCacheIfTooLarge
within our use of buildbot.
e14e113
to
bb6c917
Compare
EWS run on previous version of this PR (hash bb6c917) |
bb6c917
to
150a3c9
Compare
EWS run on previous version of this PR (hash 150a3c9) |
flunkOnFailure = False | ||
haltOnFailure = False | ||
command = ["python3", "Tools/Scripts/delete-if-too-large", | ||
"/System/Volumes/Data/System/Library/Caches/com.apple.coresymbolicationd"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the same step/script twice just to pass two different arguments doesn't seems right. Either the script should accept multiple parameters and handle them appropriately, or the paths can be hard-coded inside the script itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
Related, I implemented the most naive solution to this problem. I'm not sure how to best go about parameterising PruneCoreSymbolicationdCacheIfTooLarge within our use of buildbot.
How can I go about parameterising PruneCoreSymbolicationdCacheIfTooLarge? It's not clear to me if we can actually (or should be )pass arguments or if the way we compose out list of steps is meant to be purely declarative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can I go about parameterising PruneCoreSymbolicationdCacheIfTooLarge?
In steps.py for the command for PruneCoreSymbolicationdCacheIfTooLarge You can pass more arguments, just like you are passing one argument currently.
You can modify delete-if-too-large script so that users can pass multiple directories. You can either use argument parser (like https://docs.python.org/dev/library/argparse.html) or for this simple user-case, you can simply loop over sys.argv and store the arguments in a list of directories. Then just loop over that list and execute your logic to delete.
If the list of directories is going to be fixed, other option is to hard-code these directories names inside the script.
flunkOnFailure = False | ||
haltOnFailure = False | ||
command = ["python3", "Tools/Scripts/delete-if-too-large", | ||
"/System/Volumes/Data/System/Library/Caches/com.apple.coresymbolicationd"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't /System/Volumes/Data/System/Library/Caches
just a worse way to write /System/Library/Caches
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it is. Though, for some reason we are seeing both of these paths needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's the same directory, just linked to two places in the hierarchy in some way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some machines in the fleet that seem to need this path for some reason.
EWS run on previous version of this PR (hash fb41a23) |
fb41a23
to
bdc1047
Compare
EWS run on previous version of this PR (hash bdc1047) |
os.remove(directory) | ||
print("Deleted " + directory) | ||
else: | ||
print(f'{directory} is {directorySize}. Doing nothing') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: please add unit (kb/mb/gb) in this message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment about adding unit is still applicable.
Looks good to me assuming Alexey's concern about /System/Volumes/Data/System/Library/Caches and /System/Library/Caches being same is addressed. |
Thanks @aj062 . With respect to @aproskuryakov 's concern, I believe they are indeed the same folder. However, we are seeing a need for both across some machines. I can close this PR and open a new one that adds additional logging. |
bdc1047
to
1fa7e4c
Compare
EWS run on current version of this PR (hash 1fa7e4c) |
https://bugs.webkit.org/show_bug.cgi?id=245489 rdar://99293146 Reviewed by Aakash Jain. * Tools/Scripts/delete-if-too-large: Canonical link: https://commits.webkit.org/255737@main
1fa7e4c
to
7380280
Compare
Committed 255737@main (7380280): https://commits.webkit.org/255737@main Reviewed commits have been landed. Closing PR #4574 and removing active labels. |
7380280
1fa7e4c
π§ͺ mac-AS-debug-wk2