File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
buildkite/bazel-central-registry Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -449,12 +449,20 @@ def should_wait_bcr_maintainer_review(modules):
449
449
450
450
451
451
def upload_jobs_to_pipeline (pipeline_steps ):
452
- """Directly calling the buildkite-agent to upload steps."""
453
- subprocess .run (
454
- ["buildkite-agent" , "pipeline" , "upload" ],
455
- input = yaml .dump ({"steps" : pipeline_steps }).encode (),
456
- check = True ,
457
- )
452
+ """Upload jobs to Buildkite in batches."""
453
+ BATCH_SIZE = 2000
454
+ for i in range (0 , len (pipeline_steps ), BATCH_SIZE ):
455
+ batch = pipeline_steps [i :i + BATCH_SIZE ]
456
+ # Upload the batch to Buildkite
457
+ bazelci .eprint (f"Uploading batch { i // BATCH_SIZE + 1 } of { len (pipeline_steps ) // BATCH_SIZE + 1 } " )
458
+ try :
459
+ subprocess .run (
460
+ ["buildkite-agent" , "pipeline" , "upload" ],
461
+ input = yaml .dump ({"steps" : batch }).encode (),
462
+ check = True ,
463
+ )
464
+ except subprocess .CalledProcessError as e :
465
+ error (f"Failed to upload batch { i // BATCH_SIZE + 1 } to Buildkite: { e } " )
458
466
459
467
460
468
def main (argv = None ):
You can’t perform that action at this time.
0 commit comments