Skip to content

Commit 7697748

Browse files
committed
docs: Readme update to help others dev-test locally
1 parent a23cfe8 commit 7697748

File tree

2 files changed

+92
-16
lines changed

2 files changed

+92
-16
lines changed

airbyte-integrations/connectors/destination-glide/README.md

+80-6
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,93 @@
33
This is the repository for the Glide destination connector, written in Python.
44
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/destinations/glide).
55

6-
## Local development
6+
## Development
7+
8+
The active todo list is at [./todo.md].
9+
The gist of the Glide-specific code is in `/destination_glide/destination.py` and `/destination_glide/glide.py`.
710

811
### Prerequisites
912

10-
* Python (`^3.9`)
11-
* Poetry (`^1.7`) - installation instructions [here](https://python-poetry.org/docs/#installation)
13+
- Python (`^3.9`, tested recently with `3.12.3`)
14+
- Poetry (`^1.7`, tested recently with `1.8.3_1`)
15+
16+
I used homebrew for installing these prerequisites on macOS.
17+
18+
### Unit Tests
19+
20+
The unit tests for that code are in `/destination-glide/unit_tests`. To run them run:
21+
22+
```sh
23+
./scripts/test-unit.sh
24+
```
25+
26+
### Integration Tests
27+
28+
The destination has a configuration in `/secrets/config.json`. That file must confirm to the configuration specification in `/destination_glide/spec.json`. It should be something like:
29+
30+
```json
31+
{
32+
"api_host": "http://localhost:5005",
33+
"api_path_root": "api",
34+
"api_key": "decafbad-1234-1234-1234-decafbad"
35+
}
36+
```
37+
38+
The spec also specifies the configuration UI within the Airbyte product itself for configuring the destination.
39+
40+
There are a set of simple integration tests that Airbyte provides that can be triggered with the following scripts:
41+
42+
```sh
43+
./scripts/dev-check.sh
44+
./scripts/dev-spec.sh
45+
./scripts/dev-write.sh
46+
```
47+
48+
These simply call commands that Airbyte provides in their connector template. The dev-write one appears to be the most comprehensive, but I've struggled to get that one to consistently run (see TODO).
49+
50+
### Build & Deployment
51+
52+
The Airbyte destination is packed as Docker image. This script uses Airbyte-provided tooling named `airbyte-ci` that leverages the same tooling they use in their CI pipeline to build the container.
53+
54+
To install the tooling see [`airbyte-ci` README in this repo](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) This worked for me other than to make it work on macOS with homebrew-provided python, I don't have `python` on my path only `python3` so I had to change that in a couple places in the `Makefile` in the root of this repo.
1255

56+
```sh
57+
./scripts/build-docker-image.sh
58+
```
59+
60+
We are currently deploying this to a public repository for ease of access from an Airbyte OSS instance. To deploy it to a docker container registry use the script at:
61+
62+
```sh
63+
./scripts/push-docker-image.sh
64+
```
65+
66+
### Running in Airbyte OSS Locally
67+
68+
To install Airbyte follow the guide at https://docs.airbyte.com/deploying-airbyte/quickstart. On macOS this uses homebrew to install k8s kind locally and get an airbyte cluster running. It took a while but worked smoothly for me. I am currently using `airbytehq/tap/abctl (0.5.0)`.
69+
70+
Once install it should be available at http://localhost:8000/. You should have been prompted for username/pw during install.
71+
72+
### Installing Glide Destination in Airbyte OSS
73+
74+
To install the destination into Airbyte OSS follow these steps:
1375

76+
1. Click on **Settings** on the far left then select **Destinations** in the sub-panel. You should see a list of **Available destination connectors**.
77+
2. At the top click the **+ New Connector** button fill in the fields. The **Docker repository name** and **Docker image tag** are the important bits.
78+
79+
Once installed, you can upgrade it to a new version by visiting the same settings page and changing the tag in the **Change to** box and clicking the **Change** button.
80+
81+
---
82+
83+
## Old (from Airbyte's Template)
1484

1585
### Installing the connector
1686

1787
From this connector directory, run:
88+
1889
```bash
1990
poetry install --with dev
2091
```
2192

22-
2393
#### Create credentials
2494

2595
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/destinations/glide)
@@ -31,6 +101,7 @@ See `integration_tests/sample_config.json` for a sample config file.
31101
and place them into `secrets/config.json`.
32102

33103
### Locally running the connector
104+
34105
```
35106
poetry run destination-glide spec
36107
poetry run destination-glide check --config secrets/config.json
@@ -49,6 +120,7 @@ poetry run pytest tests
49120

50121
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
51122
2. Run the following command to build the docker image:
123+
52124
```bash
53125
airbyte-ci connectors --name=destination-glide build
54126
```
@@ -58,6 +130,7 @@ An image will be available on your host with the tag `airbyte/destination-glide:
58130
### Running as a docker container
59131

60132
Then run any of the connector commands as follows:
133+
61134
```
62135
docker run --rm airbyte/destination-glide:dev spec
63136
docker run --rm -v $(pwd)/secrets:/secrets airbyte/destination-glide:dev check --config /secrets/config.json
@@ -91,10 +164,11 @@ Please commit the changes to `pyproject.toml` and `poetry.lock` files.
91164
## Publishing a new version of the connector
92165

93166
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
167+
94168
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=destination-glide test`
95169
2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
96-
- bump the `dockerImageTag` value in in `metadata.yaml`
97-
- bump the `version` value in `pyproject.toml`
170+
- bump the `dockerImageTag` value in in `metadata.yaml`
171+
- bump the `version` value in `pyproject.toml`
98172
3. Make sure the `metadata.yaml` content is up to date.
99173
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/destinations/glide.md`).
100174
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).
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
- [+] feat: choose a strategy based on config
2-
- [+] chore: stop writing any record data to logs
3-
- [+] chore: cleanup logs generally
4-
- [+] fix: "add rows failed with status 400: {"message":"More than 500 mutations"}" in mutation api (batch them to ~100 or something)
5-
- [+] fix: batch row adds in rest api
6-
- [+] chore: unify test framework across unit/integration tests (remove pytest?)
7-
- [+] feat: snuggle rows in a batch
8-
- [+] feat: support multiple streams from source by using a naming convention and discovering existing tables with GET /tables
1+
- [x] feat: choose a strategy based on config
2+
- [x] chore: stop writing any record data to logs
3+
- [x] chore: cleanup logs generally
4+
- [x] fix: "add rows failed with status 400: {"message":"More than 500 mutations"}" in mutation api (batch them to ~100 or something)
5+
- [x] fix: batch row adds in rest api
6+
- [x] chore: unify test framework across unit/integration tests (remove pytest?)
7+
- [x] feat: snuggle rows in a batch
8+
- [x] feat: support multiple streams from source by using a naming convention and discovering existing tables with GET /tables
9+
- [ ] feat: add airbyte\_ prefix to all tables to prevent user from inadvertently overwriting existing table.
910
- [ ] fix: replace "hostname" and "path" configs with "baseUrl"
11+
- [ ] fix: use friendly names for the properties on the config page
1012
- [ ] feat: verify actual host/api/auth connection in check: https://docs.airbyte.com/understanding-airbyte/airbyte-protocol#check
1113
- [ ] feat: add a default timeout everywhere per https://requests.readthedocs.io/en/latest/user/quickstart/#timeouts
12-
- [ ] fix: use friendly names for the properties on the config page
1314

1415
- [ ] chore: update readme
16+
- [ ] feat: incremental update support for airbyte (explore what APIs we need to do this)
1517
- [ ] chore: unit test for Column to ensure it serializes to json as expected
16-
- [ ] chore: remove GlideBigTableMutationsStrategy?
18+
- [x] chore: remove GlideBigTableMutationsStrategy?
1719
- [ ] chore: clean up todos
1820
- [ ] chore: figure out why the dev-write script stopped working (freezes)

0 commit comments

Comments
 (0)