feat: add timeout settings and cleanup step in data science runner (#539)

* feat: Add timeout settings and cleanup step in data science runner

* lint
This commit is contained in:
you-n-g
2025-01-24 15:03:21 +08:00
committed by GitHub
parent f596e59bd8
commit 2453a6bff7
3 changed files with 15 additions and 2 deletions
+7 -1
View File
@@ -30,8 +30,8 @@ class DataScienceBasePropSetting(KaggleBasePropSetting):
# model_feature_selection_coder: str = "rdagent.scenarios.kaggle.developer.coder.KGModelFeatureSelectionCoder"
# """Model Feature Selection Coder class"""
# model_coder: str = "rdagent.scenarios.kaggle.developer.coder.KGModelCoSTEER"
# """Model Coder class"""
## dev/runner
@@ -45,7 +45,13 @@ class DataScienceBasePropSetting(KaggleBasePropSetting):
summarizer: str = "rdagent.scenarios.kaggle.developer.feedback.KGExperiment2Feedback"
"""Summarizer class"""
## Workflow Related
consecutive_errors: int = 5
debug_timeout: int = 600
"""The timeout limit for running on debugging data"""
full_timeout: int = 3600
"""The timeout limit for running on full data"""
DS_RD_SETTING = DataScienceBasePropSetting()
+3
View File
@@ -271,6 +271,9 @@ class Experiment(
# If we implement the whole workflow, we don't have to use it, then we remove it.
self.based_experiments: Sequence[ASpecificWSForExperiment] = based_experiments
# NOTE: Assumption
# - only runner will assign this variable
# - We will always create a new Experiment without copying previous results when we goto the next new loop.
self.result: object = None # The result of the experiment, can be different types in different scenarios.
self.sub_results: dict[str, float] = (
{}
+5 -1
View File
@@ -16,10 +16,14 @@ class DSRunner(Developer[DSExperiment]):
def develop(self, exp: DSExperiment) -> DSExperiment:
ds_docker_conf = DSDockerConf()
ds_docker_conf.extra_volumes = {f"{DS_RD_SETTING.local_data_path}/{self.scen.competition}": "/kaggle/input"}
ds_docker_conf.running_timeout_period = 60 * 60 # 1 hours
ds_docker_conf.running_timeout_period = DS_RD_SETTING.full_timeout
de = DockerEnv(conf=ds_docker_conf)
stdout = exp.experiment_workspace.execute(
env=de, entry=f"rm submission.csv scores.csv"
) # Remove previous submission and scores files generated by worklfow.
# execute workflow
stdout = exp.experiment_workspace.execute(env=de, entry="coverage run main.py")