-
Notifications
You must be signed in to change notification settings - Fork 6
Support for interactive tasks via IO #233
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
Closed
Closed
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
cb6bd0a
First refactors
MasloMaslane fdd01ad
Refactor running
MasloMaslane 7842a37
Bump version
MasloMaslane 65aee45
Interactive with time
MasloMaslane aeb7ca8
package with interactive task via io
MasloMaslane 79bebd4
Merge branch 'main' into interactive-via-io
MasloMaslane 3c1c8d6
Close fds
MasloMaslane cd59668
Initial support for sio2jail
MasloMaslane 4367cff
Better parsing
MasloMaslane e8f2dd6
sio2jail fixes
MasloMaslane fbb264e
Fix tests
MasloMaslane cf5482d
No outgen in interactive
MasloMaslane 7e50d70
Exit on failed interactor compilation
MasloMaslane b992a7f
Remove cache on interactor change
MasloMaslane b1093d7
Refactor and cleanup
MasloMaslane e65f25c
Stuff
MasloMaslane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from enum import Enum | ||
|
||
|
||
class TaskType(Enum): | ||
NORMAL = 1 | ||
INTERACTIVE_IO = 2 | ||
ENCDEC = 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
|
||
from sinol_make.helpers import package_util | ||
from sinol_make.task_type.base import BaseTaskType | ||
from sinol_make.task_type.interactive_io import InteractiveIOTask | ||
from sinol_make.task_type.normal import NormalTask | ||
|
||
|
||
def get_task_type() -> BaseTaskType: | ||
if 'encdec' in os.listdir(os.getcwd()): | ||
# Encdec is not actually supported by sinol-make, as it isn't yet merged in OIOIOI. | ||
# (And probably never will) | ||
raise NotImplementedError("Encdec is not supported by sinol-make.") | ||
task_id = package_util.get_task_id() | ||
if package_util.any_files_matching_pattern(task_id, f"{task_id}soc.*"): | ||
return InteractiveIOTask(task_id) | ||
return NormalTask(task_id) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this 2 times time limit in any way tested to be enough? I have an example, where sio2jail runs 1.5 times longer than time measured by the jail. If not, given "worse" program or slower machine, this hard time limit may be exceeded, without exceeding time_limit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to work well in real sioworkers. But I guess on some systems it may fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be another discrepancy between upstream sioworkers and those on sio2.mimuw, but the first repo contains a multiplier of 16 with an additional second, see here and here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I didn't know about this. On sio2.mimuw we also have 16x time limit for sio2jail