1291 Commits

Author SHA1 Message Date
Jarek Potiuk
496ed6f1b2 Reorganizing of CI tests (#9654)
* we come back to idea of having one CI workflow
* cancel and openapi are incorporated into that CI workflow
* cancel retrieves workflow id automatically (works for forks)
* static checks are now merged into one job
* less dependencies between jobs so that waiting is minimised
* better name for check if tests should be run
* separated out script for tests should be run check
2020-07-17 10:30:56 +02:00
Jarek Potiuk
faec41ec9a Group CI scripts in subdirectories (#9653)
Reviewed the scripts and removed some of the old unused ones.
2020-07-16 18:05:35 +02:00
James Timmins
0aea648b4b Skip one version of Python for each test.
Skip one version of Python for each test.
2020-07-08 22:26:07 +02:00
QP Hou
6c158853ae generate go client from openapi spec (#9502)
* generate go client from openapi spec

* move openapi codegen to seperate workflow
2020-07-07 19:48:28 +02:00
Jarek Potiuk
72abf824ce Tests should also be triggered when there is just setup.py change (#9690)
So far tests were not triggered when only requirements changed,
but this is quite needed in fact.
2020-07-06 20:41:35 +02:00
Aneesh Joseph
d93555b863 Add git sync option and unit tests for the Helm chart (#9371)
* add git sync sidecars

* add a helm test

* add more tests

* allow users to provide git username and pass via  a k8s secrets

* set default values for airflow worker repository & tag

* change ci timeout

* fix link

* add credentials_secret to airflow.cfg configmap

* set GIT_SYNC_ADD_USER on kubernetes worker pods, set uid

* add fsGroup to webserver and kubernete workers

* move gitSync to dags.gitSync

* rename valueFields

* turn off git sync and dag persistence by default

* provide option to specify known_hosts

* add git-sync details into the chart documentation

* Update .gitignore

Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>

* make git sync max failures configurable

* Apply suggestions from code review

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>

* add back requirements.lock

Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
2020-07-05 12:57:15 -07:00
Jarek Potiuk
5e4b801b32 Test are triggered now on more changes. (#9646)
Sometimes tests were not triggered when they should be.
This change will cause the tests to be triggered when anything
changes in "airflow" or "charts" additionally to what we had
before.
2020-07-03 23:50:57 +02:00
Jarek Potiuk
8bd15ef634 Switches to Helm Chart for Kubernetes tests (#9468)
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>
2020-07-01 14:50:30 +02:00
Jarek Potiuk
6aabd9a86e More sensible docker caching strategy for Prod images (#9547)
Local caching is now default strategy when building
the Production image.

You can still change it to pulled - similar to CI builds
by providing the right build flag and this is what
is used in CI by default. The flags in Breeze are now updated
to be more eplanatory and friendly (build-cache-*) and a flag
for "disabled" cache option is added as well.

Also the Dockerfile and Dockerfile.ci files are not needed
any more in the docker context. They used to be needed when
we built the Kubernetes image in the container, but since
we are now using production image directly - we do not need
them any nmore.

Combining setting the default strategy to local and removing
the Dockerfile from the context has the nice effect that you
can iterate much faster on the Production image without
triggering rebuilds of half of the docker image
as soon as the Dockerfile changes.
2020-06-28 17:38:17 +02:00
Kaxil Naik
c420dbd6e1 Bump Pylint to 2.5.3 (#9294) 2020-06-27 18:19:21 +01:00
Kaxil Naik
d12db77ffc Cancel queued/running builds on second push to PR (#9513)
We need to Cancel builds on PRs too.
2020-06-25 13:14:26 +01:00
Jarek Potiuk
7c12a9d4e0 Improve production image iteration speed (#9162)
For a long time the way how entrypoint worked in ci scripts
was wrong. The way it worked was convoluted and short of black
magic. This did not allow to pass multiple test targets and
required separate execute command scripts in Breeze.

This is all now straightened out and both production and
CI image are always using the right entrypoint by default
and we can simply pass parameters to the image as usual without
escaping strings.

This also allowed to remove some breeze commands and
change names of several flags in Breeze to make them more
meaningful.

Both CI and PROD image have now embedded scripts for log
cleaning.

History of image releases is added for 1.10.10-*
alpha quality images.
2020-06-16 12:36:46 +02:00
Kaxil Naik
a38c35a47f Use actions/cache@v2 (#9293)
We upgraded to v2 in https://github.com/apache/airflow/pull/8265 for other places in `.github/workflows/ci.yml`. This was left, so fixing it.
2020-06-14 23:04:47 +02:00
Ash Berlin-Taylor
9c82c5b21b Upload kind logs to Github Actions artifact (#9230)
* Upload kind logs to Github Artifacts

* get_ci_environment needed to correctly dump kind logs

Without this the "setup cluster" step dumps the logs as
`kind_logs_2020-06-11_default_default.tar.gz`

Since this is now used outside of just building images, I have moved the
function to _initialization.sh

* Github already compresses artifacts for download.

If we upload a .tar.gz, the download is a .zip file containing that
.tar.gz, which isn't ideal

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
2020-06-11 16:00:27 +01:00
Ash Berlin-Taylor
c7236376ec Disable KIND git-sync tests for now (#9229)
There is some DNS problem causing it to be unable to resolve github.com
in the container.

To unblock tests we are disabling the git-sync mode tests for the
moment.
2020-06-11 11:34:30 +01:00
James Timmins
5918efc86a Add 3.8 to the test matrices (#8836) 2020-06-05 18:39:28 +01:00
Jarek Potiuk
92d68807f3 Split utils sh (#9132)
* Split _utils.sh into separate files
2020-06-04 22:12:56 +02:00
Jarek Potiuk
ff5dcccbbd Kubernetes Cluster is started on host not in the container (#8265)
Tests requiring Kubernetes Cluster are now moved out of
the regular CI tests and moved to "kubernetes_tests" folder
so that they can be run entirely on host without having
the CI image built at all. They use production image
to run the tests on KinD cluster and we add tooling
to start/stop/deploy the application to the KinD cluster
automatically - for both CI testing and local development.

This is a pre-requisite to convert the tests to convert the
tests to use the official Helm Chart and Docker images or
Apache Airflow.

It closes #8782
2020-06-03 20:58:38 +02:00
Jarek Potiuk
a6216a760c You can push with Breeze as separate command and to cache (#8976)
Breeze had --push-images switch to also push images to repo
but it was often needed to build and push images separately.

We have now a possibility to push an already built image with
separate push-image command instead and also you can choose
to push to cache registry in GitHub rather than to DockerHub
with --registry-cache switch.
2020-06-02 10:24:47 +02:00
Daniel Imberman
e4d811db86 Use production image for k8s tests (#9038)
* Use production image for k8s tests

The CI image has become too large to load into KinD,

it also only really makes sense to use the production image for
integration tests

* nit

Co-authored-by: Daniel Imberman <daniel@astronomer.io>
2020-05-28 07:11:37 -07:00
Ash Berlin-Taylor
dd1bfccf3c Cancel queued/running builds on second push to PR (#9050)
This uses an action from the marketplace to cancel any running builds
for our main "CI" workflow (the only one we have at the moment)
2020-05-28 13:05:45 +01:00
Daniel Imberman
90a07d8184 Cache 1 10 ci images (#8955)
* Push CI images to Docker packcage cache for v1-10 branches

This is done as a commit to master so that we can keep the two branches
in sync

Co-Authored-By: Ash Berlin-Taylor <ash_github@firemirror.com>

* Run Github Actions against v1-10-stable too

Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>
2020-05-21 13:20:29 -07:00
Jarek Potiuk
41481bb402 Python base images are stored in cache (#8943)
All PRs will used cached "latest good" version of the python
base images from our GitHub registry. The python versions in
the Github Registry will only get updated after a master
build (which pulls latest Python image from DockerHub) builds
and passes test correctly.

This is to avoid problems that we had recently with Python
patchlevel releases breaking our Docker builds.
2020-05-21 13:39:07 +02:00
Ash Berlin-Taylor
51d955787b Re-run all tests when Dockerfile or Github worflow change (#8924)
Fixes #8921
2020-05-20 18:49:28 +01:00
Jarek Potiuk
a3a3411838 Fix master failing on generating requirements (#8885)
By default github actions checks out only latest commit but in order to
see if there are any changes since the last readme generated
we need to see the whole history so we need to fetch it all.

We also skip generating the new README in case there is only one
commit in the history since the last release. The nature of readme
generation is that the commit with the README itself will never
be in the list of commits for the previous release so there is
always at least one commit more than the one listed in the readme.
2020-05-16 12:53:30 +02:00
Jarek Potiuk
4a1d71d23d Fix the process of requirements generations (#8648)
Right now requirements will be only checked during the
CI build if the setup.py has changed and if yes, clear instructions
will be given. The diff will still be printed otherwise but
it will not cause the job to fail
2020-04-30 18:39:38 +02:00
Jarek Potiuk
3c4ca62af1 Building backport packages is now done inside Breeze container (#8558)
This way you do not have to worry about setting up your environment.

Fixes #8537
2020-04-26 12:35:27 +02:00
Jarek Potiuk
0de597f95f The CRON job now is working and triggers builds on DockerHub (#8549)
The CRON job from previous runs did not have everything working
after the emergency migration to Github Actions.

This change brings back following improvements:

* rebuilding images from the scratch in CRON job
* automatically upgrading all requirements to test if they are new
* pushing production images to github packages as cache
* pushing nightly tag to github
2020-04-26 00:33:39 +02:00
Jarek Potiuk
ffcbb22c93 Move some tests to quarantine (#8511) 2020-04-23 08:51:56 +02:00
Jarek Potiuk
e11a838ee1 Optimize GitLab CI configuration (#8499)
* tests are not executed for doc-only changes
* images will be (once merged) downloaded from GitHub Registry so likely much faster
* we have a "scheduled" nightly build that will build everything from scratch and check if no requirements have been broken
* improved split of static checks between two static check jobs - to utilise parallelism better.
* reorganised some fast jobs (requirements, prod image) that do not depend on tests so that they can run earlier
* shorter names for jobs so that they are nicer to view in the actions view
* matrix definitions of the jobs so that we can manage them better
2020-04-23 01:11:25 +02:00
Jarek Potiuk
887dea35d1 Add support for caching of image in GitHub's registry (#8497) 2020-04-22 16:08:58 +02:00
Kaxil Naik
d97e5eed7e Add a dedicated "free disk space" step to fix CI (#8426) 2020-04-17 13:21:21 +01:00
Jarek Potiuk
84bc527879 Move backport packages to GA (#8391) 2020-04-16 07:46:32 +02:00
Tomek Urbaszek
a266497f3a Use Github Actions to run CI (#8376)
* Use Github Actions to run CI

* Fix backports build
2020-04-15 13:03:14 -07:00
Kaxil Naik
8e94dca61a [AIRFLOW-XXXX] Remove Github action to add label (#7055) 2020-01-05 02:49:43 +00:00
Jarek Potiuk
6a22219f07 [AIRFLOW-XXXX] Decrease frequency of PR labelling Github Action (#7048)
With the current frequency we are going to exhaust our 2000 free
minutes in about 10 days. We should decrease the frequency quickly.
2020-01-04 22:44:08 +01:00
Jarek Potiuk
592284a7e4 [AIRFLOW-XXXX] Used fixed periodic auto-labeler from potiuk's repo (#7047)
The periodic labeler had a bug that it was not using pagination.
In effect the labeler was checking only 30 oldest request and
if they all contained proper labels, it was not checking any more
PRs.

Details are available in
https://github.com/paulfantom/periodic-labeler/pull/4

But until it is merged, we switch to our own fixed version.
2020-01-04 22:43:39 +01:00
Kaxil Naik
24ad3edd02 [AIRFLOW-XXXX] Fix Path for Github Action (#7040) 2020-01-04 12:44:12 +01:00
Kaxil Naik
3d82e8cf6a [AIRFLOW-6449] Remove Github actions until a known bug is fixed (#7035) 2020-01-04 02:22:30 +00:00
Kaxil Naik
e864e37897 [AIRFLOW-6446] Add Github Action to Welcome First time contributors (#7031)
* [AIRFLOW-6446] Add Github actions to Welcome First time contributors

* Update the welcome message
2020-01-03 16:07:55 -08:00
Kaxil Naik
e9ebe7a119 [AIRFLOW-6447] Add GitHub Action to add Labels on Pull Requests (#7032) 2020-01-03 15:18:11 -08:00