@@ -381,9 +381,12 @@ def fetch_hashes() -> None:
381381 )
382382 truncate_skip_length (pipeline )
383383 handle_sanitizer_skip (pipeline , args .sanitizer )
384- increase_agents_timeouts (pipeline , args .sanitizer , args .coverage )
385384 prioritize_pipeline (pipeline , args .priority )
386385 switch_jobs_to_aws (pipeline , args .priority )
386+ # After `switch_jobs_to_aws`, so that the queue a step ends up on is the one
387+ # that gets sized up. The other order lets the aarch64 to x86_64 fallback
388+ # land on a smaller machine than the size-up asked for.
389+ increase_agents_timeouts (pipeline , args .sanitizer , args .coverage )
387390 permit_rerunning_successful_steps (pipeline )
388391 set_retry_on_agent_lost (pipeline )
389392 set_default_agents_queue (pipeline )
@@ -496,56 +499,55 @@ def handle_sanitizer_skip(pipeline: Any, sanitizer: Sanitizer) -> None:
496499 step ["skip" ] = True
497500
498501
502+ # The next size up for each agent queue, used when a run needs more machine
503+ # than the pipeline asks for.
504+ NEXT_LARGER_AGENT = {
505+ "linux-aarch64-small" : "linux-aarch64" ,
506+ "linux-aarch64" : "linux-aarch64-medium" ,
507+ "linux-aarch64-medium" : "linux-aarch64-large" ,
508+ "linux-aarch64-large" : "builder-linux-aarch64-mem" ,
509+ "linux-x86_64-small" : "linux-x86_64" ,
510+ "linux-x86_64" : "linux-x86_64-medium" ,
511+ "linux-x86_64-medium" : "linux-x86_64-large" ,
512+ "linux-x86_64-large" : "builder-linux-x86_64" ,
513+ "hetzner-aarch64-2cpu-4gb" : "hetzner-aarch64-4cpu-8gb" ,
514+ "hetzner-aarch64-4cpu-8gb" : "hetzner-aarch64-8cpu-16gb" ,
515+ "hetzner-aarch64-8cpu-16gb" : "hetzner-aarch64-16cpu-32gb" ,
516+ "hetzner-x86-64-2cpu-4gb" : "hetzner-x86-64-4cpu-8gb" ,
517+ "hetzner-x86-64-4cpu-8gb" : "hetzner-x86-64-8cpu-16gb" ,
518+ "hetzner-x86-64-8cpu-16gb" : "hetzner-x86-64-16cpu-32gb" ,
519+ "hetzner-x86-64-12cpu-24gb" : "hetzner-x86-64-dedi-16cpu-64gb" ,
520+ "hetzner-x86-64-16cpu-32gb" : "hetzner-x86-64-dedi-16cpu-64gb" ,
521+ "hetzner-x86-64-16cpu-64gb" : "hetzner-x86-64-dedi-32cpu-128gb" ,
522+ "hetzner-x86-64-dedi-8cpu-32gb" : "hetzner-x86-64-dedi-16cpu-64gb" ,
523+ "hetzner-x86-64-dedi-16cpu-64gb" : "hetzner-x86-64-dedi-32cpu-128gb" ,
524+ "hetzner-x86-64-dedi-32cpu-128gb" : "hetzner-x86-64-dedi-48cpu-192gb" ,
525+ }
526+
527+
499528def increase_agents_timeouts (
500529 pipeline : Any , sanitizer : Sanitizer , coverage : bool
501530) -> None :
502- if sanitizer != Sanitizer .none or os .getenv ("CI_SYSTEM_PARAMETERS" , "" ) == "random" :
531+ # Most sanitizer runs, as well as random permutations of system parameters,
532+ # are slower and need more memory. The default system parameters in CI are
533+ # chosen to be efficient for execution, while a random permutation might
534+ # take way longer and use more memory.
535+ if sanitizer != Sanitizer .none :
536+ sizes_up = 2
537+ elif os .getenv ("CI_SYSTEM_PARAMETERS" , "" ) == "random" :
538+ sizes_up = 1
539+ else :
540+ sizes_up = 0
541+
542+ if sizes_up :
503543 for step in steps (pipeline ):
504- # Most sanitizer runs, as well as random permutations of system
505- # parameters, are slower and need more memory. The default system
506- # parameters in CI are chosen to be efficient for execution, while
507- # a random permutation might take way longer and use more memory.
508544 if "timeout_in_minutes" in step :
509545 step ["timeout_in_minutes" ] *= 10
510546
511547 if "agents" in step :
512548 agent = step ["agents" ].get ("queue" , None )
513- if agent == "linux-aarch64-small" :
514- agent = "linux-aarch64"
515- elif agent == "linux-aarch64" :
516- agent = "linux-aarch64-medium"
517- elif agent == "linux-aarch64-medium" :
518- agent = "linux-aarch64-large"
519- elif agent == "linux-aarch64-large" :
520- agent = "builder-linux-aarch64-mem"
521- elif agent == "linux-x86_64-small" :
522- agent = "linux-x86_64"
523- elif agent == "linux-x86_64" :
524- agent = "linux-x86_64-medium"
525- elif agent == "linux-x86_64-medium" :
526- agent = "linux-x86_64-large"
527- elif agent == "linux-x86_64-large" :
528- agent = "builder-linux-x86_64"
529- elif agent == "hetzner-aarch64-2cpu-4gb" :
530- agent = "hetzner-aarch64-4cpu-8gb"
531- elif agent == "hetzner-aarch64-4cpu-8gb" :
532- agent = "hetzner-aarch64-8cpu-16gb"
533- elif agent == "hetzner-aarch64-8cpu-16gb" :
534- agent = "hetzner-aarch64-16cpu-32gb"
535- elif agent == "hetzner-x86-64-2cpu-4gb" :
536- agent = "hetzner-x86-64-4cpu-8gb"
537- elif agent == "hetzner-x86-64-4cpu-8gb" :
538- agent = "hetzner-x86-64-8cpu-16gb"
539- elif agent == "hetzner-x86-64-8cpu-16gb" :
540- agent = "hetzner-x86-64-16cpu-32gb"
541- elif agent == "hetzner-x86-64-12cpu-24gb" :
542- agent = "hetzner-x86-64-dedi-16cpu-64gb"
543- elif agent == "hetzner-x86-64-16cpu-32gb" :
544- agent = "hetzner-x86-64-dedi-16cpu-64gb"
545- elif agent == "hetzner-x86-64-16cpu-64gb" :
546- agent = "hetzner-x86-64-dedi-32cpu-128gb"
547- elif agent == "hetzner-x86-64-dedi-32cpu-128gb" :
548- agent = "hetzner-x86-64-dedi-48cpu-192gb"
549+ for _ in range (sizes_up ):
550+ agent = NEXT_LARGER_AGENT .get (agent , agent )
549551 step ["agents" ] = {"queue" : agent }
550552
551553 if coverage :
0 commit comments