Skip to content

Commit e345816

Browse files
authored
remove cache_from_tag (#4837)
1 parent 80f33c3 commit e345816

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/image.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def __init__(
3939
tag,
4040
to_build,
4141
stage,
42-
cache_from_tag,
4342
context=None,
4443
to_push=True,
4544
additional_tags=[],
@@ -53,7 +52,6 @@ def __init__(
5352
self.build_args = {}
5453
self.labels = {}
5554
self.stage = stage
56-
self.cache_from_tag = cache_from_tag
5755
self.dockerfile = dockerfile
5856
self.context = context
5957
self.to_push = to_push
@@ -205,7 +203,6 @@ def docker_build(self, fileobj=None, custom_context=False):
205203
"""
206204
response = [f"Starting the Build Process for {self.repository}:{self.tag}"]
207205
LOGGER.info(f"Starting the Build Process for {self.repository}:{self.tag}")
208-
LOGGER.info(f"Using cache_from {self.repository}:{self.cache_from_tag}")
209206

210207
line_counter = 0
211208
line_interval = 50
@@ -220,7 +217,6 @@ def docker_build(self, fileobj=None, custom_context=False):
220217
buildargs=self.build_args,
221218
labels=self.labels,
222219
target=self.target,
223-
cache_from=[f"{self.repository}:{self.cache_from_tag}"], # Add cache source
224220
):
225221
# print the log line during build for every line_interval lines for debugging
226222
if line_counter % line_interval == 0:

src/image_builder.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,8 @@ def image_builder(buildspec, image_types=[], device_types=[]):
134134
ARTIFACTS.update(image_config["context"])
135135

136136
if build_context == "PR":
137-
cache_from_tag = tag_image_with_pr_number(image_config["tag"])
138137
image_tag = tag_image_with_pr_number(image_config["tag"])
139138
else:
140-
cache_from_tag = image_config["tag"]
141139
image_tag = image_config["tag"]
142140

143141
if is_autopatch_build_enabled(buildspec_path=buildspec):
@@ -361,7 +359,6 @@ def image_builder(buildspec, image_types=[], device_types=[]):
361359
tag=append_tag(image_tag, "pre-push"),
362360
to_build=image_config["build"],
363361
stage=constants.PRE_PUSH_STAGE,
364-
cache_from_tag=cache_from_tag,
365362
context=context,
366363
additional_tags=additional_image_tags,
367364
target=target,
@@ -373,7 +370,7 @@ def image_builder(buildspec, image_types=[], device_types=[]):
373370
# inside function get_common_stage_image_object we make pre_push_stage_image_object non pushable.
374371
if image_config.get("enable_common_stage_build", True):
375372
common_stage_image_object = generate_common_stage_image_object(
376-
pre_push_stage_image_object, image_tag, cache_from_tag
373+
pre_push_stage_image_object, image_tag
377374
)
378375
COMMON_STAGE_IMAGES.append(common_stage_image_object)
379376

@@ -477,7 +474,7 @@ def process_images(pre_push_image_list, pre_push_image_type="Pre-push", buildspe
477474
return images_to_push
478475

479476

480-
def generate_common_stage_image_object(pre_push_stage_image_object, image_tag, cache_from_tag):
477+
def generate_common_stage_image_object(pre_push_stage_image_object, image_tag):
481478
"""
482479
Creates a common stage image object for a pre_push stage image. If for a pre_push stage image we create a common
483480
stage image, then we do not push the pre_push stage image to the repository. Instead, we just push its common stage
@@ -499,7 +496,6 @@ def generate_common_stage_image_object(pre_push_stage_image_object, image_tag, c
499496
tag=append_tag(image_tag, "multistage-common"),
500497
to_build=pre_push_stage_image_object.to_build,
501498
stage=constants.COMMON_STAGE,
502-
cache_from_tag=cache_from_tag,
503499
additional_tags=pre_push_stage_image_object.additional_tags,
504500
)
505501
pre_push_stage_image_object.to_push = False

0 commit comments

Comments
 (0)