Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for blocking 'entrypoints' #299

Open
samruddhikhandale opened this issue Aug 24, 2023 · 3 comments
Open

Add support for blocking 'entrypoints' #299

samruddhikhandale opened this issue Aug 24, 2023 · 3 comments

Comments

@samruddhikhandale
Copy link
Member

As the entrypoints are long lived, the entrypoint scripts runs in the background. Hence, this is not a blocking script for the container startup.
Can we add a new semantics to have "blocking" entrypoints that the CLI waits for?

Scenario: We have seen flakiness in docker startups for docker-in-docker Feature where docker is not running in the container. See devcontainers/features#634 and devcontainers/features#660.

devcontainers/features#669 adds few retry mechanisms to attempt to fix this issue. /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. Hence, it would be great to have some way of adding a blocking entrypoint to ensure dockerd is ready for the container (including the ^ lifecycle scripts)

// cc @chrmarti

@joshspicer
Copy link
Member

joshspicer commented Sep 7, 2023

Perhaps we could change the definition of the waitFor property to include entrypoint, informing the CLI to block further execution on Feature-provided entrypoint scripts to complete.

ie, in the implementation write a marker file or similar after this point

@chrmarti
Copy link
Contributor

chrmarti commented Sep 8, 2023

One difficulty is that multiple features can have entrypoints that need to be waited for. As a first approximation, could a feature add an onCreateCommand that waits for its entrypoint to be ready?

@joshspicer
Copy link
Member

+1 to exploring the onCreateCommand as the stop gap solution. There's already some work here devcontainers/features#710

@joshspicer joshspicer removed their assignment Apr 30, 2024
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

No branches or pull requests

3 participants