Skip to content
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

Split connector builds. #11148

Merged
merged 17 commits into from
Mar 16, 2022
Merged

Split connector builds. #11148

merged 17 commits into from
Mar 16, 2022

Conversation

davinchia
Copy link
Contributor

@davinchia davinchia commented Mar 15, 2022

What

Follow up to #11064 for the connector builds. After this change, connector builds will only trigger if

  • there are changes in the airbyte-integration folder
  • there are changes in the airbyte-db folder

How

  • Add a new filter for connectors and add an if condition to the start connector base builder action.
  • Also take the chance to update the backend filter to be more accurate.

Recommended reading order

  1. the one file.

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the new connector version is published, connector version bumped in the seed directory as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@davinchia davinchia temporarily deployed to more-secrets March 15, 2022 07:21 Inactive
@davinchia davinchia temporarily deployed to more-secrets March 15, 2022 07:22 Inactive
@davinchia
Copy link
Contributor Author

Example of the connector build not running since there are no changes: https://github.com/airbytehq/airbyte/runs/5549783444?check_suite_focus=true

I removed the build condition to test this.

@davinchia davinchia temporarily deployed to more-secrets March 15, 2022 07:26 Inactive
@davinchia davinchia temporarily deployed to more-secrets March 15, 2022 07:26 Inactive
@davinchia davinchia temporarily deployed to more-secrets March 15, 2022 07:30 Inactive
@davinchia davinchia temporarily deployed to more-secrets March 15, 2022 07:31 Inactive
@davinchia
Copy link
Contributor Author

Example of the connector build running because of changes in the db module: https://github.com/airbytehq/airbyte/runs/5549837857?check_suite_focus=true

@davinchia
Copy link
Contributor Author

Example of connector build running because of changes in the integrations module: https://github.com/airbytehq/airbyte/runs/5549882923?check_suite_focus=true

@davinchia davinchia temporarily deployed to more-secrets March 15, 2022 07:37 Inactive
@davinchia davinchia temporarily deployed to more-secrets March 15, 2022 07:38 Inactive
@davinchia
Copy link
Contributor Author

Example of connector build running because of change in connector submodule: https://github.com/airbytehq/airbyte/runs/5549907212?check_suite_focus=true

@@ -39,8 +41,14 @@ jobs:
- 'airbyte-**/**'
build:
- '.github/**'
- 'buildSrc/**'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realised these are part of the 'build' too.

@github-actions github-actions bot added area/frontend area/platform issues related to the platform labels Mar 15, 2022
@github-actions github-actions bot removed area/platform issues related to the platform area/frontend labels Mar 15, 2022
filters: |
backend:
- 'airbyte-**/**'
- 'airbyte-!(integrations|webapp|webapp-e2e-tests)/**'
Copy link
Contributor Author

@davinchia davinchia Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cgardens I've improved the backend filter so it ignores the non-backend modules. This should further reduce excessive FE build runs. Lmk if I missed something out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like the right way to do this would be to use actual build caching in gradle instead of setting these manual filters. Not for this PR but is that the right North Star?

Copy link
Contributor Author

@davinchia davinchia Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We do use gradle's caching under the hood. These filters happen at the build-infrastructure level instead of the build level. It helps us avoid running the same gradle tasks X many times on the various build pipelines.

We can try to push this into gradle (though honestly not much more we can do). However that still does not give teams build setup isolation from each other.

@@ -504,7 +520,9 @@ jobs:
start-frontend-test-runner:
name: Start Frontend Test EC2 Runner
needs: changes
if: needs.changes.outputs.frontend == 'true' || needs.changes.outputs.build == 'true' || needs.changes.outputs.backend == 'true' || github.ref == 'refs/heads/master'
if: |
needs.changes.outputs.frontend == 'true' || needs.changes.outputs.build == 'true' || github.ref == 'refs/heads/master'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

splitting this for better formatting

start-connectors-base-build-runner:
name: "Connectors Base: Start Build EC2 Runner"
needs: changes
if: |
needs.changes.outputs.build == 'true' || needs.changes.outputs.connectors == 'true' || needs.changes.outputs.db == 'true'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my understanding is the top level db module is the only module we want to rest the connector build on if it's changes. is this correct?

@davinchia davinchia marked this pull request as ready for review March 15, 2022 10:01
@davinchia
Copy link
Contributor Author

davinchia commented Mar 15, 2022

PTAL @sherifnada @cgardens @jrhizor @supertopher following the previous split mechanism for the connector builds.

I think the DB module is the top level module we should trigger the connector build on - lmk if I missed something out.

FYI @timroes since this does touch the frontend build too.

This PT prevents connector build triggering on platform changes but does not prevent platform build triggering on connector changes. That will be the last follow up. I'm doing this piecemeal to minimise the changeset.

@davinchia davinchia mentioned this pull request Mar 15, 2022
@davinchia davinchia merged commit 4c44e82 into master Mar 16, 2022
@davinchia davinchia deleted the davinchia/split-connector-builds branch March 16, 2022 09:06
@davinchia davinchia mentioned this pull request Mar 16, 2022
40 tasks
davinchia added a commit that referenced this pull request Mar 16, 2022
Follow up to #11148 and #11148 .

Here we configure it so that platform builds only run on platform changes. As always, the build will run on build and github changes.
@davinchia davinchia mentioned this pull request Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants