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.
127
+
You can follow install instructions [here](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md#L1).
128
+
Then running the following command will build your connector:
126
129
127
130
```bash
128
-
airbyte-ci connectors --name=source-fauna build
131
+
airbyte-ci connectors --name source-fauna build
132
+
```
133
+
Once the command is done, you will find your connector image in your local docker registry: `airbyte/source-fauna:dev`.
134
+
135
+
##### Customizing our build process
136
+
When contributing on our connector you might need to customize the build process to add a system dependency or set an env var.
137
+
You can customize our build process by adding a `build_customization.py` module to your connector.
138
+
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.
139
+
It will be imported at runtime by our build process and the functions will be called if they exist.
140
+
141
+
Here is an example of a `build_customization.py` module:
142
+
```python
143
+
from__future__import annotations
144
+
145
+
from typing importTYPE_CHECKING
146
+
147
+
ifTYPE_CHECKING:
148
+
# 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-fauna:dev`.
160
+
#### Build your own connector image
161
+
This connector is built using our dynamic built process in `airbyte-ci`.
162
+
The base image used to build it is defined within the metadata.yaml file under the `connectorBuildOptions`.
163
+
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).
164
+
It does not rely on a Dockerfile.
165
+
166
+
If you would like to patch our connector and build your own a simple approach would be to:
167
+
168
+
1. Create your own Dockerfile based on the latest version of the connector image.
169
+
```Dockerfile
170
+
FROM airbyte/source-fauna:latest
132
171
133
-
**Via `docker build`:**
172
+
COPY . ./airbyte/integration_code
173
+
RUN pip install ./airbyte/integration_code
134
174
175
+
# The entrypoint and default env vars are already set in the base image
Please use this as an example. This is not optimized.
180
+
181
+
2. Build your image:
135
182
```bash
136
183
docker build -t airbyte/source-fauna:dev .
184
+
# Running the spec command against your patched connector
185
+
docker run airbyte/source-fauna:dev spec
137
186
```
138
-
139
187
#### Run
140
188
141
189
Then run any of the connector commands as follows:
@@ -178,4 +226,4 @@ You've checked out the repo, implemented a million dollar feature, and you're re
178
226
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/fauna.md`).
179
227
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).
180
228
6. Pat yourself on the back for being an awesome contributor.
181
-
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
229
+
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
0 commit comments