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

Un-revert add /tmp emptyDir volume to connector pods #11511

Merged
merged 6 commits into from
Apr 11, 2022

Conversation

pmossman
Copy link
Contributor

@pmossman pmossman commented Mar 29, 2022

What

Addresses #11163

Context: in #10761, a kube volume mount at /tmp was added for connector pods that need to write temporary data to disk. This was reverted because kube acceptance tests were consistently failing after this change.

After some digging, I found that normalization was failing due to an empty /tmp/dbt_modules directory, and this made sense as the new volume mount at /tmp was clearly overwriting the compile-time dbt modules that were stored there.

Slack thread with some context/convo: https://airbytehq-team.slack.com/archives/C02TXQ020QM/p1648763773988619

How

This PR updates our dbt project templates to store dbt_modules at /dbt-tmp instead of /tmp so that the volume mount no longer conflicts. It also un-reverts the original PR to re-introduce the /tmp volume mount.

Misc Questions

  • Is this the correct way to make a change to base-normalization? I'll need a /publish command at some point right? (I haven't ever had to use publish so this is the first time I'm running into this process).

@github-actions github-actions bot added area/platform issues related to the platform area/worker Related to worker labels Mar 29, 2022
@pmossman pmossman temporarily deployed to more-secrets March 29, 2022 18:13 Inactive
@pmossman pmossman temporarily deployed to more-secrets March 29, 2022 18:13 Inactive
@pmossman pmossman temporarily deployed to more-secrets March 29, 2022 22:35 Inactive
@pmossman pmossman temporarily deployed to more-secrets March 29, 2022 22:35 Inactive
@pmossman pmossman temporarily deployed to more-secrets March 29, 2022 23:00 Inactive
@pmossman pmossman temporarily deployed to more-secrets March 29, 2022 23:01 Inactive
@pmossman pmossman temporarily deployed to more-secrets April 4, 2022 15:03 Inactive
@pmossman pmossman temporarily deployed to more-secrets April 4, 2022 15:03 Inactive
@pmossman pmossman temporarily deployed to more-secrets April 5, 2022 19:35 Inactive
@pmossman pmossman temporarily deployed to more-secrets April 5, 2022 19:36 Inactive
@pmossman pmossman temporarily deployed to more-secrets April 5, 2022 20:06 Inactive
@pmossman pmossman temporarily deployed to more-secrets April 5, 2022 20:06 Inactive
@pmossman pmossman marked this pull request as ready for review April 5, 2022 20:22
@@ -24,7 +24,7 @@ macro-paths: ["macros"]

target-path: "../build" # directory which will store compiled SQL files
log-path: "../logs" # directory which will store DBT logs
packages-install-path: "/tmp/dbt_modules" # directory which will store external DBT dependencies
packages-install-path: "/dbt-tmp/dbt_modules" # directory which will store external DBT dependencies
Copy link
Contributor

Choose a reason for hiding this comment

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

for simpler naming, it doesn't need to be related to tmp, what about going directly with /dbt_modules or even /dbt (without the dbt_modules)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I like /dbt too. It's not really tmp since these are files we want to keep and continually use.

@ChristopheDuong
Copy link
Contributor

ChristopheDuong commented Apr 5, 2022

Is this the correct way to make a change to base-normalization? I'll need a /publish command at some point right?

Yes, you have description in the release process doc here too: https://docs.google.com/document/d/1Q1N4oomtz3rXqqn97nMB5rfcM_Dd2K3in5vmYPWdjjY/edit

especially you need to run integration tests because the output dbt_project.yml are also versioned in git:

packages-install-path: "/tmp/dbt_modules" # directory which will store external DBT dependencies

so they need to be regenerated with your changes

Copy link
Contributor

@davinchia davinchia left a comment

Choose a reason for hiding this comment

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

LGTM! What Chris said about testing and publishing before we merge this in.

@pmossman pmossman temporarily deployed to more-secrets April 6, 2022 22:35 Inactive
@pmossman pmossman temporarily deployed to more-secrets April 6, 2022 22:35 Inactive
@pmossman
Copy link
Contributor Author

pmossman commented Apr 6, 2022

@ChristopheDuong I tried to run normalization integration tests locally, but I wasn't able to get this working on my M1 laptop. I don't think I ever managed to get any of the SUB_BUILD=CONNECTORS_BASE gradle workflows working locally.

Is there a workaround to generate those dbt_project.yml changes you mentioned? Or alternatively, would you be able to check out this branch and run the integration tests locally on your machine?

@pmossman
Copy link
Contributor Author

pmossman commented Apr 6, 2022

Actually ignore my last comment @ChristopheDuong , I asked Edward for M1 python help and we resolved the blocker I was running into, running the local integration tests now and will follow the release process guidelines now that I'm unblocked

