-
Notifications
You must be signed in to change notification settings - Fork 4.5k
tech spec: demo of common base image for all python connectors #29477
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
Conversation
I successfully built a connector on this branch: |
) | ||
|
||
|
||
class _0_0_2(_0_0_1): |
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.
I'm showcasing here how inheritance can help in patching a previous version with maximal code reuse.
Nothing in the pattern I implemented forces a new version to inherit from the previous one. In other words: the container
property can be re-implemented from scratch on a AirbytePythonBase subclass if we don't want to build on top of the previous version.
changelog = "Upgrades the base image to Python 3.10.12." | ||
|
||
|
||
def get_all_base_images() -> dict[str, Type[AirbytePythonBase]]: |
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.
This function is "just" sugar to automatically discover the image version declared in the module. It saves us from hardcoding the list of base images version: implementing a new class should be the only step to make a new base version available.
airbyte-ci/connectors/pipelines/pipelines/builds/base_images/python.py
Outdated
Show resolved
Hide resolved
return await self.finalize_build(self.context, connector_container) | ||
|
||
@staticmethod | ||
async def finalize_build(context: ConnectorContext, connector_container: Container) -> Container: |
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.
This code is currently used in the environment
module: https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/pipelines/actions/environments.py#L893
What
Suggest an approach at declaring a single, versioned, base image for all python connectors.
CF tech spec