chore: change camel case naming
This commit is contained in:
parent
e79e66c1a7
commit
610cb3a1d5
|
@ -1,7 +1,7 @@
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from joj3_config_generator.models import joj1, repo, result, task
|
from joj3_config_generator.models import joj1, repo, result, task
|
||||||
from joj3_config_generator.processers.repo import getHealthcheckConfig, getTeapotConfig
|
from joj3_config_generator.processers.repo import get_healthcheck_config, get_teapot_config
|
||||||
from joj3_config_generator.processers.task import (
|
from joj3_config_generator.processers.task import (
|
||||||
fix_diff,
|
fix_diff,
|
||||||
fix_dummy,
|
fix_dummy,
|
||||||
|
@ -24,11 +24,11 @@ def convert(repo_conf: repo.Config, task_conf: task.Config) -> result.Config:
|
||||||
else -1
|
else -1
|
||||||
),
|
),
|
||||||
stage=result.Stage(stages=[], sandbox_token=repo_conf.sandbox_token),
|
stage=result.Stage(stages=[], sandbox_token=repo_conf.sandbox_token),
|
||||||
teapot=result.Teapot(),
|
teapot=get_teapot_config(repo_conf, task_conf),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Construct healthcheck stage
|
# Construct healthcheck stage
|
||||||
healthcheck_stage = getHealthcheckConfig(repo_conf)
|
healthcheck_stage = get_healthcheck_config(repo_conf)
|
||||||
result_conf.stage.stages.append(healthcheck_stage)
|
result_conf.stage.stages.append(healthcheck_stage)
|
||||||
cached: list[str] = []
|
cached: list[str] = []
|
||||||
# Convert each stage in the task configuration
|
# Convert each stage in the task configuration
|
||||||
|
|
|
@ -6,25 +6,25 @@ from pathlib import Path
|
||||||
from joj3_config_generator.models import repo, result, task
|
from joj3_config_generator.models import repo, result, task
|
||||||
|
|
||||||
|
|
||||||
def getGradingRepoName() -> str:
|
def get_grading_repo_name() -> str:
|
||||||
# FIXME: uncomment back when everything is ready!
|
# FIXME: uncomment back when everything is ready!
|
||||||
host_name = "engr151"
|
host_name = "engr151"
|
||||||
# host_name = socket.gethostname()
|
# host_name = socket.gethostname()
|
||||||
return f"{host_name.split('-')[0]}-joj"
|
return f"{host_name.split('-')[0]}-joj"
|
||||||
|
|
||||||
|
|
||||||
def getTeapotConfig(repo_conf: Repo, task_conf: Task) -> TeapotConfig:
|
def get_teapot_config(repo_conf: repo.Config, task_conf: task.Config) -> result.Teapot:
|
||||||
teapot = TeapotConfig(
|
teapot = result.Teapot(
|
||||||
# TODO: fix the log path
|
# TODO: fix the log path
|
||||||
log_path=f"{task_conf.task.replace(' ', '-')}-joint-teapot-debug.log",
|
log_path=f"{task_conf.task.replace(' ', '-')}-joint-teapot-debug.log",
|
||||||
scoreboard_path=f"{task_conf.task.replace(' ', '-')}-scoreboard.csv",
|
scoreboard_path=f"{task_conf.task.replace(' ', '-')}-scoreboard.csv",
|
||||||
failed_table_path=f"{task_conf.task.replace(' ', '-')}-failed-table.md",
|
failed_table_path=f"{task_conf.task.replace(' ', '-')}-failed-table.md",
|
||||||
grading_repo_name=getGradingRepoName(),
|
grading_repo_name=get_grading_repo_name(),
|
||||||
)
|
)
|
||||||
return teapot
|
return teapot
|
||||||
|
|
||||||
|
|
||||||
def getHealthcheckCmd(repo_conf: Repo) -> Cmd:
|
def get_healthcheck_cmd(repo_conf: repo.Config) -> result.Cmd:
|
||||||
repoSize = repo_conf.max_size
|
repoSize = repo_conf.max_size
|
||||||
immutable = repo_conf.files.immutable
|
immutable = repo_conf.files.immutable
|
||||||
repo_size = f"-repoSize={str(repoSize)} "
|
repo_size = f"-repoSize={str(repoSize)} "
|
||||||
|
@ -61,13 +61,13 @@ def getHealthcheckCmd(repo_conf: Repo) -> Cmd:
|
||||||
return cmd
|
return cmd
|
||||||
|
|
||||||
|
|
||||||
def getHealthcheckConfig(repo_conf: repo.Config) -> result.StageDetail:
|
def get_healthcheck_config(repo_conf: repo.Config) -> result.StageDetail:
|
||||||
healthcheck_stage = result.StageDetail(
|
healthcheck_stage = result.StageDetail(
|
||||||
name="healthcheck",
|
name="healthcheck",
|
||||||
group="",
|
group="",
|
||||||
executor=ExecutorConfig(
|
executor=ExecutorConfig(
|
||||||
name="sandbox",
|
name="sandbox",
|
||||||
with_=ExecutorWithConfig(default=getHealthcheckCmd(repo_conf), cases=[]),
|
with_=result.ExecutorWith(default=get_healthcheck_cmd(repo_conf), cases=[]),
|
||||||
),
|
),
|
||||||
parsers=[ParserConfig(name="healthcheck", with_={"score": 0, "comment": ""})],
|
parsers=[ParserConfig(name="healthcheck", with_={"score": 0, "comment": ""})],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user