Skip to content

Commit 94a83d9

Browse files
authored
Source dockerhub: Migrate to manifest-only (#44155)
1 parent 3b9cb39 commit 94a83d9

File tree

13 files changed

+36
-1210
lines changed

13 files changed

+36
-1210
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,22 @@
11
# Dockerhub source connector
22

3-
This is the repository for the Dockerhub source connector, written in Python.
4-
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/dockerhub).
3+
This directory contains the manifest-only connector for `source-dockerhub`.
4+
This _manifest-only_ connector is not a Python package on its own, as it runs inside of the base `source-declarative-manifest` image.
55

6-
## Local development
7-
8-
### Prerequisites
9-
10-
- Python (~=3.9)
11-
- Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
12-
13-
### Installing the connector
14-
15-
From this connector directory, run:
16-
17-
```bash
18-
poetry install --with dev
19-
```
20-
21-
### Create credentials
6+
For information about how to configure and use this connector within Airbyte, see [the connector's full documentation](https://docs.airbyte.com/integrations/sources/dockerhub).
227

23-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/dockerhub)
24-
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_dockerhub/spec.yaml` file.
25-
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
26-
See `sample_files/sample_config.json` for a sample config file.
27-
28-
### Locally running the connector
29-
30-
```
31-
poetry run source-dockerhub spec
32-
poetry run source-dockerhub check --config secrets/config.json
33-
poetry run source-dockerhub discover --config secrets/config.json
34-
poetry run source-dockerhub read --config secrets/config.json --catalog sample_files/configured_catalog.json
35-
```
8+
## Local development
369

37-
### Running unit tests
10+
We recommend using the Connector Builder to edit this connector.
11+
Using either Airbyte Cloud or your local Airbyte OSS instance, navigate to the **Builder** tab and select **Import a YAML**.
12+
Then select the connector's `manifest.yaml` file to load the connector into the Builder. You're now ready to make changes to the connector!
3813

39-
To run unit tests locally, from the connector directory run:
40-
41-
```
42-
poetry run pytest unit_tests
43-
```
14+
If you prefer to develop locally, you can follow the instructions below.
4415

4516
### Building the docker image
4617

18+
You can build any manifest-only connector with `airbyte-ci`:
19+
4720
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
4821
2. Run the following command to build the docker image:
4922

@@ -53,52 +26,40 @@ airbyte-ci connectors --name=source-dockerhub build
5326

5427
An image will be available on your host with the tag `airbyte/source-dockerhub:dev`.
5528

29+
### Creating credentials
30+
31+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/dockerhub)
32+
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `spec` object in the connector's `manifest.yaml` file.
33+
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
34+
5635
### Running as a docker container
5736

58-
Then run any of the connector commands as follows:
37+
Then run any of the standard source connector commands:
5938

60-
```
39+
```bash
6140
docker run --rm airbyte/source-dockerhub:dev spec
6241
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-dockerhub:dev check --config /secrets/config.json
6342
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-dockerhub:dev discover --config /secrets/config.json
6443
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-dockerhub:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
6544
```
6645

67-
### Running our CI test suite
46+
### Running the CI test suite
6847

6948
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
7049

7150
```bash
7251
airbyte-ci connectors --name=source-dockerhub test
7352
```
7453

75-
### Customizing acceptance Tests
76-
77-
Customize `acceptance-test-config.yml` file to configure acceptance tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
78-
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
79-
80-
### Dependency Management
81-
82-
All of your dependencies should be managed via Poetry.
83-
To add a new dependency, run:
84-
85-
```bash
86-
poetry add <package-name>
87-
```
88-
89-
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
90-
9154
## Publishing a new version of the connector
9255

93-
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
94-
95-
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-dockerhub test`
96-
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)):
97-
- bump the `dockerImageTag` value in in `metadata.yaml`
98-
- bump the `version` value in `pyproject.toml`
99-
3. Make sure the `metadata.yaml` content is up to date.
56+
If you want to contribute changes to `source-dockerhub`, here's how you can do that:
57+
1. Make your changes locally, or load the connector's manifest into Connector Builder and make changes there.
58+
2. Make sure your changes are passing our test suite with `airbyte-ci connectors --name=source-dockerhub test`
59+
3. 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)):
60+
- bump the `dockerImageTag` value in in `metadata.yaml`
10061
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/dockerhub.md`).
10162
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).
10263
6. Pat yourself on the back for being an awesome contributor.
10364
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
104-
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
65+
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.

airbyte-integrations/connectors/source-dockerhub/__init__.py

-3
This file was deleted.

airbyte-integrations/connectors/source-dockerhub/acceptance-test-config.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
connector_image: airbyte/source-dockerhub:dev
44
tests:
55
spec:
6-
- spec_path: "source_dockerhub/spec.yaml"
6+
- spec_path: "manifest.yaml"
77
backward_compatibility_tests_config:
88
disable_for_version: "0.1.0"
99
connection:
1010
- config_path: "secrets/config.json"
1111
status: "succeed"
12-
# even with an incorrect username the api still returns 200 so just ignoring the invalid config check for now
12+
# even with an incorrect username the api still returns 200 so just ignoring the invalid config check for now
1313
# - config_path: "integration_tests/invalid_config.json"
1414
# status: "failed"
1515
discovery:
@@ -22,7 +22,8 @@ tests:
2222
empty_streams: []
2323
full_refresh:
2424
- config_path: "secrets/config.json"
25-
configured_catalog_path: "integration_tests/configured_catalog.json"
26-
# testing sequentially for same results can fail because of pull counts increasing for an image between runs
25+
configured_catalog_path:
26+
"integration_tests/configured_catalog.json"
27+
# testing sequentially for same results can fail because of pull counts increasing for an image between runs
2728
ignored_fields:
2829
"docker_hub": ["pull_count", "last_updated"]

airbyte-integrations/connectors/source-dockerhub/bootstrap.md

-14
This file was deleted.

airbyte-integrations/connectors/source-dockerhub/main.py

-8
This file was deleted.

airbyte-integrations/connectors/source-dockerhub/source_dockerhub/manifest.yaml airbyte-integrations/connectors/source-dockerhub/manifest.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
version: 0.50.2
1+
version: 4.3.0
22
type: DeclarativeSource
3-
43
check:
54
type: CheckStream
65
stream_names:
76
- docker_hub
8-
97
streams:
108
- type: DeclarativeStream
119
name: docker_hub
@@ -55,7 +53,6 @@ streams:
5553
type: CursorPagination
5654
cursor_value: '{{ response.get("next", {}) }}'
5755
stop_condition: '{{ not response.get("next", {}) }}'
58-
5956
schema_loader:
6057
type: InlineSchemaLoader
6158
schema:

airbyte-integrations/connectors/source-dockerhub/metadata.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ data:
77
- hub.docker.com
88
- auth.docker.io
99
connectorBuildOptions:
10-
baseImage: docker.io/airbyte/python-connector-base:2.0.0@sha256:c44839ba84406116e8ba68722a0f30e8f6e7056c726f447681bb9e9ece8bd916
10+
baseImage: docker.io/airbyte/source-declarative-manifest:4.4.1@sha256:a8c0f0d32782957beef2c65bac98756b04fff2f3ffc4568a6676d3c83a422a5b
1111
connectorSubtype: api
1212
connectorType: source
1313
definitionId: 72d405a3-56d8-499f-a571-667c03406e43
14-
dockerImageTag: 0.2.15
14+
dockerImageTag: 0.3.0
1515
dockerRepository: airbyte/source-dockerhub
1616
documentationUrl: https://docs.airbyte.com/integrations/sources/dockerhub
1717
githubIssueLabel: source-dockerhub
@@ -27,12 +27,12 @@ data:
2727
releaseStage: alpha
2828
remoteRegistries:
2929
pypi:
30-
enabled: true
30+
enabled: false
3131
packageName: airbyte-source-dockerhub
3232
supportLevel: community
3333
tags:
34-
- language:python
3534
- cdk:low-code
35+
- language:manifest-only
3636
connectorTestSuitesOptions:
3737
- suite: liveTests
3838
testConnections:

0 commit comments

Comments
 (0)