-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Refactor image build operations to use Dockerfile-based builds instead of Dagger #63378
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
base: master
Are you sure you want to change the base?
Refactor image build operations to use Dockerfile-based builds instead of Dagger #63378
Conversation
…d of Dagger - Replace all custom Dagger code with Docker CLI subprocess calls - Update base image classes to build using Dockerfiles from docker-images directory - Refactor Python, Java, and manifest-only connector build steps - Remove build_customization.py support as requested - Maintain existing function signatures for compatibility - Simplify build process while preserving functionality Changes: - airbyte-ci/connectors/base_images/base_images/bases.py: Remove Dagger dependencies, update signatures - airbyte-ci/connectors/base_images/base_images/python/bases.py: Use Docker build for Python base images - airbyte-ci/connectors/base_images/base_images/java/bases.py: Use Docker build for Java base images - airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/build_image/steps/common.py: Replace Dagger with subprocess calls - airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/build_image/steps/python_connectors.py: Use Dockerfile.python-connector - airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/build_image/steps/java_connectors.py: Use Dockerfile.java-connector - airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/build_image/steps/manifest_only_connectors.py: Use Dockerfile.manifest-only-connector - Remove build_customization.py entirely Co-Authored-By: AJ Steers <aj@airbyte.io>
Original prompt from AJ Steers:
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Helpful Resources
PR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
|
We install some packages required to build java connectors. | ||
We also download the datadog java agent jar and the javabase.sh script. | ||
We set some env variables used by the javabase.sh script. | ||
def get_container(self, platform: str) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to still return a dagger.Container instance for maintaining previous type contracts? Aka, can we wrap our built image in the Dagger class?
…() method - Restore dagger.Platform parameter types and dagger.Container return types - Use client.container().build() pattern for Dockerfile builds instead of subprocess - Maintain original function signatures for backward compatibility - Fix type annotations using TYPE_CHECKING pattern for better compatibility - Update base image classes to use Dagger's native Dockerfile building Co-Authored-By: AJ Steers <aj@airbyte.io>
- Remove explicit dagger.Platform type annotations that were causing import errors - Maintain backward compatibility with original function signatures - Use Dagger's native build() method for Dockerfile-based builds - All methods now accept platform objects and return Container objects as expected Co-Authored-By: AJ Steers <aj@airbyte.io>
…nnotations - Remove unused subprocess, dagger, and pathlib.Path imports from build step files - Add missing /usr/share/nltk_data directory with NLTK data to Python Dockerfile - Add proper type annotations for dagger.Platform and dagger.Container - Fix async/await issue in with_python_connector_installed call - Ensures format check, test failures, and type check issues are resolved Co-Authored-By: AJ Steers <aj@airbyte.io>
- Add missing self type annotations to normalization.py methods - Fix import formatting in base_images/__init__.py - All ruff checks now pass for build step files - Resolves remaining linting errors from CI Co-Authored-By: AJ Steers <aj@airbyte.io>
…seImage - Add missing get_container() and run_sanity_checks() methods - Resolves mypy error about concrete class requirements - Maintains consistency with base class contract Co-Authored-By: AJ Steers <aj@airbyte.io>
- Change PIP_CACHE_DIR from /pip_cache to /custom_cache/pip - Aligns with expected test behavior and base image class expectations - Part of Dockerfile-based build refactoring Co-Authored-By: AJ Steers <aj@airbyte.io>
- Mount pip cache volume to /custom_cache/pip in get_container method - Fixes test_pip_cache_volume test by ensuring cache volume is properly mounted - Maintains backward compatibility with existing pip cache behavior Co-Authored-By: AJ Steers <aj@airbyte.io>
Refactor image build operations to use Dockerfile-based builds while maintaining backward compatibility
Summary
This PR refactors the image build operations in
airbyte-ci/connectors/base_images
andairbyte-ci/connectors/pipelines
to use Dockerfile-based builds instead of custom Dagger code, while preserving all original function signatures and type contracts.Key Changes:
AirbytePythonConnectorBaseImage
andAirbyteJavaConnectorBaseImage
to usedagger_client.container().build()
with Dockerfiles from thedocker-images/
directorydagger.Container
return types while using Dockerfile-based builds internallydagger_client
parameter to base class constructors and preserved all original method signaturesImplementation Approach:
Instead of completely removing Dagger, this uses Dagger's native
container().build(context=workspace, dockerfile="Dockerfile")
method to build from Dockerfiles while wrapping results indagger.Container
objects to maintain API compatibility.Review & Testing Checklist for Human
docker-images/Dockerfile.python-connector-base
anddocker-images/Dockerfile.java-connector-base
exist and are properly structuredRecommended Test Plan:
airbyte-ci connectors build
on a sample Python connector (e.g., source-faker)airbyte-ci connectors build
on a sample Java connectorDiagram
Notes
dagger.Platform
type annotations due to import errors, which may indicate Dagger SDK compatibility issues worth investigatingdocker-images/
are correctly structured and maintained