diff --git a/joj3_config_generator/generator.py b/joj3_config_generator/generator.py index 2edc98a..f4a389c 100644 --- a/joj3_config_generator/generator.py +++ b/joj3_config_generator/generator.py @@ -26,8 +26,8 @@ def convert_joj3_conf(repo_conf: repo.Config, task_conf: task.Config) -> result. name=task_conf.task.name, # exact folder difference specified by type log_path=str(JOJ3_LOG_PATH), - expire_unix_timestamp=int(task_conf.release.end_time.timestamp()), - effective_unix_timestamp=int(task_conf.release.begin_time.timestamp()), + expire_unix_timestamp=0, # will be handled in the health check stage + effective_unix_timestamp=0, # will be handled in the health check stage actor_csv_path=str(ACTOR_CSV_PATH), # students.csv position max_total_score=( repo_conf.max_total_score diff --git a/joj3_config_generator/models/task.py b/joj3_config_generator/models/task.py index 450e7b6..ac0c149 100644 --- a/joj3_config_generator/models/task.py +++ b/joj3_config_generator/models/task.py @@ -211,6 +211,11 @@ class Release(BaseModel): ) # timestamp = 0, no begin time +class SubmissionTime(BaseModel): + begin: Optional[datetime] = None + end: Optional[datetime] = None + + class Task(BaseModel): name: str = "unknown" @@ -219,6 +224,7 @@ class Config(BaseModel): root: Path = Path(".") path: Path = Path("task.toml") task: Task = Task() # Task name (e.g., hw3 ex5) + time: SubmissionTime = SubmissionTime() # Valid time configuration release: Release = Release() # Release configuration stages: List[Stage] = [] # list of stage configurations groups: Groups = Groups() diff --git a/joj3_config_generator/transformers/repo.py b/joj3_config_generator/transformers/repo.py index 2fde0ad..d9da48c 100644 --- a/joj3_config_generator/transformers/repo.py +++ b/joj3_config_generator/transformers/repo.py @@ -95,6 +95,10 @@ def get_teapot_check_args(repo_conf: repo.Config, task_conf: task.Config) -> Lis task_conf.groups if task_conf.groups.name else repo_conf.groups ) res.extend(["--group-config", group_config]) + if task_conf.time.begin: + res.extend(["--begin-time", task_conf.time.begin.isoformat()]) + if task_conf.time.end: + res.extend(["--end-time", task_conf.time.end.isoformat()]) return res @@ -108,7 +112,8 @@ def get_health_check_stage( name="local", with_=result.ExecutorWith( default=result.Cmd( - cpu_limit=common.Time("10s"), clock_limit=common.Time("20s") + cpu_limit=common.Time("10s"), + clock_limit=common.Time("20s"), ), cases=[ result.OptionalCmd(