You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Airbyte way of building this connector is to use our `airbyte-ci` tool.
63
+
You can follow install instructions [here](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md#L1).
64
+
Then running the following command will build your connector:
65
+
61
66
```bash
62
-
airbyte-ci connectors --name=source-faker build
67
+
airbyte-ci connectors --name source-faker build
68
+
```
69
+
Once the command is done, you will find your connector image in your local docker registry: `airbyte/source-faker:dev`.
70
+
71
+
##### Customizing our build process
72
+
When contributing on our connector you might need to customize the build process to add a system dependency or set an env var.
73
+
You can customize our build process by adding a `build_customization.py` module to your connector.
74
+
This module should contain a `pre_connector_install` and `post_connector_install` async function that will mutate the base image and the connector container respectively.
75
+
It will be imported at runtime by our build process and the functions will be called if they exist.
76
+
77
+
Here is an example of a `build_customization.py` module:
78
+
```python
79
+
from__future__import annotations
80
+
81
+
from typing importTYPE_CHECKING
82
+
83
+
ifTYPE_CHECKING:
84
+
# Feel free to check the dagger documentation for more information on the Container object and its methods.
An image will be built with the tag `airbyte/source-faker:dev`.
96
+
#### Build your own connector image
97
+
This connector is built using our dynamic built process in `airbyte-ci`.
98
+
The base image used to build it is defined within the metadata.yaml file under the `connectorBuildOptions`.
99
+
The build logic is defined using [Dagger](https://dagger.io/)[here](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/pipelines/builds/python_connectors.py).
100
+
It does not rely on a Dockerfile.
101
+
102
+
If you would like to patch our connector and build your own a simple approach would be to:
103
+
104
+
1. Create your own Dockerfile based on the latest version of the connector image.
105
+
```Dockerfile
106
+
FROM airbyte/source-faker:latest
107
+
108
+
COPY . ./airbyte/integration_code
109
+
RUN pip install ./airbyte/integration_code
66
110
67
-
**Via `docker build`:**
111
+
# The entrypoint and default env vars are already set in the base image
Please use this as an example. This is not optimized.
116
+
117
+
2. Build your image:
68
118
```bash
69
119
docker build -t airbyte/source-faker:dev .
120
+
# Running the spec command against your patched connector
121
+
docker run airbyte/source-faker:dev spec
70
122
```
71
-
72
123
#### Run
73
124
74
125
Then run any of the connector commands as follows:
@@ -108,4 +159,3 @@ You've checked out the repo, implemented a million dollar feature, and you're re
108
159
5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
109
160
6. Pat yourself on the back for being an awesome contributor.
110
161
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
| 6.0.1 | 2024-02-12 |[TBD](https://github.com/airbytehq/airbyte/pull/TBD)| Base image migration: remove Dockerfile and use the python-connector-base image |
0 commit comments