Skip to content

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Dec 14, 2023

build --squash is an experimental feature that is not implemented in the containerd image store.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

build --squash is an experimental feature that is not implemented in the
containerd image store.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added status/2-code-review area/testing containerd-integration Issues and PRs related to containerd integration labels Dec 14, 2023
@vvoland vvoland added this to the 25.0.0 milestone Dec 14, 2023
@vvoland vvoland self-assigned this Dec 14, 2023
@vvoland vvoland requested a review from tianon as a code owner December 14, 2023 08:29
@@ -14,6 +14,11 @@ source hack/make/.integration-test-helpers
# TODO re-enable test_attach_no_stream after https://github.com/docker/docker-py/issues/2513 is resolved
# TODO re-enable test_run_container_reading_socket_ws. It's reported in https://github.com/docker/docker-py/issues/1478, and we're getting that error in our tests.
: "${PY_TEST_OPTIONS:=--junitxml=${DEST}/junit-report.xml --deselect=tests/integration/api_container_test.py::AttachContainerTest::test_attach_no_stream --deselect=tests/integration/api_container_test.py::AttachContainerTest::test_run_container_reading_socket_ws}"

# build --squash is not supported with containerd integration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there will be more exceptions, it may be good to have the comment include the actual test that was excluded (see comments at line 14, 15); it makes it easier to find back "which one" we're describing. (and where suitable, with a tracking ticket)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case we need more skips we can just add each --deselect as a separate line:

PY_TEST_OPTIONS="$PY_TEST_OPTIONS \
--deselect=tests/integration/api_build_test.py::BuildTest::test_build_squash \
--deselect=tests/integration/api_build_test.py::BuildTest::test_XYZ \
--deselect=tests/integration/api_build_test.py::BuildTest::test_ABC"

I think the comment would only duplicate information that's already readable and explicit enough.
Let me know if you think otherwise, I'll add the comment.

@thaJeztah
Copy link
Member

This PR recalled me we need to bring up "squash" again with the Build team, as it's supported by BuildKit, but partially broken (not sure if it can be supported with the containerd integration, but we should have clear if this skip will be "permanent" or "temporary" (TODO))

@vvoland
Copy link
Contributor Author

vvoland commented Dec 14, 2023

IIUC, Buildkit deprecated the squash option: docker/buildx#810.
buildx will also warn you when you pass --squash:

$ printf 'FROM alpine\nRUN echo 1>/1\nRUN echo 2>/2' | DOCKER_BUILDKIT=1 docker build --squash -t asdf -q -                                                                                   
WARNING: experimental flag squash is removed with BuildKit. You should squash inside build using a multi-stage Dockerfile for efficiency.
sha256:a30f2ad43fab99673ba8284c49375cc8f4917aa94689883f533d7e1146fb8d10

And the produced image will not be squashed:

$ docker inspect asdf --format '{{.RootFS}}'                                                                                                                                                                      
{layers [sha256:0faf9b67be60a76d473c955d4de2849da5e99e07fcefb753219631e1e7b608fb sha256:9d7b2619df6adc9b65977b549e25a21b784b795cd0880f2136a20b0561608707 sha256:d67a497fb42fd902dc0c2800bf4a19b061bdc6ec6dede093e2b712f054a6329c]}

$ docker inspect alpine --format '{{.RootFS}}'                                                                                                                                                                   
{layers [sha256:0faf9b67be60a76d473c955d4de2849da5e99e07fcefb753219631e1e7b608fb]}

not sure if it can be supported with the containerd integration

We could implement it for legacy builder, but considering that Buildkit renounced it... maybe we shouldn't.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's get this one in

LGTM

@thaJeztah thaJeztah merged commit d90e5f2 into moby:master Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing containerd-integration Issues and PRs related to containerd integration status/2-code-review
Projects
Development

Successfully merging this pull request may close these issues.

3 participants