Skip to content

[docker in docker] Adds retries for docker daemon startup and cgroup nesting#669

Merged
samruddhikhandale merged 7 commits intomainfrom
samruddhikhandale/docker-in-docker
Aug 24, 2023
Merged

[docker in docker] Adds retries for docker daemon startup and cgroup nesting#669
samruddhikhandale merged 7 commits intomainfrom
samruddhikhandale/docker-in-docker

Conversation

@samruddhikhandale
Copy link
Copy Markdown
Member

@samruddhikhandale samruddhikhandale commented Aug 24, 2023

Ref: #634 and #660

Updates in this PR -

  • 19c9892 adds retries for docker daemon startup
  • We have seen errors like sed: couldn't flush stdout: Device or resource errors which fails to start docker.25d2e80 adds retries to fix such sed errors
  • 4b2c9fc adds a workflow which runs 100 jobs for validating docker startup --> 50 jobs validates dockerd after the container is started, and 50 jobs validates within the onCreateCommand

Important Note: /usr/local/share/docker-init.sh which starts/retries dockerd is added to the entrypoint command. This command runs in the background and is not a blocking script for the container startup. Since it's in the background, onCreateCommand/postCreateCommand/postStartCommand could all start executing before docker is fully running. If it takes docker too long, that could introduce flakiness in those lifecycle scripts.

Opened devcontainers/spec#299 which requests a new semantics to have "blocking" entrypoints that the CLI waits for. This way we can ensure that docker is already up and running for the mentioned ^ lifecycle scripts and is available in the container.

@samruddhikhandale samruddhikhandale changed the title Samruddhikhandale/docker in docker [docker in docker] Adds retries for docker daemon startup and cgroup nesting Aug 24, 2023
@samruddhikhandale
Copy link
Copy Markdown
Member Author

Note: The failing test will be fixed with #661

@samruddhikhandale samruddhikhandale marked this pull request as ready for review August 24, 2023 18:40
@samruddhikhandale samruddhikhandale requested a review from a team as a code owner August 24, 2023 18:40
Copy link
Copy Markdown
Member

@joshspicer joshspicer left a comment

Choose a reason for hiding this comment

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

nice! This looks really reasonable and the 50 passing tests doesn't hurt 😉

@samruddhikhandale
Copy link
Copy Markdown
Member Author

samruddhikhandale commented Aug 24, 2023

nice! This looks really reasonable and the 50 passing tests doesn't hurt 😉

@joshspicer **100 😛
See https://github.com/devcontainers/features/actions/runs/5967344918/job/16188845503?pr=669

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.

2 participants