-
Notifications
You must be signed in to change notification settings - Fork 170
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
Run some example in Kubernetes execution mode in CI #1127
Conversation
✅ Deploy Preview for sunny-pastelito-5ecb04 canceled.
|
a6c8d3f
to
5295e8e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1127 +/- ##
=======================================
Coverage 96.37% 96.37%
=======================================
Files 64 64
Lines 3424 3424
=======================================
Hits 3300 3300
Misses 124 124 ☔ View full report in Codecov by Sentry. |
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 looks great, @pankajastro , really happy this is automated, it will save us lots of time!
New Features * Add support for loading manifest from cloud stores using Airflow Object Storage by @pankajkoti in #1109 * Cache ``package-lock.yml`` file by @pankajastro in #1086 * Support persisting the ``LoadMode.VIRTUALENV`` directory by @tatiana in #1079 * Add support to store and fetch ``dbt ls`` cache in remote stores by @pankajkoti in #1147 * Add default source nodes rendering by @arojasb3 in #1107 * Add Teradata ``ProfileMapping`` by @sc250072 in #1077 Enhancements * Add ``DatabricksOauthProfileMapping`` profile by @CorsettiS in #1091 * Use ``dbt ls`` as the default parser when ``profile_config`` is provided by @pankajastro in #1101 * Add task owner to dbt operators by @wornjs in #1082 * Extend Cosmos custom selector to support + when using paths and tags by @mvictoria in #1150 * Simplify logging by @dwreeves in #1108 Bug fixes * Fix Teradata ``ProfileMapping`` target invalid issue by @sc250072 in #1088 * Fix empty tag in case of custom parser by @pankajastro in #1100 * Fix ``dbt deps`` of ``LoadMode.DBT_LS`` should use ``ProjectConfig.dbt_vars`` by @tatiana in #1114 * Fix import handling by lazy loading hooks introduced in PR #1109 by @dwreeves in #1132 * Fix Airflow 2.10 regression and add Airflow 2.10 in test matrix by @pankajastro in #1162 Docs * Fix typo in azure-container-instance docs by @pankajastro in #1106 * Use Airflow trademark as it has been registered by @pankajastro in #1105 Others * Run some example DAGs in Kubernetes execution mode in CI by @pankajastro in #1127 * Install requirements.txt by default during dev env spin up by @@CorsettiS in #1099 * Remove ``DbtGraph.current_version`` dead code by @tatiana in #1111 * Disable test for Airflow-2.5 and Python-3.11 combination in CI by @pankajastro in #1124 * Pre-commit hook updates in #1074, #1113, #1125, #1144, #1154, #1167 --------- Co-authored-by: Pankaj Koti <[email protected]> Co-authored-by: Pankaj Singh <[email protected]>
Description
Migrate example from cosmos-example
The cosmos-example repository currently contains several examples, including those that run in Kubernetes execution mode. This setup has made testing local changes in Kubernetes execution mode challenging and keeping the documentation up-to-date is also not easy. Therefore, it makes sense to migrate the Kubernetes examples from cosmos-example to this repository. This PR resolved the below issue in this regard
I also adjusted both the example DAG and Dockerfile to work within this repository.
Automate running locally
I introduce some scripts to make running Kubernetes DAG easy.
postgres-deployment.yaml: Kubernetes resource file for spinning up PostgreSQL and creating Kubernetes secrets.
integration-kubernetes.sh: Runs the Kubernetes DAG using pytest.
kubernetes-setup.sh:
Run DAG locally
Prerequisites:
Steps:
kind create cluster
scripts/test/kubernetes-setup.sh
(This will set up PostgreSQL and load the DBT project into the local registry)cd dev && scripts/test/integration-kubernetes.sh
this will execute this DAG with a pytest you can also run directly with airflow command given that project is installed in your virtual envRun jaffle_shop_kubernetes in CI
To avoid regression we have automated running the jaffle_shop_kubernetes in CI
Documentation changes
Given that the DAG jaffle_shop_kubernetes is now part of this repository, I have automated the example rendering for Kubernetes execution mode. This ensures that we avoid displaying outdated example code.
https://astronomer.github.io/astronomer-cosmos/getting_started/execution-modes.html#kubernetes
https://astronomer.github.io/astronomer-cosmos/getting_started/kubernetes.html#kubernetes
Future work
GH issue for future improvement: #1160
Example CI Run
Related Issue(s)
closes: #535
Breaking Change?
No
Checklist