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

Switches to Helm Chart for Kubernetes tests #9468

Merged

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Jun 21, 2020

Switches to Helm Chart for Kubernetes tests

The Kubernetes tests are now run using Helm chart
rather than the custom templates we used to have.

The Helm Chart uses locally build production image
so the tests are testing not only Airflow but also
Helm Chart and a Production image - all at the
same time. Later on we will add more tests
covering more functionalities of both Helm Chart
and Production Image. This is the first step to
get all of those bundle together and become
testable.

This change introduces also 'shell' sub-command
for Breeze's kind-cluster command and
EMBEDDED_DAGS build args for production image -
both of them useful to run the Kubernetes tests
more easily - without building two images
and with an easy-to-iterate-over-tests
shell command - which works without any
other development environment.


Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Unit tests coverage for changes (not needed for documentation changes)
  • Target Github ISSUE in description if exists
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.

@potiuk potiuk force-pushed the switch-kubernetes-tests-to-helm-chart branch 2 times, most recently from 4aa3182 to 1466cc2 Compare June 25, 2020 12:16
@potiuk potiuk marked this pull request as ready for review June 25, 2020 16:30
@potiuk
Copy link
Member Author

potiuk commented Jun 25, 2020

Hey @dimberman @ashb @kaxil -> I managed to get all the kubernetes tests working using the helm chart :) (with lots of @dimberman's help) . I got rid of all the "templates" from the old tests.

The problems that prevented the tests to run turned to be simple: missing custom "resource + resource claim" for two of the tests and the fact that it takes a few seconds for the webserver to start and I had to add a loop to test if it is up when I setup port-forwarding. That seems to fix all the problems - and we can start adding more tests for kubernetes installation now.

I also added more logs for the tests and breeze's "kind-cluster shell' command that drops you to shell where you can run kubernetes tests...

Looking forward to merging it (I will cherry-pick to 1.10 right after)

@potiuk potiuk force-pushed the switch-kubernetes-tests-to-helm-chart branch 2 times, most recently from 2e6978f to 9b0d480 Compare June 26, 2020 14:14
@potiuk potiuk force-pushed the switch-kubernetes-tests-to-helm-chart branch 2 times, most recently from e3ff9fe to c3b7974 Compare June 28, 2020 15:48
@potiuk potiuk changed the title Switched to Helm chart for Kubernetes tests Switches to Helm Chart for Kubernetes tests Jun 28, 2020
@potiuk potiuk force-pushed the switch-kubernetes-tests-to-helm-chart branch 5 times, most recently from 13c95dc to cba3e31 Compare June 28, 2020 15:58
@potiuk potiuk requested review from dimberman, kaxil, ashb and mik-laj June 28, 2020 15:59
@potiuk
Copy link
Member Author

potiuk commented Jun 28, 2020

I believe this one should succeed in the CI as well as locally with Breeze and it will make it much easier to iterate on future changes to both - image and helm chart!

@@ -108,6 +108,7 @@ def start_pod(
curr_time = dt.now()
if resp.status.start_time is None:
while self.pod_not_started(pod):
self.log.warning("Pod not yet started: %s", pod.metadata.name)
Copy link
Member

Choose a reason for hiding this comment

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

Should we remove log print on 116?
Screenshot 2020-06-28 at 18 15 36

@potiuk potiuk force-pushed the switch-kubernetes-tests-to-helm-chart branch 3 times, most recently from a04338d to 2199d3c Compare June 30, 2020 17:20
@dimberman
Copy link
Contributor

@potiuk CI passed :)

The Kubernetes tests are now run using Helm chart
rather than the custom templates we used to have.

The Helm Chart uses locally build production image
so the tests are testing not only Airflow but also
Helm Chart and a Production image - all at the
same time. Later on we will add more tests
covering more functionalities of both Helm Chart
and Production Image. This is the first step to
get all of those bundle together and become
testable.

This change introduces also 'shell' sub-command
for Breeze's kind-cluster command and
EMBEDDED_DAGS build args for production image -
both of them useful to run the Kubernetes tests
more easily - without building two images
and with an easy-to-iterate-over-tests
shell command - which works without any
other development environment.

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Daniel Imberman <daniel@astronomer.io>
@potiuk potiuk force-pushed the switch-kubernetes-tests-to-helm-chart branch from 2199d3c to 962865b Compare July 1, 2020 10:53
@potiuk potiuk merged commit 8bd15ef into apache:master Jul 1, 2020
@potiuk potiuk deleted the switch-kubernetes-tests-to-helm-chart branch July 1, 2020 12:50
potiuk added a commit that referenced this pull request Jul 1, 2020
The Kubernetes tests are now run using Helm chart
rather than the custom templates we used to have.

The Helm Chart uses locally build production image
so the tests are testing not only Airflow but also
Helm Chart and a Production image - all at the
same time. Later on we will add more tests
covering more functionalities of both Helm Chart
and Production Image. This is the first step to
get all of those bundle together and become
testable.

This change introduces also 'shell' sub-command
for Breeze's kind-cluster command and
EMBEDDED_DAGS build args for production image -
both of them useful to run the Kubernetes tests
more easily - without building two images
and with an easy-to-iterate-over-tests
shell command - which works without any
other development environment.

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Daniel Imberman <daniel@astronomer.io>
(cherry picked from commit 8bd15ef)
@potiuk potiuk added this to the Airflow 1.10.11 milestone Jul 1, 2020
kaxil pushed a commit that referenced this pull request Jul 2, 2020
The Kubernetes tests are now run using Helm chart
rather than the custom templates we used to have.

The Helm Chart uses locally build production image
so the tests are testing not only Airflow but also
Helm Chart and a Production image - all at the
same time. Later on we will add more tests
covering more functionalities of both Helm Chart
and Production Image. This is the first step to
get all of those bundle together and become
testable.

This change introduces also 'shell' sub-command
for Breeze's kind-cluster command and
EMBEDDED_DAGS build args for production image -
both of them useful to run the Kubernetes tests
more easily - without building two images
and with an easy-to-iterate-over-tests
shell command - which works without any
other development environment.

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Daniel Imberman <daniel@astronomer.io>
(cherry picked from commit 8bd15ef)
kaxil pushed a commit that referenced this pull request Jul 13, 2020
The Kubernetes tests are now run using Helm chart
rather than the custom templates we used to have.

The Helm Chart uses locally build production image
so the tests are testing not only Airflow but also
Helm Chart and a Production image - all at the
same time. Later on we will add more tests
covering more functionalities of both Helm Chart
and Production Image. This is the first step to
get all of those bundle together and become
testable.

This change introduces also 'shell' sub-command
for Breeze's kind-cluster command and
EMBEDDED_DAGS build args for production image -
both of them useful to run the Kubernetes tests
more easily - without building two images
and with an easy-to-iterate-over-tests
shell command - which works without any
other development environment.

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Daniel Imberman <daniel@astronomer.io>
(cherry picked from commit 8bd15ef)
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
The Kubernetes tests are now run using Helm chart
rather than the custom templates we used to have.

The Helm Chart uses locally build production image
so the tests are testing not only Airflow but also
Helm Chart and a Production image - all at the
same time. Later on we will add more tests
covering more functionalities of both Helm Chart
and Production Image. This is the first step to
get all of those bundle together and become
testable.

This change introduces also 'shell' sub-command
for Breeze's kind-cluster command and
EMBEDDED_DAGS build args for production image -
both of them useful to run the Kubernetes tests
more easily - without building two images
and with an easy-to-iterate-over-tests
shell command - which works without any
other development environment.

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Daniel Imberman <daniel@astronomer.io>
(cherry picked from commit 8bd15ef)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants