File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from datetime import datetime , timezone
1010from pathlib import Path
1111
12- import docker
1312import dspy
14- from docker .errors import APIError , ImageNotFound , NotFound
1513
14+ import docker
1615from datasmith .agents .tool_executor import ContainerToolExecutor
1716from datasmith .docker .context import BuildResult , ContextRegistry , DockerContext
1817from datasmith .docker .orchestrator import gen_run_labels
1918from datasmith .docker .validation import Task
19+ from docker .errors import APIError , ImageNotFound , NotFound
2020
2121logger = logging .getLogger (__name__ )
2222
@@ -503,7 +503,7 @@ def agent_build_and_validate( # noqa: C901
503503 timeout_s = args .build_timeout ,
504504 tail_chars = args .tail_chars ,
505505 probe = True ,
506- pull = True ,
506+ pull = False ,
507507 force = False , # don't rebuild if already present
508508 run_labels = run_labels ,
509509 )
Original file line number Diff line number Diff line change 1616from typing import Any , ClassVar
1717
1818import docker
19- from docker .errors import APIError , DockerException , ImageNotFound
20-
2119from datasmith .execution .utils import _get_commit_info
2220from datasmith .logging_config import get_logger
21+ from docker .errors import APIError , DockerException , ImageNotFound
2322
2423logger = get_logger ("docker.context" )
2524
@@ -226,6 +225,7 @@ def build_container(
226225 if not image_exists :
227226 cache_from = None
228227 if base_image := os .environ .get ("DOCKER_CACHE_FROM" , None ):
228+ logger .info ("Using DOCKER_CACHE_FROM='%s' for build cache." , base_image )
229229 build_args = {** build_args , "BASE_IMAGE" : base_image }
230230 cache_from = [base_image ]
231231
@@ -305,6 +305,7 @@ def build_container_streaming( # noqa: C901
305305
306306 cache_from = None
307307 if base_image := os .environ .get ("DOCKER_CACHE_FROM" , None ):
308+ logger .info ("Using DOCKER_CACHE_FROM='%s' for build cache." , base_image )
308309 build_args = {** build_args , "BASE_IMAGE" : base_image }
309310 cache_from = [base_image ]
310311
You can’t perform that action at this time.
0 commit comments