From 46ad89c403b5f2b628e3c6fdc9efe15c1bddc2a5 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Thu, 24 Aug 2023 15:22:16 -0700 Subject: [PATCH] add s3 uploader --- pv2/importer/.operation.py.swp | Bin 0 -> 77824 bytes pv2/importer/operation.py | 58 ++++++++++++++++++++++++++++++--- pv2/scripts/import_pkg.py | 20 ++++++++++-- pv2/util/uploader.py | 2 +- 4 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 pv2/importer/.operation.py.swp diff --git a/pv2/importer/.operation.py.swp b/pv2/importer/.operation.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..a0d7c32ea30ed7cd2fd9effac3cde4c7ade58527 GIT binary patch literal 77824 zcmeI537lkAb^i+lTtO7$!r$dFEmZeRcl8Vi;@|+oFbt!!;LNZ&GnO?~ue*z>&3aYS zGq$ZU?i!8zg2p}ZuLMkDOiW@DmWVM?F&ZTT|3n2bE<`lO1x52c=id9?eYNx=_*dhr z&-|vk-n;9$>$zvS`&M7Hd28^b!s;BKV{^HY8^2ch*pVv_d+F_mlC$+L_$ft=1~hp=h#o;ABO$-fFfxVSBRK z3frYlwb>}N4yB`KzcLDB6!>{5(Cti3oPKofl#|!!P#;-wLU7zeFZ_8^%i?7e$S9Ce zAfrG=fs6tf1u_a`6v!y>Ye<1k>$u$WDEHyE?2ohGhxL3PVSis_zfb6Sf292#+V2BB z@9%4WyL4{ud4H7seTn`4QqTMQ+uxVk?v{h` z`@Ctt|Fh@)1MKsM+V5vrg1P)%zApV{&--I+ywmOXH9hZ-w$C4KzwhdK|3h2;r`z`r zzK{9C<hcw$I)7zx2F!_1b2`eWmC9L+o=$=QXw=UH&$BZo3V4de3|N zIQz;dkWnC`Kt_R#0vQD|3S<<>D3DPgqd-Q1UlIjMm0a!vFt29{0}2!A`2SDBD83WC z4ZH-r0Q?R(2pZs-Uc{e(`ULh$k+l{bNh&q*Kw<8Ym$MPczkNVQkw^riP-eqy2$PE{LWe!TA;X%wSo zw_O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%t zr^n`%cB!$GaJ{o+B3jcz^$?BPZB>VJ5?qGbRxPtpM_c{nrIfba(u9W; zy0;ou|`Ml)xph^k*HOgD!&sUu~<4LLS-qgd=jmSlw5f# z|MR#GShCxI9+v@wme;`!15(Zctcecmw1^(faA%j%l=~bo4v+R% zTP=Nw*ikPmOVsa#+W88Sb1qKAL6(Zo)MPxW)~mG=*BpthXmCy!sga0}kXr_-=Rq@= z8zj;Vk@Qv5DCU1N+x((Uc1?fQ86)ZOeldI*_hJ{^DB)#~#5g8iX04kL(vjnThqdma zy+$g&oSq}$2lbv`J44-HCS{lqITkehWs@p%; z_4ii0oZA;k4Ewxip0hpGZD#NAc9zlt^66=X_&$Rn&5_ec{KxK(tMKF|IBg8;yJ(qn=_Qo`!?7dRX$5d3B3X5T*+^nz)CL0yWR7=sX);}@lZ5rn% z<}A7G4rad4e=Aiw1j*|5tY0g%i5o-l)M7QUWSQ=Ax1iP4&M0Ob aHD&f5%*WSP`K8XMS7vW}^s9Ey(f 0: self.__dest_branch = dest_branch @@ -612,7 +649,7 @@ class GitImport(Import): raise err.ConfigurationError(f'{upstream_lookaside} is not valid.') # pylint: disable=too-many-locals, too-many-statements, too-many-branches - def pkg_import(self, skip_lookaside: bool = False): + def pkg_import(self, skip_lookaside: bool = False, s3_upload: bool = False): """ Actually perform the import @@ -765,6 +802,19 @@ class GitImport(Import): self.import_lookaside(dest_git_repo_path, self.rpm_name, dest_branch, sources, self.dest_lookaside) + if s3_upload: + # I don't want to blatantly blow up here yet. + if len(self.__aws_access_key_id) == 0 or len(self.__aws_access_key) == 0 or len(self.__aws_bucket) == 0: + print('WARNING: No access key, ID, or bucket was provided. Skipping upload.') + else: + self.upload_to_s3( + dest_git_repo_path, + sources, + self.__aws_bucket, + self.__aws_access_key_id, + self.__aws_access_key, + ) + # This is a temporary hack. There are cases that the .gitignore that's # provided by upstream errorneouly keeps out certain sources, despite # the fact that they were pushed before. We're killing off any diff --git a/pv2/scripts/import_pkg.py b/pv2/scripts/import_pkg.py index 0595f5f..6d69a87 100644 --- a/pv2/scripts/import_pkg.py +++ b/pv2/scripts/import_pkg.py @@ -24,6 +24,10 @@ rpm_parser.add_argument('--verify-signature', action='store_true') rpm_parser.add_argument('--skip-lookaside-upload', action='store_true', help='Set this flag to skip uploading to /var/www/html/sources esque lookaside') +rpm_parser.add_argument('--upload-to-s3', action='store_true') +rpm_parser.add_argument('--aws-access-key-id', type=str, required=False, default='') +rpm_parser.add_argument('--aws-access-key', type=str, required=False, default='') +rpm_parser.add_argument('--aws-bucket', type=str, required=False, default='') git_parser.add_argument('--name', type=str, required=True) git_parser.add_argument('--source-gituser', type=str, required=False, default='git') @@ -47,6 +51,10 @@ git_parser.add_argument('--alternate-spec-name', git_parser.add_argument('--skip-lookaside-upload', action='store_true', help='Set this flag to skip uploading to /var/www/html/sources esque lookaside') +git_parser.add_argument('--upload-to-s3', action='store_true') +git_parser.add_argument('--aws-access-key-id', type=str, required=False, default='') +git_parser.add_argument('--aws-access-key', type=str, required=False, default='') +git_parser.add_argument('--aws-bucket', type=str, required=False, default='') results = parser.parse_args() command = parser.parse_args().cmd @@ -66,8 +74,12 @@ def main(): org=results.gitorg, dest_lookaside=results.dest_lookaside, verify_signature=results.verify_signature, + aws_access_key_id=results.aws_access_key_id, + aws_access_key=results.aws_access_key, + aws_bucket=results.aws_bucket, ) - classy.pkg_import(skip_lookaside=results.skip_lookaside_upload) + classy.pkg_import(skip_lookaside=results.skip_lookaside_upload, + s3_upload=results.upload_to_s3) elif command == 'git': classy = importutil.GitImport( package=results.name, @@ -84,8 +96,12 @@ def main(): distprefix=results.distprefix, alternate_spec_name=results.alternate_spec_name, dest_lookaside=results.dest_lookaside, + aws_access_key_id=results.aws_access_key_id, + aws_access_key=results.aws_access_key, + aws_bucket=results.aws_bucket, ) - classy.pkg_import(skip_lookaside=results.skip_lookaside_upload) + classy.pkg_import(skip_lookaside=results.skip_lookaside_upload, + s3_upload=results.upload_to_s3) else: print('Unknown command') diff --git a/pv2/util/uploader.py b/pv2/util/uploader.py index e798403..5cb0e46 100644 --- a/pv2/util/uploader.py +++ b/pv2/util/uploader.py @@ -54,7 +54,7 @@ def upload_to_s3( dest_name = os.path.basename(input_file) if s3 is None: - err.UploadError('s3 module is not available') + raise err.UploadError('s3 module is not available') s3_client = boto3.client( 's3',