Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #19244 - asajeffrey:test-perf-submit-to-s3, r=jdm
Submit test-perf CSV files to S3 <!-- Please describe your changes on the following line: --> Submit CSV files to S3 rather than json files to Perfherder. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes do not require tests because this is test infrastructure <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19244) <!-- Reviewable:end -->
- Loading branch information
Showing
5 changed files
with
85 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import argparse | ||
import boto3 | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser( | ||
description=("Set the policy of the servo-perf bucket. " | ||
"Remember to set your S3 credentials " | ||
"https://github.com/boto/boto3")) | ||
parser.parse_args() | ||
|
||
s3 = boto3.resource('s3') | ||
BUCKET = 'servo-perf' | ||
POLICY = """{ | ||
"Version":"2012-10-17", | ||
"Statement":[ | ||
{ | ||
"Effect":"Allow", | ||
"Principal":"*", | ||
"Action":[ | ||
"s3:ListBucket", | ||
"s3:GetBucketLocation" | ||
], | ||
"Resource":"arn:aws:s3:::servo-perf" | ||
}, | ||
{ | ||
"Effect":"Allow", | ||
"Principal":"*", | ||
"Action":[ | ||
"s3:GetObject", | ||
"s3:GetObjectAcl" | ||
], | ||
"Resource":"arn:aws:s3:::servo-perf/*" | ||
} | ||
] | ||
}""" | ||
|
||
s3.BucketPolicy(BUCKET).put(Policy=POLICY) | ||
|
||
print("Done!") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import argparse | ||
import boto3 | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser( | ||
description=("Submit Servo performance data to S3. " | ||
"Remember to set your S3 credentials " | ||
"https://github.com/boto/boto3")) | ||
parser.add_argument("perf_file", | ||
help="the output CSV file from runner") | ||
parser.add_argument("perf_key", | ||
help="the S3 key to upload to") | ||
args = parser.parse_args() | ||
|
||
s3 = boto3.client('s3') | ||
BUCKET = 'servo-perf' | ||
s3.upload_file(args.perf_file, BUCKET, args.perf_key) | ||
|
||
print("Done!") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters