Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I999 Add configurable execute grace periods for sandbox runs #1000

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

johnbrvc
Copy link
Collaborator

@johnbrvc johnbrvc commented Aug 8, 2024

Description of what the PR does

  1. Add 2 new values to ContestInformation: sandboxGraceTimeSecs and sandboxInteractiveGraceMultiplier. These integer values may be configured using the system.pc2.yaml at contest load time, or the GUI Settings tab after a contest is configured. Default values are: 1 and 3 respectively.

  2. Change Executable to pad execution timers to wait additional time (grace time) for sandbox and interactive sandbox problems, where the sandbox will monitor the actual CPU time of the submission. The timers in PC2, in this case, are for Wall time to protect against sleeping/wall time consuming processes.

  3. Cleaned up some comments that were wrong or had errors in them

  4. Rearranged some code to initialize the timer delays earlier on since they are used in 2 places.

  5. CI: While testing the new sandbox time grace periods, a couple of bugs were found in the SubmitSampleRunsPane (which is used to submit the judge's sample solutions by an administrator. The following were fixed/added to support SubmitSampleRuns:

    • Add alphanumeric sorting instead of pure numeric sorting for some columns since some columns may have both text and numbers in them.
    • Synchronize the add runs since we appear to get 2 runAdded notifications for each run from different worker threads.
    • Fixed bug in Filter where if a custom filter group is used alone, it would not allow you to enable filtering.

Basically, these new configuration parameters replace constants that were used in Executable previously.

This PR is one of those cases where there appear to be lots of changes, but again, Eclipse has made many of them related to spaces or other syntax fixes in ContestInformation.java. Also, there were new modules added and one renamed, so they appear as a lot of differences as well.

Issue which the PR addresses

Fixes #999

Environment in which the PR was developed (OS,IDE, Java version, etc.)

Windows 11/Ubuntu 22.04.1 (tested with both)
java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)

Precise steps for testing the PR (i.e., how to demonstrate that it works correctly)

  1. Choose a CDP for testing
  2. Edit the system.pc2.yaml (or system.yaml, if there is no system.pc2.yaml) and add the following properties:
     sandbox-grace-time-secs: 2
     sandbox-interactive-time-multiplier: 4

  1. Load the contest

  2. Start the pc2server an administrator client.

  3. Go to the "Configure Contest->Settings" tab.

  4. Notice that the values for the Sandbox Grace Time added and Interactive problem time multiplier reflect the values added to the system yaml file:
    image

  5. Using the GUI, change the values to 1 and 3 respectively. (You can click the ? (what's this) buttons next to each value for a detailed description of what they do).

  6. Shutdown the admin and the server

  7. Restart the server and admin

  8. Go to the "Configure Contest->Settings" tab and notice the values that were modified by the GUI have been saved.
    image

Add 2 new values to ContestInformation: sandboxGraceTimeSecs and sandboxInteractiveGraceMultiplier.  These integer values may be configured using the system.pc2.yaml at contest load time, or the GUI Settings tab after a contest is configured.
Change Executable to pad execution timers to wait additional time (grace time) for sandbox and interactive sandbox problems, where the sandbox will monitor the actual CPU time of the submission.  The timers in PC2, in this case, are for Wall time to protect against sleeping/wall time consuming processes.
CI: While testing the new sandbox time grace periods, a couple of bugs were found in the SubmitSampleRunsPane (which is used to submit the judge's sample solutions by an administrator.    The following were fixed/added to support SubmitSampleRuns.
1) Add alphanumeric sorting instead of pure numeric sorting for some columns since some columns may have both text and numbers in them.
2) Synchronize the add runs since we appear to get 2 runAdded notifications for each run from different worker threads.
3) Fixed bug in Filter where if a custom filter group is used alone, it would not allow you to enable filtering.
@johnbrvc johnbrvc added this to the 9.11.0 milestone Aug 8, 2024
@johnbrvc johnbrvc self-assigned this Aug 8, 2024
Copy link
Collaborator

@SamanwaySadhu SamanwaySadhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described. Code changes look good.

Copy link
Collaborator

@kkarakas kkarakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Did not test functionality.

@johnbrvc johnbrvc merged commit fcdc36f into pc2ccs:develop Aug 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Execution Grace Time for interactive and sandbox problems
3 participants