From fcecb62e5ba79841396e625693a35a68a8f50fb5 Mon Sep 17 00:00:00 2001 From: alafanechere Date: Wed, 11 Oct 2023 15:31:31 +0200 Subject: [PATCH] remove dockerfile for source-zendesk-chat and implement build_customization.py --- .../connectors/source-zendesk-chat/Dockerfile | 20 ---------------- .../build_customization.py | 23 +++++++++++++++++++ .../source-zendesk-chat/metadata.yaml | 4 +++- docs/integrations/sources/zendesk-chat.md | 1 + 4 files changed, 27 insertions(+), 21 deletions(-) delete mode 100644 airbyte-integrations/connectors/source-zendesk-chat/Dockerfile create mode 100644 airbyte-integrations/connectors/source-zendesk-chat/build_customization.py diff --git a/airbyte-integrations/connectors/source-zendesk-chat/Dockerfile b/airbyte-integrations/connectors/source-zendesk-chat/Dockerfile deleted file mode 100644 index c7764ec2d2e5..000000000000 --- a/airbyte-integrations/connectors/source-zendesk-chat/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM python:3.9-slim - -# Bash is installed for more convenient debugging. -RUN apt-get update && apt-get install -y bash && rm -rf /var/lib/apt/lists/* - -ENV CODE_PATH="source_zendesk_chat" -ENV AIRBYTE_IMPL_MODULE="source_zendesk_chat" -ENV AIRBYTE_IMPL_PATH="SourceZendeskChat" -ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main_dev.py" - -WORKDIR /airbyte/integration_code -COPY $CODE_PATH ./$CODE_PATH -COPY main_dev.py ./ -COPY setup.py ./ -RUN pip install . - -ENTRYPOINT ["python", "/airbyte/integration_code/main_dev.py"] - -LABEL io.airbyte.version=0.1.14 -LABEL io.airbyte.name=airbyte/source-zendesk-chat diff --git a/airbyte-integrations/connectors/source-zendesk-chat/build_customization.py b/airbyte-integrations/connectors/source-zendesk-chat/build_customization.py new file mode 100644 index 000000000000..b974ca15ee59 --- /dev/null +++ b/airbyte-integrations/connectors/source-zendesk-chat/build_customization.py @@ -0,0 +1,23 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from dagger import Container + +MAIN_FILE_NAME = "main_dev.py" + + +async def pre_connector_install(base_image_container: Container) -> Container: + """This function will run before the connector installation. + We set these environment variable to match what was originally in the Dockerfile. + Disclaimer: I have no idea if these env vars are actually needed. + """ + return await ( + base_image_container.with_env_variable("AIRBYTE_IMPL_MODULE", "source_zendesk_chat").with_env_variable( + "AIRBYTE_IMPL_PATH", "SourceZendeskChat" + ) + ) diff --git a/airbyte-integrations/connectors/source-zendesk-chat/metadata.yaml b/airbyte-integrations/connectors/source-zendesk-chat/metadata.yaml index 5d9c006e0853..18185bf76a27 100644 --- a/airbyte-integrations/connectors/source-zendesk-chat/metadata.yaml +++ b/airbyte-integrations/connectors/source-zendesk-chat/metadata.yaml @@ -2,10 +2,12 @@ data: allowedHosts: hosts: - zopim.com + connectorBuildOptions: + baseImage: airbyte/python-connector-base:1.0.0 connectorSubtype: api connectorType: source definitionId: 40d24d0f-b8f9-4fe0-9e6c-b06c0f3f45e4 - dockerImageTag: 0.1.14 + dockerImageTag: 0.2.0 dockerRepository: airbyte/source-zendesk-chat githubIssueLabel: source-zendesk-chat icon: zendesk-chat.svg diff --git a/docs/integrations/sources/zendesk-chat.md b/docs/integrations/sources/zendesk-chat.md index eab821953fd8..31cfcba59e2c 100644 --- a/docs/integrations/sources/zendesk-chat.md +++ b/docs/integrations/sources/zendesk-chat.md @@ -80,6 +80,7 @@ The connector is restricted by Zendesk's [requests limitation](https://developer | Version | Date | Pull Request | Subject | | :------ | :--------- | :------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------- | +| 0.2.0 | 2023-10-11 | [30526](https://github.com/airbytehq/airbyte/pull/30526) | Use the python connector base image, remove dockerfile and implement build_customization.py | | 0.1.14 | 2023-02-10 | [24190](https://github.com/airbytehq/airbyte/pull/24190) | Fix remove too high min/max from account stream | | 0.1.13 | 2023-02-10 | [22819](https://github.com/airbytehq/airbyte/pull/22819) | Specified date formatting in specification | | 0.1.12 | 2023-01-27 | [22026](https://github.com/airbytehq/airbyte/pull/22026) | Set `AvailabilityStrategy` for streams explicitly to `None` |