fix: kaggle data mount problem (#297)

* fix kaggle data founding in feature running

* fix CI
This commit is contained in:
XianBW
2024-09-23 14:20:40 +08:00
committed by GitHub
parent d3db48e06e
commit 0bff8dd1a4
2 changed files with 12 additions and 2 deletions
@@ -48,6 +48,11 @@ class KGFBWorkspace(FBWorkspace):
"X_test.pkl",
"passenger_ids.pkl",
],
running_extra_volume=(
{KAGGLE_IMPLEMENT_SETTING.local_data_path + "/" + KAGGLE_IMPLEMENT_SETTING.competition: "/kaggle/input"}
if KAGGLE_IMPLEMENT_SETTING.competition
else None
),
)
if results is None:
logger.error("Feature preprocess failed.")
+7 -2
View File
@@ -321,7 +321,12 @@ class DockerEnv(Env[DockerConf]):
raise RuntimeError(f"Error while running the container: {e}")
def dump_python_code_run_and_get_results(
self, code: str, dump_file_names: list[str], local_path: str | None = None, env: dict | None = None
self,
code: str,
dump_file_names: list[str],
local_path: str | None = None,
env: dict | None = None,
running_extra_volume: dict | None = None,
):
"""
Dump the code into the local path and run the code.
@@ -330,7 +335,7 @@ class DockerEnv(Env[DockerConf]):
with open(os.path.join(local_path, random_file_name), "w") as f:
f.write(code)
entry = f"python {random_file_name}"
log_output = self.run(entry, local_path, env)
log_output = self.run(entry, local_path, env, running_extra_volume=running_extra_volume)
results = []
os.remove(os.path.join(local_path, random_file_name))
for name in dump_file_names: