-
Notifications
You must be signed in to change notification settings - Fork 4.5k
cat/connectors-ci: replace docker runner with dagger runner in CAT #28000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Before Merging a Connector Pull RequestWow! What a great pull request you have here! 🎉 To merge this PR, ensure the following has been done/considered for each connector added or updated:
If the checklist is complete, but the CI check is failing,
|
@pytest.fixture(scope="session", autouse=True) | ||
def pull_docker_image(acceptance_test_config) -> None: | ||
"""Startup fixture to pull docker image""" | ||
image_name = acceptance_test_config.connector_image | ||
config_filename = "acceptance-test-config.yml" | ||
try: | ||
ConnectorRunner(image_name=image_name, volume=Path(".")) | ||
except errors.ImageNotFound: | ||
pytest.exit(f"Docker image `{image_name}` not found, please check your {config_filename} file", returncode=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed as Dagger will use the container passed by airbyte-ci, build the container according to the local docker file, or pull the image if it's not :dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love to see try and ifs get deleted
@@ -240,3 +240,17 @@ def _scan_schema(subschema, path=""): | |||
|
|||
_scan_schema(schema) | |||
return paths | |||
|
|||
|
|||
def flatten_tuples(to_flatten): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function was orignally imported from the old jsonschema version, it was a private function that disappeared in the newest jsonschema package version, I redeclared it, as it, here.
@@ -109,30 +109,6 @@ def test_verify_records_schema(configured_catalog: ConfiguredAirbyteCatalog): | |||
({"a": "2021-08-10T12:43:15Z"}, {"type": "object", "properties": {"a": {"type": "string", "format": "date-time"}}}, True), | |||
({"a": "2018-11-13T20:20:39+00:00"}, {"type": "object", "properties": {"a": {"type": "string", "format": "date-time"}}}, True), | |||
({"a": "2018-21-13T20:20:39+00:00"}, {"type": "object", "properties": {"a": {"type": "string", "format": "date-time"}}}, False), | |||
# This is valid for postgres sql but not valid for bigquery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following format are not supported by Airbyte.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there any harm in leaving this in?
|
||
@property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this code is not useful anymore as the Dagger API makes this straightforward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!
Trying out a nightly build on this branch: https://github.com/airbytehq/airbyte/actions/runs/5488096627 |
/legacy-publish connector=bases/connector-acceptance-test auto-bump-version=false
|
/legacy-publish connector=bases/connector-acceptance-test
if you have connectors that successfully published but failed definition generation, follow step 4 here |
/legacy-publish connector=bases/connector-acceptance-test
if you have connectors that successfully published but failed definition generation, follow step 4 here |
|
Step | Result |
---|---|
Validate airbyte-integrations/connectors/source-persistiq/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ❌ |
QA checks | ✅ |
Code format checks | ✅ |
Connector package install | ❌ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-persistiq test
|
Step | Result |
---|---|
Validate airbyte-integrations/connectors/source-waiteraid/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ❌ |
QA checks | ✅ |
Code format checks | ✅ |
Connector package install | ✅ |
Build source-waiteraid docker image for platform linux/x86_64 | ✅ |
Acceptance tests | ❌ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-waiteraid test
The publish does not work anymore because:
|
/legacy-publish connector=bases/connector-acceptance-test
if you have connectors that successfully published but failed definition generation, follow step 4 here |
/legacy-publish connector=bases/connector-acceptance-test run-tests=false
if you have connectors that successfully published but failed definition generation, follow step 4 here |
What
Closes #27858.
In CAT, we want to run connector under test container with Dagger instead of
docker run
.Reasons are explained in #27858.
Dagger requires Python 3.10, CAT is running Python 3.9,: we have to upgrade CAT to Python 3.10, this explain the breadth of changes in this PR.
How
1. Upgrade CAT to Python 3.10
hypothesis-json-schema
)2. Refactor the
ConnectorRunner
to use daggerairbyte/airbyte-integrations/bases/connector-acceptance-test/connector_acceptance_test/utils/connector_runner.py
Line 1 in 0555ca4
We can get rid of a lot of docker related code and use Dagger API to provision the connector under test container with the required resources. The container under test image is passed from
airbyte-ci
using a tarball.3. Change
airbyte-ci
to run CAT with dagger-in-dagger instead of docker-in-dockerWe can get rid of the the docker-in-docker paradigm. Binding CAT to a docker daemon sidecar container is not longer required and will reduce the number of moving parts and, hopefully, transient failures.
As CAT is now built on the fly it's also easier to make CAT changes and test these change on the same PR.
4. Make sure that other way of running CAT (directly via python execution or with
acceptance-test-docker.sh
is still supportedacceptance-test-docker.sh
still works5. Update CAT unit test to make them pass.
6. Publish CAT 1.0.0