Skip to content

Commit

Permalink
no longer require to build
Browse files Browse the repository at this point in the history
  • Loading branch information
wenting-zhao committed Sep 20, 2024
1 parent c24bb2b commit 48ed427
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
10 changes: 5 additions & 5 deletions commit0/harness/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ def create_container(
Exception: For other general errors.
"""
# try:
# # Pull the image if it doesn't already exist
# client.images.pull(image_name)
# except docker.errors.APIError as e:
# raise docker.errors.APIError(f"Error pulling image: {str(e)}")
try:
# Pull the image if it doesn't already exist
client.images.pull(image_name)
except docker.errors.APIError as e:
raise docker.errors.APIError(f"Error pulling image: {str(e)}")

if not logger:
# if logger is None, print to stdout
Expand Down
13 changes: 6 additions & 7 deletions commit0/harness/spec.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import hashlib

from dataclasses import dataclass
from typing import Union, cast, Optional

Expand Down Expand Up @@ -48,12 +46,13 @@ def repo_image_key(self) -> str:
Note that old images are not automatically deleted, so consider cleaning up old images periodically.
"""
hash_object = hashlib.sha256()
hash_object.update(str(self.setup_script).encode("utf-8"))
hash_value = hash_object.hexdigest()
val = hash_value[:22] # 22 characters is still very likely to be unique
# hash_object = hashlib.sha256()
# hash_object.update(str(self.setup_script).encode("utf-8"))
# hash_value = hash_object.hexdigest()
# val = hash_value[:22] # 22 characters is still very likely to be unique
repo = self.repo.split("/")[-1]
return f"commit0.repo.{repo}.{val}:latest".lower()
# return f"commit0.repo.{repo}.{val}:latest".lower()
return f"wentingzhao/{repo}:latest".lower()

def get_container_name(self, run_id: Optional[str] = None) -> str:
repo = self.repo.split("/")[-1]
Expand Down

0 comments on commit 48ed427

Please sign in to comment.