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

Better intellij dev experience #28817

Closed
wants to merge 10 commits into from
Closed

Conversation

edgao
Copy link
Contributor

@edgao edgao commented Jul 27, 2023

I'm sure there's more cleanup that could happen in the plugin file. But presumably we want to just nuke the entire airbyteDocker plugin eventually, so not going to bother.

airbyteDocker now explicitly declares build/distributions as an input directory, which I believe is what most (all?) java connectors copy into their docker image. This probably misses a few edge cases, but given that this only matters for running locally in intelllij - I think that's OK.

(confirmed locally that running tests twice in a row skips airbyteDocker correctly)

@github-actions
Copy link
Contributor

github-actions bot commented Jul 27, 2023

Before Merging a Connector Pull Request

Wow! 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:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@evantahler
Copy link
Contributor

Tagging @alafanechere - this completes the circle 🟢!

@evantahler
Copy link
Contributor

@edgao so like... does it work? Can we get a loom of you using it?

  • run docker system prune -a
  • run a test in inteliJ (time it)
  • run that test in inteliJ a second time (is it faster?)

@octavia-squidington-iii
Copy link
Collaborator

destination-snowflake test report (commit 4cae645174) - ✅

⏲️ Total pipeline duration: 63mn12s

Step Result
Validate airbyte-integrations/connectors/destination-snowflake/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build destination-snowflake docker image for platform linux/x86_64
Build airbyte/normalization-snowflake:dev
./gradlew :airbyte-integrations:connectors:destination-snowflake:integrationTest

🔗 View the logs here

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=destination-snowflake test

@edgao
Copy link
Contributor Author

edgao commented Jul 31, 2023

https://www.loom.com/share/69e8677d903d48d6821939b2e1cd96ea

it does run successfully, but I think airbyte-ci isn't actually caching successfully on my laptop. Ran it twice in succession and it took >9 minutes both times (nearly 10 minutes on the first run).

the old airbyteDocker was significantly faster, but I think that's a bit misleading - it also wasn't reliably building new images, so I was manually running airbyte-ci before tests anyway. I.e. I think this is still an improvement for local dev.

I'll try and find a way to disable this on CI for now. The CI test run on this branch took about 10 minutes longer to run integrationTest (54mn39s vs 44mn04s on the latest nightly)... which might indicate more general caching issues, actually

@edgao
Copy link
Contributor Author

edgao commented Jul 31, 2023

also, if you want to try this out locally - if you haven't rebooted since switching to the poetry-based airbyte-ci install:

  • restart intellij
  • kill all your gradle daemon processes

otherwise you might get weird issues where they can't find airbyte-ci

@octavia-squidington-iii
Copy link
Collaborator

destination-snowflake test report (commit 03294ed444) - ✅

⏲️ Total pipeline duration: 41mn39s

Step Result
Validate airbyte-integrations/connectors/destination-snowflake/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build destination-snowflake docker image for platform linux/x86_64
Build airbyte/normalization-snowflake:dev
./gradlew :airbyte-integrations:connectors:destination-snowflake:integrationTest

🔗 View the logs here

☁️ 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=destination-snowflake test

Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

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

This is great and a first nice step in sunsetting airbyteDocker right?
Please note my comment; LGTM otherwise.
Would we want to handle the airbyte-ci installation from gradle? (might be overkill ATM for local gradle execution)

buildSrc/src/main/groovy/airbyte-docker.gradle Outdated Show resolved Hide resolved
@alafanechere
Copy link
Contributor

alafanechere commented Aug 9, 2023

I'll try and find a way to disable this on CI for now. The CI test run on this branch took about 10 minutes longer to run integrationTest (54mn39s vs 44mn04s on the latest nightly)... which might indicate more general caching issues, actually

When airbyte-ci runs integration test or build it's using a gradle command with -x airbyteDocker : I think it means that on the CI airbyte-ci won't call itself (which is the desired behavior right?).

@edgao
Copy link
Contributor Author

edgao commented Aug 9, 2023

I don't think this is mergeable until dagger/gradle (idk which) caching works better :/ Intellij runs destination-foo:airbyteDocker anytime you run anything inside test-integration... even if that test doesn't actually need the docker image (e.g. BigQuerySqlGeneratorIntegrationTest). Currently that iteration loop is really tight (because airbyteDocker terminates quickly, and it doesn't matter that it doesn't work); adding a 9-minute airbyte-ci build would be really painful