@pmossman
Copy link
Contributor Author

pmossman commented Apr 7, 2022

Sorry for the message spam @ChristopheDuong but I spoke too soon I think - normalization integration tests are failing for me, even if I run in master. I don't want to block this PR on my M1-specific woes so if you or @davinchia able to run the integration tests locally for this branch and commit the generated file changes, that'd be greatly appreciated!

@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets April 7, 2022 09:41 Inactive
@ChristopheDuong ChristopheDuong temporarily deployed to more-secrets April 7, 2022 09:41 Inactive
@ChristopheDuong
Copy link
Contributor

it seems like some .sql files for clickhouse/mssql were not up to date either, so it's now part of your PR.

I also had to add a little change in airbyte-integrations/bases/base-normalization/integration_tests/dbt_integration_test.py too

@pmossman
Copy link
Contributor Author

pmossman commented Apr 7, 2022

Thanks so much Chris!

@pmossman
Copy link
Contributor Author

pmossman commented Apr 7, 2022

/test connector=bases/base-normalization

🕑 bases/base-normalization https://github.com/airbytehq/airbyte/actions/runs/2110176529
❌ bases/base-normalization https://github.com/airbytehq/airbyte/actions/runs/2110176529
🐛

@edgao
Copy link
Contributor

edgao commented Apr 7, 2022

