Skip to content

Commit c6fc163

Browse files
committed
Cleanup ensure
1 parent d2a6153 commit c6fc163

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

scripts/release/build_images.py

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

58
import boto3
@@ -123,7 +126,10 @@ def execute_docker_build(
123126
if len(platforms) > 1:
124127
logger.info(f"Multi-platform build for {len(platforms)} architectures")
125128

126-
# Build the image using buildx, builder must be already initialized
129+
# Ensure buildx builder exists (safe for concurrent execution)
130+
ensure_buildx_builder(builder_name)
131+
132+
# Build the image using buildx
127133
docker.buildx.build(
128134
context_path=path,
129135
file=dockerfile,

scripts/release/pipeline_main.py

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

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

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)
153148
build_image(args.image, build_config)
154149

155150

0 commit comments

Comments
 (0)