From fca511be5828fec0596965c2e2297cc699427dd5 Mon Sep 17 00:00:00 2001 From: kramstrom Date: Thu, 28 Nov 2024 09:14:00 +0000 Subject: [PATCH 1/2] remove --- modal/image.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modal/image.py b/modal/image.py index 53d4932ba8..71180c3e46 100644 --- a/modal/image.py +++ b/modal/image.py @@ -1503,8 +1503,6 @@ def from_aws_ecr( def from_dockerfile( # Filepath to Dockerfile. path: Union[str, Path], - # modal.Mount with local files to supply as build context for COPY commands. - # NOTE: The remote_path of the Mount should match the Dockerfile's WORKDIR. # Ignore cached builds, similar to 'docker build --no-cache' force_build: bool = False, *, @@ -1539,9 +1537,9 @@ def base_image_context_mount_function() -> _Mount: gpu_config = parse_gpu_config(gpu) base_image = _Image._from_args( dockerfile_function=build_dockerfile_base, + context_mount_function=base_image_context_mount_function, gpu_config=gpu_config, secrets=secrets, - context_mount_function=base_image_context_mount_function, ) # --- Now add in the modal dependencies, and, optionally a Python distribution From 7cbd0e10c311bba4eb5e223e681ce79bcf8b787b Mon Sep 17 00:00:00 2001 From: kramstrom Date: Thu, 28 Nov 2024 09:21:36 +0000 Subject: [PATCH 2/2] resolve --- modal/image.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modal/image.py b/modal/image.py index 71180c3e46..3eaad40265 100644 --- a/modal/image.py +++ b/modal/image.py @@ -465,8 +465,6 @@ def _from_args( _namespace: "api_pb2.DeploymentNamespace.ValueType" = api_pb2.DEPLOYMENT_NAMESPACE_WORKSPACE, _do_assert_no_mount_layers: bool = True, ): - context_mount = context_mount_function() if modal.is_local() and context_mount_function else None - if base_images is None: base_images = {} @@ -488,13 +486,15 @@ def _deps() -> Sequence[_Object]: deps = tuple(base_images.values()) + tuple(secrets) if build_function: deps += (build_function,) - if context_mount: - deps += (context_mount,) if image_registry_config and image_registry_config.secret: deps += (image_registry_config.secret,) return deps async def _load(self: _Image, resolver: Resolver, existing_object_id: Optional[str]): + context_mount = context_mount_function() if context_mount_function else None + if context_mount: + await resolver.load(context_mount) + if _do_assert_no_mount_layers: for image in base_images.values(): # base images can't have