From 024cf2604fceaae019bc832c51b1fc2cb6433181 Mon Sep 17 00:00:00 2001 From: Christo Grabowski <108154848+ChristoGrab@users.noreply.github.com> Date: Mon, 2 Dec 2024 11:34:31 -0800 Subject: [PATCH] fix: ensure SDM image maintains airbyte-ci compatibility (#90) --- Dockerfile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 79d2880d0..3b0f34a19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,12 +10,19 @@ COPY dist/*.whl ./dist/ RUN poetry config virtualenvs.create false \ && poetry install --only main --no-interaction --no-ansi || true -# Copy source code -COPY airbyte_cdk ./airbyte_cdk - # Build and install the package RUN pip install dist/*.whl +# Recreate the original structure +RUN mkdir -p source_declarative_manifest \ + && echo 'from source_declarative_manifest.run import run\n\nif __name__ == "__main__":\n run()' > main.py \ + && touch source_declarative_manifest/__init__.py \ + && cp /usr/local/lib/python3.10/site-packages/airbyte_cdk/cli/source_declarative_manifest/_run.py source_declarative_manifest/run.py \ + && cp /usr/local/lib/python3.10/site-packages/airbyte_cdk/cli/source_declarative_manifest/spec.json source_declarative_manifest/ + +# Remove unnecessary build files +RUN rm -rf dist/ pyproject.toml poetry.lock README.md + # Set the entrypoint -ENV AIRBYTE_ENTRYPOINT="source-declarative-manifest" -ENTRYPOINT ["source-declarative-manifest"] +ENV AIRBYTE_ENTRYPOINT="python /airbyte/integration_code/main.py" +ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]