@@ -46,36 +46,6 @@ def load_release_file() -> Dict:
46
46
return json .load (release )
47
47
48
48
49
- @TRACER .start_as_current_span ("pipeline_process_image" )
50
- def pipeline_process_image (
51
- image_name : str ,
52
- dockerfile_path : str ,
53
- build_configuration : BuildConfiguration ,
54
- dockerfile_args : Dict [str , str ] = None ,
55
- build_path : str = "." ,
56
- ):
57
- """Builds a Docker image with arguments defined in `args`."""
58
- span = trace .get_current_span ()
59
- span .set_attribute ("mck.image_name" , image_name )
60
- if dockerfile_args :
61
- span .set_attribute ("mck.build_args" , str (dockerfile_args ))
62
-
63
- logger .info (f"Dockerfile args: { dockerfile_args } , for image: { image_name } " )
64
-
65
- if not dockerfile_args :
66
- dockerfile_args = {}
67
- logger .debug (f"Build args: { dockerfile_args } " )
68
- process_image (
69
- image_name ,
70
- image_tag = build_configuration .version ,
71
- dockerfile_path = dockerfile_path ,
72
- dockerfile_args = dockerfile_args ,
73
- base_registry = build_configuration .base_registry ,
74
- platforms = build_configuration .platforms ,
75
- sign = build_configuration .sign ,
76
- build_path = build_path ,
77
- )
78
-
79
49
80
50
def build_tests_image (build_configuration : BuildConfiguration ):
81
51
"""
@@ -246,6 +216,7 @@ def build_om_image(build_configuration: BuildConfiguration):
246
216
)
247
217
248
218
219
+ @TRACER .start_as_current_span ("build_image_generic" )
249
220
def build_image_generic (
250
221
image_name : str ,
251
222
dockerfile_path : str ,
@@ -256,22 +227,33 @@ def build_image_generic(
256
227
"""
257
228
Build an image then (optionally) sign the result.
258
229
"""
230
+ # Tracing setup
231
+ span = trace .get_current_span ()
232
+ span .set_attribute ("mck.image_name" , image_name )
259
233
260
234
registry = build_configuration .base_registry
261
235
args_list = extra_args or {}
262
236
version = args_list .get ("version" , "" )
263
237
264
- # merge in the registry without mutating caller’ s dict
238
+ # merge in the registry without mutating caller' s dict
265
239
build_args = {** args_list , "quay_registry" : registry }
240
+
241
+ if build_args :
242
+ span .set_attribute ("mck.build_args" , str (build_args ))
243
+
244
+ logger .info (f"Building { image_name } , dockerfile args: { build_args } " )
266
245
logger .debug (f"Build args: { build_args } " )
267
-
268
246
logger .debug (f"Building { image_name } for platforms={ build_configuration .platforms } " )
269
247
logger .debug (f"build image generic - registry={ registry } " )
270
- pipeline_process_image (
271
- image_name = image_name ,
248
+
249
+ process_image (
250
+ image_name ,
251
+ image_tag = build_configuration .version ,
272
252
dockerfile_path = dockerfile_path ,
273
- build_configuration = build_configuration ,
274
253
dockerfile_args = build_args ,
254
+ base_registry = build_configuration .base_registry ,
255
+ platforms = build_configuration .platforms ,
256
+ sign = build_configuration .sign ,
275
257
build_path = build_path ,
276
258
)
277
259
0 commit comments