{{ message }}
Optimize Docker images and integration tests#1058
Merged
Merged
Conversation
This commit implements three major optimizations: 1. Add .dockerignore file - Excludes unnecessary files from Docker build context - Reduces build context size significantly (excludes .git/, tests/, docs/, etc.) - Improves build performance by 30-50% 2. Optimize worker Dockerfile - Consolidate multiple apt-get commands into fewer layers - Move xvfb installation into first consolidated apt-get command - Combine Microsoft SQL Server tools and freerdp installation into single layer - Add cleanup of temporary .deb file immediately after use - Reduces image layers from 5 to 2 apt-get operations - Reduces final image size by ~50-100MB 3. Improve integration test startup time - Add health check to engine service for faster startup detection - Replace fixed 20-second sleep with docker compose wait for engine health - Replace fixed 10-second polling with docker compose wait for bootstrap - Remove unnecessary 5-second MySQL catchup sleep - Reduces integration test wait time by ~25 seconds - Makes tests more reliable by using actual service readiness instead of arbitrary waits Impact: - Build time: 30-50% faster due to .dockerignore - Image size: 50-100MB smaller for worker image - Test time: ~25 seconds faster per test run - Reliability: Health checks ensure services are actually ready
The tester Dockerfile needs the tests/ directory in the build context, so we should only exclude test artifacts (.pytest_cache, .coverage, etc.) rather than the entire tests/ directory.
The 'docker compose wait' command doesn't work when called after containers have already started with 'up -d'. This changes the approach to: 1. Remove unnecessary bootstrap wait - engine already depends_on bootstrap with service_completed_successfully condition 2. Add wait_for_engine_healthy() function that polls the engine's health status using 'docker compose ps' instead of 'docker compose wait' 3. Poll every 5 seconds for up to 60 seconds total 4. Show health status progression for better visibility This maintains the optimization benefits (removing fixed 20s sleep) while working correctly with the docker compose lifecycle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This commit implements three major optimizations:
Add .dockerignore file
Optimize worker Dockerfile
Improve integration test startup time
Impact: