Changeset 245359 in webkit


Ignore:
Timestamp:
May 15, 2019 3:21:24 PM (5 years ago)
Author:
aakash_jain@apple.com
Message:

[ews-build] Enabling uploading EWS archives to S3
https://bugs.webkit.org/show_bug.cgi?id=197914

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/Shared: Added.
  • BuildSlaveSupport/Shared/transfer-archive-to-s3: Moved from Tools/BuildSlaveSupport/build.webkit.org-config/transfer-archive-to-s3.

(archiveExists): Replace tab with space.
(main): Added main method.

  • BuildSlaveSupport/build.webkit.org-config/steps.py:

(TransferToS3): Updated path to the script.

  • BuildSlaveSupport/build.webkit.org-config/transfer-archive-to-s3: Moved to Shared folder.
Location:
trunk/Tools
Files:
1 added
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/Shared/transfer-archive-to-s3

    r245358 r245359  
    33import boto3
    44import os
    5 import os.path
    65import sys
    76
    8 S3_BUCKET = 'archives.webkit.org'
     7S3_DEFAULT_BUCKET = 'archives.webkit.org'
     8S3_EWS_BUCKET = 'ews-archives.webkit.org'
    99S3_MINIFIED_BUCKET = 'minified-archives.webkit.org'
    1010S3_REGION_PREFIX = 'https://s3-us-west-2.amazonaws.com'
     
    1414    key = '/'.join([identifier, revision + '.zip'])
    1515    print '\tS3 Bucket: {}\n\tS3 Key: {}'.format(bucket, key)
     16    s3 = boto3.client('s3')
    1617    s3.upload_file(archive_path, bucket, key)
    1718    print('\tS3 URL: {}/{}/{}'.format(S3_REGION_PREFIX, bucket, key))
     
    2021    if archive:
    2122        if os.path.exists(archive):
    22                 return True
     23            return True
    2324        else:
    2425            print 'WARNING: Archive does not exist: {}'.format(archive)
    2526            return False
    26        
    27 parser = argparse.ArgumentParser(add_help=True)
    28 parser.add_argument('--revision', action="store", required=True, help='Revision number for the built archive')
    29 parser.add_argument('--identifier', action="store", required=True, help='S3 destination identifier, in the form of fullPlatform-architecture-configuration. [mac-sierra-x86_64-release]')
    30 parser.add_argument('--archive', action="store", required=True, help='Path to the full size archive. [path/to/123456.zip]')
    31 args = parser.parse_args()
    3227
     28def main():
     29    parser = argparse.ArgumentParser(add_help=True)
    3330
    34 head, tail = os.path.split(str(args.archive))
    35 minifiedArchive = head + '/minified-' + tail
    36 s3 = boto3.client('s3')
     31    group = parser.add_mutually_exclusive_group(required=True)
     32    group.add_argument('--revision', action="store", help='Revision number or patch_id for the built archive')
     33    group.add_argument('--patch_id', action="store", help='patch_id of the patch')
    3734
    38 if archiveExists(args.archive):
    39     uploadToS3(args.archive, S3_BUCKET, args.identifier, args.revision)
    40 if archiveExists(minifiedArchive):
    41     uploadToS3(minifiedArchive, S3_MINIFIED_BUCKET, args.identifier, args.revision)
     35    parser.add_argument('--identifier', action="store", required=True, help='S3 destination identifier, in the form of fullPlatform-architecture-configuration. [mac-mojave-x86_64-release]')
     36    parser.add_argument('--archive', action="store", required=True, help='Path to the full size archive. [path/to/123456.zip]')
     37    args = parser.parse_args()
     38
     39    parentdir, filename = os.path.split(str(args.archive))
     40    minifiedArchive = os.path.join(parentdir, 'minified-' + filename)
     41
     42    s3_bucket = S3_DEFAULT_BUCKET
     43    if args.patch_id:
     44        s3_bucket = S3_EWS_BUCKET
     45
     46    if archiveExists(args.archive):
     47        uploadToS3(args.archive, s3_bucket, args.identifier, args.revision or args.patch_id)
     48    if not args.patch_id and archiveExists(minifiedArchive):
     49        uploadToS3(minifiedArchive, S3_MINIFIED_BUCKET, args.identifier, args.revision)
     50
     51if __name__ == "__main__":
     52    main()
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py

    r240187 r245359  
    875875    identifier = WithProperties("%(fullPlatform)s-%(architecture)s-%(configuration)s")
    876876    revision = WithProperties("%(got_revision)s")
    877     command = ["python", "./transfer-archive-to-s3", "--revision", revision, "--identifier", identifier, "--archive", archive]
     877    command = ["python", "../Shared/transfer-archive-to-s3", "--revision", revision, "--identifier", identifier, "--archive", archive]
    878878    haltOnFailure = True
    879879
  • trunk/Tools/ChangeLog

    r245338 r245359  
     12019-05-15  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews-build] Enabling uploading EWS archives to S3
     4        https://bugs.webkit.org/show_bug.cgi?id=197914
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * BuildSlaveSupport/Shared: Added.
     9        * BuildSlaveSupport/Shared/transfer-archive-to-s3: Moved from Tools/BuildSlaveSupport/build.webkit.org-config/transfer-archive-to-s3.
     10        (archiveExists): Replace tab with space.
     11        (main): Added main method.
     12        * BuildSlaveSupport/build.webkit.org-config/steps.py:
     13        (TransferToS3): Updated path to the script.
     14        * BuildSlaveSupport/build.webkit.org-config/transfer-archive-to-s3: Moved to Shared folder.
     15
    1162019-05-15  Wenson Hsieh  <wenson_hsieh@apple.com>
    217
Note: See TracChangeset for help on using the changeset viewer.