Skip to content

Fix docker running error #22

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
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix docker running error exit
  • Loading branch information
nanjiangwill committed Sep 12, 2024
commit efc7fb38e4c7572b128b06da724be79e95ca17fc
2 changes: 1 addition & 1 deletion commit0/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def main() -> None:
)
# type check config values
cs = ConfigStore.instance()
cs.store(name="user", node=Commit0Config)
cs.store(name="user", group="Commit0Config", node=Commit0Config)
# have hydra to ignore all command-line arguments
sys_argv = copy.deepcopy(sys.argv)
sys.argv = [sys.argv[0]]
Expand Down
11 changes: 8 additions & 3 deletions commit0/harness/run_pytest_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import traceback
from pathlib import Path
import logging

import sys
from typing import Iterator
from git import Repo
from commit0.harness.constants import RUN_PYTEST_LOG_DIR, RepoInstance
Expand Down Expand Up @@ -108,6 +108,7 @@ def run_docker(
assert container is not None
cleanup_container(client, container, logger)
close_logger(logger)
return test_output


def run_modal(
Expand Down Expand Up @@ -254,10 +255,14 @@ def main(
eval_file.write_text(eval_script)

if ExecutionBackend(backend) == ExecutionBackend.LOCAL:
run_docker(spec, logger, eval_file, timeout, log_dir, stdout)
exit_error_message = run_docker(
spec, logger, eval_file, timeout, log_dir, stdout
)
elif ExecutionBackend(backend) == ExecutionBackend.MODAL:
run_modal(spec, logger, eval_file, timeout, log_dir, stdout)
return str(log_dir)

if exit_error_message:
sys.exit(exit_error_message)


__all__ = []
Loading