Run some example in Kubernetes execution mode in CI#1127
Merged
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. |
d69b36a to
6984652
Compare
pankajastro
commented
Aug 15, 2024
pankajastro
commented
Aug 15, 2024
tatiana
approved these changes
Aug 15, 2024
Collaborator
tatiana
left a comment
There was a problem hiding this comment.
This looks great, @pankajastro , really happy this is automated, it will save us lots of time!
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 clusterscripts/test/kubernetes-setup.sh(This will set up PostgreSQL and load the DBT project into the local registry)cd dev && scripts/test/integration-kubernetes.shthis 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