Skip to content

Commit e2a4126

Browse files
committed
Revert "Cleanup ensure"
This reverts commit c6fc163.
1 parent 347b44b commit e2a4126

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

scripts/release/build_images.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# This file is the new Sonar
22
import base64
3-
import fcntl
4-
import os
5-
import time
63
from typing import Dict
74

85
import boto3
@@ -118,10 +115,7 @@ def execute_docker_build(
118115
if len(platforms) > 1:
119116
logger.info(f"Multi-platform build for {len(platforms)} architectures")
120117

121-
# Ensure buildx builder exists (safe for concurrent execution)
122-
ensure_buildx_builder(builder_name)
123-
124-
# Build the image using buildx
118+
# Build the image using buildx, builder must be already initialized
125119
docker.buildx.build(
126120
context_path=path,
127121
file=dockerfile,

scripts/release/pipeline_main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
BuildContext,
3535
BuildScenario,
3636
)
37+
from scripts.release.build_images import DEFAULT_BUILDER_NAME, ensure_buildx_builder
3738

3839
"""
3940
The goal of main.py, build_configuration.py and build_context.py is to provide a single source of truth for the build
@@ -145,6 +146,10 @@ def main():
145146
logger.info(f"Building image: {args.image}")
146147
logger.info(f"Build configuration: {build_config}")
147148

149+
# Create buildx builder
150+
# It must be initialized here as opposed to in build_images.py so that parallel calls (such as agent builds) can access it
151+
# and not face race conditions
152+
ensure_buildx_builder(DEFAULT_BUILDER_NAME)
148153
build_image(args.image, build_config)
149154

150155

0 commit comments

Comments
 (0)