maybe we should have test-integration for tests that need secrets / infra but not the docker image, and test-acceptance for anything that depends on the docker image? but I think that's a bigger project

or maybe we should just delete airbyteDocker completely? and tell developers to manually run airbyte-ci before running tests from intellij. I think that's basically what we have today, except without the "sometimes intellij automatically builds the docker images, but extremely unreliably" behavior

@edgao edgao marked this pull request as draft August 9, 2023 20:49
@evantahler
Copy link
Contributor

@edgao I think we can keep this task fast when nothing has changed if we modify the isUpToDate() method. I think this method is expecting project.rootProject.imageToHash.get to have been set by the build command, which are no longer doing. We could set that after shelling out to airbyte-ci, or be lazier and skip the hash check, and just be OK if the image exists at all

@edgao
Copy link
Contributor Author

edgao commented Aug 10, 2023

I dropped the uptodate check entirely b/c I thought airbyte-ci would handle it 🤦

I never quite figured out what the imageToHash thing actually does, and suspect it over and/or undercaches things... maybe gradle has something for "run this task only if compileJava did anything"? Which probably works >95% of the time (i.e. it misses changes to shell scripts/etc, but we basically never change those files anyway, and we can always come back to this))

@edgao
Copy link
Contributor Author

edgao commented Aug 10, 2023

airbyteDocker now explicitly declares build/distributions as an input directory, which I believe is what most (all?) java connectors copy into their docker image. This probably misses a few edge cases, but given that this only matters for running locally in intelllij - I think that's OK. PTAL!

(confirmed locally that running tests twice in a row skips airbyteDocker correctly)

@edgao edgao marked this pull request as ready for review August 10, 2023 23:58
@edgao edgao changed the title airbyteDocker shells out to airbyte-ci Better intellij dev experience Aug 11, 2023
@octavia-squidington-iii

This comment was marked as outdated.

@octavia-squidington-iii

This comment was marked as outdated.

@alafanechere
Copy link
Contributor

@edgao you're right considering the airbyte-ci gradle caching does not properly work.
I logged this issue to improve it #28983
Conor made it work in aircmd (the with_gradle function).

@octavia-squidington-iii

This comment was marked as outdated.

@octavia-squidington-iii

This comment was marked as outdated.

@edgao
Copy link
Contributor Author

edgao commented Aug 11, 2023

connectors base build failed on CI:

2023-08-11T17:59:36.0531571Z 1: Task failed with an exception.
2023-08-11T17:59:36.0532505Z -----------
2023-08-11T17:59:36.0532899Z * What went wrong:
2023-08-11T17:59:36.0533604Z Execution failed for task ':airbyte-integrations:connectors:destination-bigquery:airbyteDocker'.
2023-08-11T17:59:36.0534290Z > A problem occurred starting process 'command 'airbyte-ci''

but no other information :( will keep poking at this

@octavia-squidington-iii

This comment was marked as outdated.

@octavia-squidington-iii

This comment was marked as outdated.

@edgao edgao marked this pull request as draft August 11, 2023 22:52
@edgao
Copy link
Contributor Author

edgao commented Aug 11, 2023

uhhhh I'm going to just remove the connectors from the connectors_base sub build. settings.gradle claims they're only needed for normalization integration tests, which we're not running anymore.

@edgao edgao marked this pull request as ready for review August 11, 2023 23:25
@octavia-squidington-iii

This comment was marked as outdated.

@octavia-squidington-iii

This comment was marked as outdated.

@github-actions
Copy link
Contributor

destination-bigquery test report (commit 197f8245d4) - ✅

⏲️ Total pipeline duration: 32mn19s

Step Result
Validate airbyte-integrations/connectors/destination-bigquery/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build destination-bigquery docker image for platform linux/x86_64
Build airbyte/normalization:dev
./gradlew :airbyte-integrations:connectors:destination-bigquery:integrationTest

🔗 View the logs here

☁️ 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=destination-bigquery test

@github-actions
Copy link
Contributor

destination-snowflake test report (commit 197f8245d4) - ✅

⏲️ Total pipeline duration: 45mn34s

Step Result
Validate airbyte-integrations/connectors/destination-snowflake/metadata.yaml
Connector version semver check
QA checks
Build connector tar
Build destination-snowflake docker image for platform linux/x86_64
Build airbyte/normalization-snowflake:dev
./gradlew :airbyte-integrations:connectors:destination-snowflake:integrationTest

🔗 View the logs here

☁️ 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=destination-snowflake test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants