Skip to content

Conversation

@idsulik
Copy link
Collaborator

@idsulik idsulik commented Oct 31, 2025

What I did
Trying to fix the CI test's issue introduced here #13325

@idsulik idsulik requested a review from a team as a code owner October 31, 2025 14:28
@idsulik idsulik requested review from glours and ndeloof October 31, 2025 14:28
@idsulik idsulik marked this pull request as draft October 31, 2025 14:28
@idsulik idsulik force-pushed the fix-e2e-compose-run-build-once branch 6 times, most recently from 7692d07 to 9cf46fa Compare October 31, 2025 16:55
@idsulik
Copy link
Collaborator Author

idsulik commented Oct 31, 2025

I think I found the reason

res.Stdout() outputs stdout and stderr, but even if the execution was successful, the stderr contains log with json output that duplicates the stdout output:

#1 [internal] load local bake definitions
#1 reading from stdin 620B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 119B done
#2 WARN: JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 3)
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/alpine:latest
#3 DONE 0.0s

#4 [internal] load .dockerignore
#4 transferring context: 2B done
#4 DONE 0.0s

#5 [1/2] FROM docker.io/library/alpine:latest@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412
#5 resolve docker.io/library/alpine:latest@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 done
#5 DONE 0.0s

#6 [2/2] RUN echo "Building nginx at $(date)" > /build-time.txt
#6 CACHED

#7 exporting to image
#7 exporting layers done
#7 exporting manifest sha256:5fe79d9dab5d13bd4132d664aa7d98a286b4105d3d5e599296d9f7cde0c1cb71 done
#7 exporting config sha256:4b6fd649699ae6c28bacc860a95ecd6aefec4b7b3e42133f9adbd78a9bac52de done
#7 exporting attestation manifest sha256:2e83ae3c0c8cdc5cf82a9ad5c42242a5cc3c37e41361b6a4857f57a6167114f9 done
#7 exporting manifest list sha256:9a07c3d81cf0d3bd401559762a785d1e86ec4ad356c2c51ecb5d1eba3f1d9bf1 done
#7 naming to docker.io/library/build-once-5b2eb891-nginx:latest done
#7 unpacking to docker.io/library/build-once-5b2eb891-nginx:latest done
#7 DONE 0.0s

#8 resolving provenance for metadata file
#8 DONE 0.0s
curl service
 Image build-once-5b2eb891-nginx  Building
time="2025-10-31T18:57:14+02:00" level=debug msg="bake build config:\n{\n  \"group\": {\n    \"default\": {\n      \"targets\": [\n        \"nginx\"\n      ]\n    }\n  },\n  \"target\": {\n    \"nginx\": {\n      \"context\": \"/Users/main/Development/idsulik/compose/pkg/e2e/fixtures/run-test\",\n      \"dockerfile-inline\": \"FROM alpine\\nRUN echo \\\"Building nginx at $(date)\\\" \\u003e /build-time.txt\\nCMD sleep 3600\\n\",\n      \"labels\": {\n        \"com.docker.compose.project\": \"build-once-5b2eb891\",\n        \"com.docker.compose.service\": \"nginx\",\n        \"com.docker.compose.version\": \"\"\n      },\n      \"tags\": [\n        \"build-once-5b2eb891-nginx\"\n      ],\n      \"output\": [\n        \"type=docker\"\n      ]\n    }\n  }\n}"
time="2025-10-31T18:57:14+02:00" level=debug msg="Executing bake with args: [bake --file - --progress rawjson --metadata-file /tmp/compose-build-metadataFile-7111fbbd-35e7-4bcb-ac17-3fccf3717898.json --allow fs.read=/Users/main/Development/idsulik/compose/pkg/e2e/fixtures/run-test]"
 Image build-once-5b2eb891-nginx  Built
 Network build-once-5b2eb891_default  Creating
 Network build-once-5b2eb891_default  Created
 Container build-once-5b2eb891-nginx-1  Creating
 Container build-once-5b2eb891-nginx-1  Created
 Container build-once-5b2eb891-nginx-1  Starting
 Container build-once-5b2eb891-nginx-1  Started
 Container build-once-5b2eb891-curl-run-e676e6ee8464  Creating
 Container build-once-5b2eb891-curl-run-e676e6ee8464  Created
time="2025-10-31T18:57:15+02:00" level=debug msg="[hijack] End of stdin"
time="2025-10-31T18:57:15+02:00" level=debug msg="[hijack] End of stdout"

but if we use only res.Stdout() it doesn't contain the duplication:

#1 [internal] load local bake definitions
#1 reading from stdin 620B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 119B done
#2 WARN: JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 3)
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/alpine:latest
#3 DONE 0.0s

#4 [internal] load .dockerignore
#4 transferring context: 2B done
#4 DONE 0.0s

#5 [1/2] FROM docker.io/library/alpine:latest@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412
#5 resolve docker.io/library/alpine:latest@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 done
#5 DONE 0.0s

#6 [2/2] RUN echo "Building nginx at $(date)" > /build-time.txt
#6 CACHED

#7 exporting to image
#7 exporting layers done
#7 exporting manifest sha256:5fe79d9dab5d13bd4132d664aa7d98a286b4105d3d5e599296d9f7cde0c1cb71 done
#7 exporting config sha256:4b6fd649699ae6c28bacc860a95ecd6aefec4b7b3e42133f9adbd78a9bac52de done
#7 exporting attestation manifest sha256:2e83ae3c0c8cdc5cf82a9ad5c42242a5cc3c37e41361b6a4857f57a6167114f9 done
#7 exporting manifest list sha256:9a07c3d81cf0d3bd401559762a785d1e86ec4ad356c2c51ecb5d1eba3f1d9bf1 done
#7 naming to docker.io/library/build-once-5b2eb891-nginx:latest done
#7 unpacking to docker.io/library/build-once-5b2eb891-nginx:latest done
#7 DONE 0.0s

#8 resolving provenance for metadata file
#8 DONE 0.0s
curl service

@idsulik idsulik force-pushed the fix-e2e-compose-run-build-once branch 3 times, most recently from 108129a to 5be18ee Compare October 31, 2025 18:10
@idsulik idsulik marked this pull request as ready for review October 31, 2025 18:12
@idsulik
Copy link
Collaborator Author

idsulik commented Oct 31, 2025

Yes, it works now, tested 5 times.

p.s. the failed test is TestComposePull and the reason is the rate limit You have reached your unauthenticated pull rate limit. https://www.docker.com/increase-rate-limit

@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@idsulik
Copy link
Collaborator Author

idsulik commented Nov 3, 2025

It failed, investigating..

@idsulik idsulik force-pushed the fix-e2e-compose-run-build-once branch 10 times, most recently from bea9442 to 53f9adb Compare November 3, 2025 15:46
@idsulik idsulik force-pushed the fix-e2e-compose-run-build-once branch from 53f9adb to ec92478 Compare November 3, 2025 16:22
@idsulik
Copy link
Collaborator Author

idsulik commented Nov 3, 2025

7-8 successful executions, looks like it's safe now

@idsulik idsulik force-pushed the fix-e2e-compose-run-build-once branch 2 times, most recently from c72ca38 to dad6b9b Compare November 3, 2025 17:19
Signed-off-by: Suleiman Dibirov <[email protected]>
@idsulik idsulik force-pushed the fix-e2e-compose-run-build-once branch from dad6b9b to 3ce4d88 Compare November 3, 2025 17:41
@ndeloof ndeloof merged commit 67e39a4 into docker:main Nov 6, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants