From 03bcdc3d0d2188b72b8757cfe269b273f9d88445 Mon Sep 17 00:00:00 2001 From: ChristoGrab Date: Tue, 26 Nov 2024 12:36:46 -0800 Subject: [PATCH 1/2] Recreate original sdm image structure --- Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 79d2880d0..9a390ac54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,12 +10,14 @@ 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 echo 'from airbyte_cdk.cli.source_declarative_manifest._run import run\n\nif __name__ == "__main__":\n run()' > main.py \ + && mkdir -p source_declarative_manifest \ + && cp /usr/local/lib/python3.10/site-packages/airbyte_cdk/cli/source_declarative_manifest/spec.json source_declarative_manifest/ + # 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"] From 9c78c090dfe056e9c99cc6697377cc7503b622ba Mon Sep 17 00:00:00 2001 From: ChristoGrab Date: Tue, 26 Nov 2024 14:41:40 -0800 Subject: [PATCH 2/2] modify files to resemble previous structure --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9a390ac54..3b0f34a19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,10 +14,15 @@ RUN poetry config virtualenvs.create false \ RUN pip install dist/*.whl # Recreate the original structure -RUN echo 'from airbyte_cdk.cli.source_declarative_manifest._run import run\n\nif __name__ == "__main__":\n run()' > main.py \ - && mkdir -p source_declarative_manifest \ +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="python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]