forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added k9s as integrated tool to help with kubernetes testing (apache#…
…12163) The K9s is fantastic tool that helps to debug a running k8s instance. It is terminal-based windowed CLI that makes you several times more productive comparing to using kubectl commands. We've integrated k9s (it is run as a docker container and downloaded on demand). We've also separated out KUBECONFIG of the integrated kind cluster so that it does not mess with kubernetes configuration you might already have. Also - together with that the "surrounding" of the kubernetes tests were simplified and improved so that the k9s integration can be utilized well. Instead of kubectl port forwarding (which caused multitude of problems) we are now utilizing kind's portMapping feature + custom NodePort resource that maps port 8080 to 30007 NodePort which in turn maps it to 8080 port of the Webserver. This way we do not have to establish an external kubectl port forward which is prone to error and management - everything is brought up when Airflow gets deployed to the Kind Cluster and shuts down when the Kind cluster is stopped. Yet another problem fixed was killing of postgres by one of the kubernetes tests ('test_integration_run_dag_with_scheduler_failure'). Instead of just killing the scheduler it killed all pods - including the Postgres one (it was named 'airflow-postgres.*'). That caused various problems, as the database could be left in a strange state. I changed the tests to do what it claimed was doing - so killing only the scheduler during the test. This seemed to improve the stability of tests immensely in my local setup.
- Loading branch information
Showing
19 changed files
with
294 additions
and
109 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -765,23 +765,14 @@ jobs: | |
python-version: ${{ env.PYTHON_MAJOR_MINOR_VERSION }} | ||
- name: "Free space" | ||
run: ./scripts/ci/tools/ci_free_space_on_ci.sh | ||
- name: "Setup Kind Cluster ${{ env.KIND_VERSION }}" | ||
uses: engineerd/[email protected] | ||
with: | ||
version: "${{ env.KIND_VERSION }}" | ||
name: airflow-python-${{matrix.python-version}}-${{matrix.kubernetes-version}} | ||
config: "scripts/ci/kubernetes/kind-cluster-conf.yaml" | ||
- name: "Prepare PROD Image" | ||
run: ./scripts/ci/images/ci_prepare_prod_image_on_ci.sh | ||
- name: "Deploy airflow to cluster" | ||
id: deploy-app | ||
run: ./scripts/ci/kubernetes/ci_deploy_app_to_kubernetes.sh | ||
- name: "Setup cluster and deploy Airflow" | ||
id: setp-cluster-deploy-app | ||
run: ./scripts/ci/kubernetes/ci_setup_cluster_and_deploy_airflow_to_kubernetes.sh | ||
env: | ||
# We have the right image pulled already by the previous step | ||
SKIP_BUILDING_PROD_IMAGE: "true" | ||
# due to some instabilities, in CI we try to increase port numbers when trying to establish | ||
# port forwarding | ||
INCREASE_PORT_NUMBER_FOR_KUBERNETES: "true" | ||
- name: "Cache virtualenv for kubernetes testing" | ||
uses: actions/cache@v2 | ||
env: | ||
|
@@ -798,7 +789,7 @@ jobs: | |
key: "${{ env.cache-name }}-${{ github.job }}-${{ hashFiles('setup.py') }}\ | ||
-${{ needs.build-info.outputs.defaultKindVersion }}\ | ||
-${{ needs.build-info.outputs.defaultHelmVersion }}\ | ||
-$${{ matrix.kubernetes-version }}" | ||
-${{ matrix.kubernetes-version }}" | ||
- name: "Kubernetes Tests" | ||
run: ./scripts/ci/kubernetes/ci_run_kubernetes_tests.sh | ||
- name: "Upload KinD logs" | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.