Skip to content

CPU limit on default queue

Limit CPU usage on the default queue`

@Didayolo`

A brief description of the purpose of the changes contained in this PR.

Limit duration of submissions (DONE): We should add an option in the .env file specifying a maximum execution time limit for jobs in the default queue (main queue of the platform).

Limit submissions (DONE): This way, the main queue could not get blocked by long jobs running in parallel. This would incentivize organizers to use their own queue if they want to make more ambitious benchmarks.

Issues this PR resolves

A checklist for hand testing

  • create a queue and get it working and attached to competition (attached below) or custom comp you already have.

  • default queue:

    • MAX_EXECUTION_TIME_LIMIT=20 in .env file;
    • time.sleep(15) in score.py in attached competition or other comp;
    • set phase execution_time_limit to 10 seconds
    • submission should fail as 15 seconds is longer than 10 sec limit and below default queue limit
  • default queue:

    • MAX_EXECUTION_TIME_LIMIT=20 in .env file;
    • time.sleep(15) in score.py in attached competition or other comp;
    • set phase execution_time_limit to 35 seconds
    • submission should pass as 15 seconds is less than 35 sec limit and below default queue limit
  • default queue:

    • MAX_EXECUTION_TIME_LIMIT=20 in .env file;
    • time.sleep(25) in score.py in attached competition or other comp;
    • set phase execution_time_limit to 35 seconds
    • submission should fail as 25 seconds is longer than 20 sec default queue limit regardless of execution_time_imit
  • custom queue:

    • MAX_EXECUTION_TIME_LIMIT=20 in .env file;
    • time.sleep(15) in score.py in attached competition or other comp;
    • set phase execution_time_limit to 10 seconds
    • submission should fail as 15 seconds is longer than 10 sec execution_time_imit
  • custom queue:

    • MAX_EXECUTION_TIME_LIMIT=20 in .env file;
    • time.sleep(15) in score.py in attached competition or other comp;
    • set phase execution_time_limit to 35 seconds
    • submission should pass as 15 seconds is less than 35 sec execution_time_imit
  • custom queue:

    • MAX_EXECUTION_TIME_LIMIT=20 in .env file;
    • time.sleep(25) in score.py in attached competition or other comp;
    • set phase execution_time_limit to 35 seconds
    • submission should pass as 25 seconds is less than 35 sec execution_time_imit

Any relevant files for testing

template_v2_competition_bundle.zip

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

Merge request reports

Loading