<@U04S8PLJWMT> Which ways do I have to build custo...
# ask-ai
c
@kapa.ai Which ways do I have to build custom destination-databricks connector on top of the existing one? Can I use python?
k
To build a custom destination connector for Databricks on top of the existing one, you have several options in Airbyte, but there are important limitations to note: 1. Connector Builder & Low-Code CDK: The Connector Builder and Low-Code CDK are primarily designed for building source connectors for HTTP APIs. They do not support building destination connectors, including for Databricks. This is explicitly stated in the documentation: "Building destination connectors isn't supported in the Connector Builder" and "Building destination connectors isn't supported in the low-code CDK" [Connector development options (Next)](https://docs.airbyte.com/platform/next/connector-development#connector-development-options). 2. Python CDK: For maximum flexibility and to build or extend destination connectors (such as Databricks), you should use the Python Connector Development Kit (CDK). The Python CDK allows you to write custom logic in Python and is suitable for both source and destination connectors. This is the recommended approach if you want to customize or extend the existing Databricks destination connector using Python [Connector development options (Next)](https://docs.airbyte.com/platform/next/connector-development#connector-development-options). 3. Java CDK: If the existing Databricks connector is implemented in Java (as many database connectors are), you may also consider using the Java CDK. However, if you prefer Python, the Python CDK is fully supported for custom destination connectors. Summary: - You cannot use the Connector Builder or Low-Code CDK to build or extend a destination-databricks connector. - You can use Python to build or extend a custom destination-databricks connector by leveraging the Python CDK. For more details and guides on using the Python CDK for custom connectors, refer to the [Python CDK documentation](https://docs.airbyte.com/platform/next/connector-development/cdk-python/basic-concepts) and the [custom connector tutorial](https://docs.airbyte.com/platform/next/connector-development/tutorials/custom-python-connector/getting-started) [Connector development options (Next)](https://docs.airbyte.com/platform/next/connector-development#connector-development-options).
c
@kapa.ai Can u give me short instructions which commands I have to execute to buld the image with python
k
A message from kapa.ai
To build a custom Airbyte connector image with Python, follow these steps: 1. Build the Docker image using airbyte-ci (preferred method): - Make sure you have the
airbyte-ci
tool installed. - From your Airbyte repo root, run:
Copy code
airbyte-ci connectors --name destination-databricks build
- This will build your connector image and tag it as
airbyte/destination-databricks:dev
in your local Docker host. 2. Alternatively, build the Docker image with a Dockerfile: - Navigate to your connector directory and run:
Copy code
docker build . -t airbyte/destination-databricks:dev
- This will build the image using your local Dockerfile. You can verify the image was built with:
Copy code
docker images | grep airbyte/destination-databricks:dev
These steps are based on the official Airbyte documentation for building connector images with Python and Docker [Setting up standard acceptance tests for your connector](https://docs.airbyte.com/platform/connector-development/testing-connectors/connector-acceptance-tests-reference#setting-up-standard-acceptance-tests-for-your-connector).
c
@kapa.ai what must be the content of the dockerfile?
k
A message from kapa.ai
For Airbyte Python connectors, the preferred and required approach (especially for certified connectors) is not to use a Dockerfile. Instead, you should declare the base image in the
metadata.yaml
file under the
connectorBuildOptions.baseImage
key. The Airbyte build system will handle the image creation for you. This is enforced for security and maintainability reasons, and is documented in the official QA checks and migration guides [Migration Guide: How to make a python connector use our base image](https://docs.airbyte.com/platform/next/connector-development/cdk-python/migration-to-base-image), [Airbyte connectors QA checks](https://docs.airbyte.com/platform/next/contributing-to-airbyte/resources/qa-checks#-security). If you are developing a connector for open source contribution or certification, you must: - Remove any Dockerfile from your connector folder. - Add the following to your `metadata.yaml`:
Copy code
yaml   connectorBuildOptions:     baseImage: docker.io/airbyte/python-connector-base:<version>@sha256:<digest>
(Replace
<version>
and
<digest>
with the latest values as shown in the documentation.) If you are only prototyping or debugging locally and not aiming for certification, you can use a Dockerfile. An example Dockerfile for a Python destination connector is:
Copy code
dockerfile FROM airbyte/python-connector-base:1.1.0  COPY . ./airbyte/integration_code RUN pip install ./airbyte/integration_code  # The entrypoint and default env vars are already set in the base image ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
This example is not optimized and is only for local development or debugging purposes. Certified connectors must not use a Dockerfile and must use the base image declaration in
metadata.yaml
instead [Setting up standard acceptance tests for your connector](https://docs.airbyte.com/platform/next/connector-development/testing-connectors/connector-acceptance-tests-reference#setting-up-standard-acceptance-tests-for-your-connector), [Airbyte connectors QA checks](https://docs.airbyte.com/platform/next/contributing-to-airbyte/resources/qa-checks#-security). Summary: - For certified connectors: Do not use a Dockerfile; use
metadata.yaml
with
connectorBuildOptions.baseImage
. - For local prototyping: You may use a Dockerfile as shown above, but this is not supported for certified connectors.