@@ -10,15 +10,6 @@ docker_image_exists() {
1010 docker image inspect " ${image_name} " > /dev/null 2>&1
1111}
1212
13- # Calculate the name of a Docker image from the test type, section, and id
14- get_image_name () {
15- local test_type=${TEST_TYPE:- }
16- local section=" $1 "
17- local id=" $2 "
18-
19- echo " ${test_type} -${section} -${id} "
20- }
21-
2213# Helper function to build images from a YAML section (implementations or baselines)
2314build_images_from_section () {
2415 local section=" $1 " # "implementations", "baselines", "routers", etc
@@ -37,7 +28,7 @@ build_images_from_section() {
3728 IFS=' |' read -ra FILTER_PATTERNS <<< " ${filter}"
3829 for pattern in " ${FILTER_PATTERNS[@]} " ; do
3930 case " ${impl_id} " in
40- * " ${pattern} " * )
31+ " ${pattern} " )
4132 match_found=true
4233 break
4334 ;;
@@ -48,7 +39,7 @@ build_images_from_section() {
4839 fi
4940 fi
5041
51- local image_name=$( get_image_name " ${section} " " ${impl_id} " )
42+ local image_name=$( get_image_name " ${TEST_TYPE} " " ${ section}" " ${impl_id} " )
5243
5344 # Check if image already exists (for local builds only)
5445 if [ " ${force_image_rebuild} " != " true" ] && docker_image_exists " ${image_name} " ; then
@@ -57,12 +48,10 @@ build_images_from_section() {
5748 fi
5849
5950 # Create YAML file for this build
60- local yaml_file=" ${CACHE_DIR} /build-yamls/docker-build-perf -${impl_id} .yaml"
51+ local yaml_file=" ${CACHE_DIR} /build-yamls/docker-build-${TEST_TYPE} -${impl_id} .yaml"
6152
6253 cat > " ${yaml_file} " << EOF
6354imageName: ${image_name}
64- imageType: peer
65- imagePrefix: "${TEST_TYPE} "
6655sourceType: ${source_type}
6756cacheDir: ${CACHE_DIR}
6857forceRebuild: ${force_image_rebuild}
@@ -116,11 +105,12 @@ EOF
116105 local build_context=$( dirname " ${dockerfile} " )
117106 local patch_path=$( yq eval " .${section} [$i ].source.patchPath // \"\" " " ${IMAGES_YAML} " )
118107 local patch_file=$( yq eval " .${section} [$i ].source.patchFile // \"\" " " ${IMAGES_YAML} " )
108+ local base_image_name=$( get_image_name " ${TEST_TYPE} " " ${section} " " ${base_image} " )
119109
120110 cat >> " ${yaml_file} " << EOF
121111
122112browser:
123- baseImage: ${base_image }
113+ baseImage: ${base_image_name }
124114 browser: ${browser}
125115 dockerfile: ${dockerfile}
126116 buildContext: ${build_context}
@@ -516,25 +506,22 @@ build_browser_image() {
516506 local browser=$( yq eval ' .browser.browser' " ${yaml_file} " )
517507 local dockerfile=$( yq eval ' .browser.dockerfile' " ${yaml_file} " )
518508 local build_context=$( yq eval ' .browser.buildContext' " ${yaml_file} " )
519- local image_prefix=$( yq eval ' .imagePrefix' " ${yaml_file} " )
520509 local patch_path=$( yq eval ' .browser.patchPath // ""' " ${yaml_file} " )
521510 local patch_file=$( yq eval ' .browser.patchFile // ""' " ${yaml_file} " )
522511
523- local base_image_name=" ${image_prefix} -${base_image} "
524-
525- print_message " Base: ${base_image} (${base_image_name} )"
512+ print_message " Base: ${base_image} "
526513 print_message " Browser: ${browser} "
527514
528515 # Ensure base image exists
529- if ! docker image inspect " ${base_image_name } " & > /dev/null; then
530- print_error " Base image not found: ${base_image_name } "
516+ if ! docker image inspect " ${base_image } " & > /dev/null; then
517+ print_error " Base image not found: ${base_image } "
531518 print_message " Please build ${base_image} first"
532519 return 1
533520 fi
534521
535522 # Tag base image for browser build
536- print_message " Tagging base image..."
537- docker tag " ${base_image_name} " " node-${base_image} "
523+ # print_message "Tagging base image..."
524+ # docker tag "${base_image_name}" "node-${base_image}"
538525
539526 # If patch specified, create temporary copy of build context
540527 local actual_build_context=" ${build_context} "
@@ -565,7 +552,7 @@ build_browser_image() {
565552 # Build browser image
566553 print_message " Building browser Docker image..."
567554 # Run docker directly (no eval/pipe) for clean output to preserve aesthetic
568- if ! docker build -f " ${actual_dockerfile} " --build-arg BASE_IMAGE=" node- ${base_image} " --build-arg BROWSER=" ${browser} " -t " ${image_name} " " ${actual_build_context} " ; then
555+ if ! docker build -f " ${actual_dockerfile} " --build-arg BASE_IMAGE=" ${base_image} " --build-arg BROWSER=" ${browser} " -t " ${image_name} " " ${actual_build_context} " ; then
569556 print_error " Docker build failed"
570557 if [ " ${cleanup_temp} " == " true" ]; then
571558 rm -rf " ${actual_build_context} "
0 commit comments