I'm not yet sure what's going on with the integration tests, but I ran into the same error (function json_extract_path_text(super, "unknown", boolean) does not exist) on another PR (#11804). Trying to repro on master right now (https://github.com/airbytehq/airbyte/runs/5873579710?check_suite_focus=true).

@ChristopheDuong
Copy link
Contributor

You can talk to @girarda, he ran into that weeks ago too and had to solve it already i think.

IIRC this is because this PR has side effects on all other branches: #9610
This is due to the datatypes of the tests being changed to super datatype on the destination whereas your PRs are not handling that type change...

@edgao
Copy link
Contributor

edgao commented Apr 7, 2022

/test connector=bases/base-normalization

🕑 bases/base-normalization https://github.com/airbytehq/airbyte/actions/runs/2111566876
✅ bases/base-normalization https://github.com/airbytehq/airbyte/actions/runs/2111566876
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        74      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  70     17    76%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              275    106    61%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
source_acceptance_test/tests/test_incremental.py        69     38    45%
------------------------------------------------------------------------
TOTAL                                                  876    259    70%
Name                                                                                                                            Stmts   Miss  Cover
---------------------------------------------------------------------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                                                                                          2      0   100%
normalization/transform_catalog/reserved_keywords.py                                                                               13      0   100%
normalization/transform_catalog/__init__.py                                                                                         2      0   100%
normalization/destination_type.py                                                                                                  13      0   100%
normalization/__init__.py                                                                                                           4      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py     124      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/__init__.py               1      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/__init__.py                      2      0   100%
normalization/transform_catalog/destination_name_transformer.py                                                                   155      8    95%
normalization/transform_config/transform.py                                                                                       168     31    82%
normalization/transform_catalog/table_name_registry.py                                                                            174     34    80%
normalization/transform_catalog/utils.py                                                                                           33      7    79%
normalization/transform_catalog/catalog_processor.py                                                                              143     77    46%
normalization/transform_catalog/transform.py                                                                                       45     26    42%
normalization/transform_catalog/stream_processor.py                                                                               524    337    36%
---------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                            1403    520    63%
Name                                                                                                                            Stmts   Miss  Cover
---------------------------------------------------------------------------------------------------------------------------------------------------
base_python/cdk/utils/casing.py                                                                                                     4      0   100%
base_python/__init__.py                                                                                                            13      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py     124      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/__init__.py               1      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/__init__.py                      2      0   100%
base_python/cdk/utils/event_timing.py                                                                                              47      3    94%
base_python/cdk/streams/auth/core.py                                                                                                8      1    88%
base_python/cdk/streams/exceptions.py                                                                                              10      2    80%
base_python/cdk/streams/auth/token.py                                                                                               9      4    56%
base_python/logger.py                                                                                                              33     15    55%
base_python/cdk/streams/rate_limiting.py                                                                                           30     14    53%
base_python/integration.py                                                                                                         52     25    52%
base_python/cdk/streams/http.py                                                                                                    67     33    51%
base_python/cdk/streams/core.py                                                                                                    63     32    49%
base_python/client.py                                                                                                              56     33    41%
base_python/catalog_helpers.py                                                                                                     10      6    40%
base_python/source.py                                                                                                              51     34    33%
base_python/cdk/streams/auth/oauth.py                                                                                              37     26    30%
base_python/cdk/abstract_source.py                                                                                                 89     64    28%
base_python/schema_helpers.py                                                                                                      56     41    27%
base_python/entrypoint.py                                                                                                          70     56    20%
---------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                             832    389    53%
Name                                                                                                                            Stmts   Miss  Cover
---------------------------------------------------------------------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                                                                                          2      0   100%
normalization/transform_catalog/reserved_keywords.py                                                                               13      0   100%
normalization/transform_catalog/__init__.py                                                                                         2      0   100%
normalization/destination_type.py                                                                                                  13      0   100%
normalization/__init__.py                                                                                                           4      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py     124      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/__init__.py               1      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/__init__.py                      2      0   100%
normalization/transform_catalog/destination_name_transformer.py                                                                   155      8    95%
normalization/transform_config/transform.py                                                                                       168     31    82%
normalization/transform_catalog/table_name_registry.py                                                                            174     34    80%
normalization/transform_catalog/utils.py                                                                                           33      7    79%
normalization/transform_catalog/catalog_processor.py                                                                              143     77    46%
normalization/transform_catalog/transform.py                                                                                       45     26    42%
normalization/transform_catalog/stream_processor.py                                                                               524    337    36%
---------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                            1403    520    63%
Name                                                                                                                            Stmts   Miss  Cover
---------------------------------------------------------------------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                                                                                          2      0   100%
normalization/transform_catalog/utils.py                                                                                           33      0   100%
normalization/transform_catalog/reserved_keywords.py                                                                               13      0   100%
normalization/transform_catalog/__init__.py                                                                                         2      0   100%
normalization/destination_type.py                                                                                                  13      0   100%
normalization/__init__.py                                                                                                           4      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py     124      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/__init__.py               1      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/__init__.py                      2      0   100%
normalization/transform_catalog/destination_name_transformer.py                                                                   155      5    97%
normalization/transform_catalog/stream_processor.py                                                                               524     39    93%
normalization/transform_catalog/catalog_processor.py                                                                              143     12    92%
normalization/transform_catalog/table_name_registry.py                                                                            174     51    71%
normalization/transform_config/transform.py                                                                                       168     57    66%
normalization/transform_catalog/transform.py                                                                                       45     30    33%
---------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                            1403    194    86%

@pmossman
Copy link
Contributor Author

pmossman commented Apr 8, 2022

/publish connector=bases/base-normalization

🕑 bases/base-normalization https://github.com/airbytehq/airbyte/actions/runs/2117584724
❌ Failed to publish bases/base-normalization
❌ Couldn't auto-bump version for bases/base-normalization
🕑 bases/base-normalization https://github.com/airbytehq/airbyte/actions/runs/2117584724
❌ Failed to publish bases/base-normalization
❌ Couldn't auto-bump version for bases/base-normalization
🕑 bases/base-normalization https://github.com/airbytehq/airbyte/actions/runs/2117584724

@edgao
Copy link
Contributor

edgao commented Apr 9, 2022

/publish connector=bases/base-normalization

🕑 bases/base-normalization https://github.com/airbytehq/airbyte/actions/runs/2139122252
❌ Failed to publish bases/base-normalization
❌ Couldn't auto-bump version for bases/base-normalization
🕑 bases/base-normalization https://github.com/airbytehq/airbyte/actions/runs/2139122252
❌ Failed to publish bases/base-normalization
❌ Couldn't auto-bump version for bases/base-normalization
🕑 bases/base-normalization https://github.com/airbytehq/airbyte/actions/runs/2139122252
🚀 Successfully published bases/base-normalization
❌ Couldn't auto-bump version for bases/base-normalization

@edgao
Copy link
Contributor

edgao commented Apr 9, 2022

@Phlair It looks like the last publish run failed in "Check if connector definition is in definitions.yaml" - I'm guessing this is because normalization isn't actually tracked in there? I.e. this PR should be ready to merge without further intervention?

@Phlair
Copy link
Contributor

Phlair commented Apr 10, 2022

@edgao correct, good to merge, no auto-bump for normalization (yet). This makes me think the automated comments could be clearer since this shouldn't look like a fail.

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Apr 10, 2022
Copy link
Contributor

@edgao edgao left a comment

Choose a reason for hiding this comment

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

@pmossman I added an entry to the changelog; if that looks right to you then we should be good to merge here!

@edgao edgao temporarily deployed to more-secrets April 10, 2022 04:08 Inactive
@edgao edgao temporarily deployed to more-secrets April 10, 2022 04:08 Inactive
@pmossman
Copy link
Contributor Author

Thanks so much @edgao for all your help getting this over the finish line! Changelog looks good, going to merge this now

@pmossman pmossman merged commit dfd25f0 into master Apr 11, 2022
@pmossman pmossman deleted the parker/unrevert-tmp-dir branch April 11, 2022 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Improvements or additions to documentation area/platform issues related to the platform area/worker Related to worker normalization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants