-
Notifications
You must be signed in to change notification settings - Fork 372
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 log collection tool and thread #1987
Conversation
for file in files_to_collect: | ||
archive_file_name = LogCollector._convert_file_name_to_archive_name(file) | ||
compressed_archive.write(file, arcname=archive_file_name) | ||
with zipfile.ZipFile(COMPRESSED_ARCHIVE_PATH, "w", compression=zipfile.ZIP_DEFLATED) as compressed_archive: |
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.
FYI, I found the change I made to make ZipFile python2.6 compatible: you can check out this commit in ExperimentalTestFramework
's history: 600e6bb41f3d5506543454b27983a04cba1f1930
.
Here's the before:
with zipfile.ZipFile(zip_file_buffer, "w", zipfile.ZIP_DEFLATED, False) as file:
file.writestr("HandlerManifest.json", json.dumps(manifest))
if extra_files != None:
for key, value in extra_files.items():
file.writestr(key, value)
return zip_file_buffer.getvalue()
and here's the after:
file = zipfile.ZipFile(zip_file_buffer, "w", zipfile.ZIP_DEFLATED, False)
try:
file.writestr("HandlerManifest.json", json.dumps(manifest))
if extra_files != None:
for key, value in extra_files.items():
file.writestr(key, value)
finally:
file.close()
return zip_file_buffer.getvalue()
Don't know if we want to add python2.6 support in this PR, but this would possibly be useful as a comment to make it easy to add it in a future one.
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.
Thanks for the analysis! Since we are first targeting VMs with systemd (in order to enable resource limiting), none of them actually run py2.6, so I will take this change when we are expanding to non-systemd VMs. This will be useful for sure!
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.
Initial comments
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.
Some comments on the main code, will review the tests now
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.
Final comments
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.
Thanks for the changes, this would be really helpful once enabled! :)
Description
This work is the continuation of #1902 and #1847. In this PR there are two main updates:
systemd-run
and is ran with CPU and memory limits.Note that the feature is disabled by default for now.
PR information
Quality of Code and Contribution Guidelines