Граф коммитов

100 Коммитов

Автор SHA1 Сообщение Дата
Jarek Potiuk 4e09cb53ea
Add packages to function names in bash (#10670) (#10696)
Inspired by the Google Shell Guide where they mentioned
separating package names with :: I realized that this was
one of the missing pieces in the bash scripts of ours.

While we already had packages (in libraries folders)
it's been difficult to realise which function is where.

With introducing packages - equal to the library file name
we are *almost* at a level of a structured language - and
it's easier to find the functions if you are looking for them.

Way easier in fact.

Part of #10576

(cherry picked from commit cc551ba793)
(cherry picked from commit 2bba276f0f06a5981bdd7e4f0e7e5ca2fe84f063)
2020-09-02 21:58:37 +02:00
Jarek Potiuk 649ce4ba9d
Implement Google Shell Conventions for breeze script (#10695)
* Implement Google Shell Conventions for breeze script … (#10651)

Part of #10576

First (and the biggest of the series of commits to introduce
Google Shell Conventions in our bash scripts.

This is about the biggest and the most complex breeze script
so it is rather huge but it is difficult to split it into
smaller pieces.

The rules implemented (from the conventions):

 * constants and exported variables are CAPITALIZED, where
   local/temporary variables are lowercase

 * following the shell guide, once all the variables are set to their
   final values (either from exported variables, calculation or --switches
   ) I have a single function that makes all the variables read-only. That
   helped to clean-up a lot of places where same functions was called
   several times, or where variables were defined in a few places. Now the
   behavior should be rather consistent and we should easily catch some
   duplications

 * function headers (following the guide) explaining arguments,
   variables expected, variables modified in the functions used.

 * setting the variables as read-only also helped to clean-up the "ifs"
   where we often had ":=}" in variables and != "" or == "". Those are
   replaced with `=}` and tests are replaced with `-n` and `-z` - also
   following the shell guide (readonly helped to detect and clean all
   such cases). This also should be much more robust in the future.

 * reorganized initialization of those constants and variables - simplified
   a few places where initialization was overlapping. It should be much more
   straightforward and clean now

 * a number of internal function breeze variables are "local" - this is
   helpful in accidental variables overwriting and keeping stuff localized

 * trap_add function is separated out to help in cases where we had
   several traps handling the same signals.

(cherry picked from commit 46c8d6714c)
(cherry picked from commit c822fd7b4bf2a9c5a9bb3c6e783cbea9dac37246)

* fixup! Implement Google Shell Conventions for breeze script … (#10651)
2020-09-02 21:55:50 +02:00
Kaxil Naik 9a10f83ab0
Revert recent breeze changes (#10651 & #10670) (#10694)
* Revert "Add packages to function names in bash (#10670)"

This reverts commit cc551ba793.

* Revert "Implement Google Shell Conventions for breeze script … (#10651)"

This reverts commit 46c8d6714c.
2020-09-02 17:27:36 +01:00
Jarek Potiuk cc551ba793
Add packages to function names in bash (#10670)
Inspired by the Google Shell Guide where they mentioned
separating package names with :: I realized that this was
one of the missing pieces in the bash scripts of ours.

While we already had packages (in libraries folders)
it's been difficult to realise which function is where.

With introducing packages - equal to the library file name
we are *almost* at a level of a structured language - and
it's easier to find the functions if you are looking for them.

Way easier in fact.

Part of #10576
2020-09-01 13:40:06 +02:00
Jarek Potiuk 46c8d6714c
Implement Google Shell Conventions for breeze script … (#10651)
Part of #10576

First (and the biggest of the series of commits to introduce
Google Shell Conventions in our bash scripts.

This is about the biggest and the most complex breeze script
so it is rather huge but it is difficult to split it into
smaller pieces.

The rules implemented (from the conventions):

 * constants and exported variables are CAPITALIZED, where
   local/temporary variables are lowercase

 * following the shell guide, once all the variables are set to their
   final values (either from exported variables, calculation or --switches
   ) I have a single function that makes all the variables read-only. That
   helped to clean-up a lot of places where same functions was called
   several times, or where variables were defined in a few places. Now the
   behavior should be rather consistent and we should easily catch some
   duplications

 * function headers (following the guide) explaining arguments,
   variables expected, variables modified in the functions used.

 * setting the variables as read-only also helped to clean-up the "ifs"
   where we often had ":=}" in variables and != "" or == "". Those are
   replaced with `=}` and tests are replaced with `-n` and `-z` - also
   following the shell guide (readonly helped to detect and clean all
   such cases). This also should be much more robust in the future.

 * reorganized initialization of those constants and variables - simplified
   a few places where initialization was overlapping. It should be much more
   straightforward and clean now

 * a number of internal function breeze variables are "local" - this is
   helpful in accidental variables overwriting and keeping stuff localized

 * trap_add function is separated out to help in cases where we had
   several traps handling the same signals.
2020-08-31 13:24:53 +02:00
Jarek Potiuk c320d99c4b
Small fixes in Breeze/Static check/docs documentation (#10658) 2020-08-31 12:46:39 +02:00
Kamil Breguła 2ca615cffe
Update Google Cloud branding (#10642) 2020-08-29 23:36:52 +02:00
Kaxil Naik bb3e45c250
Add Airflow 1.10.12 & 'black' to breeze-complete (#10592) 2020-08-27 10:10:08 +02:00
Tomek Urbaszek 7dd6e73414
Mount gcloud kubeconifg to breeze (#10439)
* Mount gcloud kubeconifg to breeze

* Update scripts/ci/docker-compose/forward-credentials.yml

Co-authored-by: Tomek Urbaszek <tomasz.urbaszek@polidea.com>

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
2020-08-21 21:22:32 +02:00
Jarek Potiuk de7500de84
CI Images are now pre-build and stored in registry (#10368)
* CI Images are now pre-build and stored in registry

With this change we utilise the latest pull_request_target
event type from Github Actions and we are building the
CI image only once (per version) for the entire run.

This safes from 2 to 10 minutes per job (!) depending on
how much of the Docker image needs to be rebuilt.

It works in the way that the image is built only in the
build-or-wait step. In case of direct push run or
scheduled runs, the build-or-wait step builds and pushes
to the GitHub registry the CI image. In case of the
pull_request runs, the build-and-wait step waits until
separate build-ci-image.yml workflow builds and pushes
the image and it will only move forward once the image
is ready.

This has numerous advantages:

1) Each job that requires CI image is much faster because
   instead of pulling + rebuilding the image it only pulls
   the image that was build once. This saves around 2 minutes
   per job in regular builds but in case of python patch level
   updates, or adding new requirements it can save up to 10
   minutes per job (!)

2) While the images are buing rebuilt we only block one job waiting
   for all the images. The tests will start running in parallell
   only when all images are ready, so we are not blocking
   other runs from running.

3) Whole run uses THE SAME image. Previously we could have some
   variations because the images were built at different times
   and potentially releases of dependencies in-between several
   jobs could make different jobs in the same run use slightly
   different image. This is not happening any more.

4) Also when we push image to github or dockerhub we push the
   very same image that was built and tested. Previously it could
   happen that the image pushed was slightly different than the
   one that was used for testing (for the same reason)

5) Similar case is with the production images. We are now building
   and pushing consistently the same images accross the board.

6) Documentation building is split into two parallel jobs docs
   building and spell checking - decreases elapsed time for
   the docs build.

7) Last but not least - we keep the history of al the images
   - those images contain SHA of the commit. This means
   that we can simply download and run the image locally to reproduce
   any problem that anyone had in their PR (!). This is super useful
   to be able to help others to test their problems.

* fixup! CI Images are now pre-build and stored in registry

* fixup! fixup! CI Images are now pre-build and stored in registry

* fixup! fixup! fixup! CI Images are now pre-build and stored in registry

* fixup! fixup! fixup! CI Images are now pre-build and stored in registry
2020-08-20 09:57:07 +02:00
Jarek Potiuk a32e90afde
Update github flags for Breeze (#10384)
Part of #10368
2020-08-19 00:53:04 +02:00
Jarek Potiuk 9228bf2bd0
You can disable spellcheck or documentation when building docs. (#10377)
This cleans up the document building process and replaces it
with breeze-only. The original instructions with
`pip install -e .[doc]` stopped working so there is no
point keeping them.

Extracted from #10368
2020-08-18 19:40:18 +02:00
Jarek Potiuk f76936f196
More informative description of Breeze's --verbose flag. (#10348) 2020-08-15 20:33:02 +02:00
Beni Ben zikry 24a951e8ed
Breeze / KinD - support earlier k8s versions, fix recreate and kubectl versioning (#9905) 2020-07-22 12:24:46 +02:00
Jarek Potiuk de9eaeb434
Constraint files are now maintained automatically (#9889)
* Constraint files are now maintained automatically

* No need to generate requirements when setup.py changes
* requirements are kept in separate orphan branches not in main repo
* merges to master verify if latest requirements are working and
  push tested requirements to orphaned branches
* we keep history of requirement changes and can label them
  individually for each version (by constraint-1.10.n tag name)
* consistently changed all references to be 'constraints' not
  'requirements'
2020-07-20 14:36:03 +02:00
Alexander Sutcliffe 64929eeb70
Added "all" to allowed breeze integrations and tried to clarify on fail (#9872) 2020-07-18 07:38:02 +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
Jarek Potiuk 56f7a2b6e6
Fix small errors in image building documentation (#9792) 2020-07-13 19:23:55 +02:00
Jarek Potiuk 74036a8401
Links Breeze documentation to new Breeze video (#9768) 2020-07-11 21:21:19 +02:00
Jarek Potiuk f3e1f9a313
Update Breeze documentation (#9608)
* Update Breeze documentation
2020-07-01 16:02:24 +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 1787057ad8
Add missing precommit-hook ids to breeze-complete (#9524) 2020-06-26 11:17:16 +02:00
Kaxil Naik b46de89a9e
Add pydocstyle to Breeze Autocomplete (#9462) 2020-06-21 10:29:02 +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
zikun 0682e784b1
Additional apt dependencies options in breeze (#9231) 2020-06-11 18:53:26 +02:00
Udit Chaudhary c18f4c035c
Fix typo in BREEZE.rst (#9199)
Changed 'y' to 'by' since it was incorrect.
2020-06-09 19:34:46 +01:00
Jarek Potiuk de9d3401f9
Improved cloud tool available in the trimmed down CI container (#9167)
* Improved cloud tool available in the trimmed down CI container

The tools now have shebangs which make them available for
python tools. Also /opt/airflow is now mounted from the
host Airflow sources which makes it possible for the tools to
copy files directly to/from the sources of Airflow.

It also contains one small change for Linux users - the files
created by docker gcloud are created with root user so in order to fix
that the directories mounted from the host are fixed when you exit
the tool - their ownership is changed to be owned by the host user
2020-06-09 09:33:16 +02:00
Ash Berlin-Taylor 6350fd6ebb
Don't use the term "whitelist" - language matters (#9174)
It's fairly common to say whitelisting and blacklisting to describe
desirable and undesirable things in cyber security. However just because
it is common doesn't mean it's right.

However, there's an issue with the terminology. It only makes sense if
you equate white with 'good, permitted, safe' and black with 'bad,
dangerous, forbidden'. There are some obvious problems with this.

You may not see why this matters. If you're not adversely affected by
racial stereotyping yourself, then please count yourself lucky. For some
of your friends and colleagues (and potential future colleagues), this
really is a change worth making.

From now on, we will use 'allow list' and 'deny list' in place of
'whitelist' and 'blacklist' wherever possible. Which, in fact, is
clearer and less ambiguous. So as well as being more inclusive of all,
this is a net benefit to our understandability.

(Words mostly borrowed from
<https://www.ncsc.gov.uk/blog-post/terminology-its-not-black-and-white>)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
2020-06-08 10:01:46 +01:00
James Timmins 5918efc86a
Add 3.8 to the test matrices (#8836) 2020-06-05 18:39:28 +01:00
Jarek Potiuk a39e9a3520
Replaces cloud-provider CLIs in CI image with scripts running containers (#9129)
The clis are replaced with scripts that will pull and run
docker images when they are needed.

Added Azure CLI as well.

Closes: #8946 #8947 #8785
2020-06-04 19:12:09 +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
Damian a85d228c72
Update Breeze Documentation to have WSL 2 Instructions instead of WSL 1 (#9057) 2020-06-01 09:04:31 +02:00
Jarek Potiuk 738667082d
Additional python extras and deps can be set in breeze (#9035)
Closes #8604
Closes #8866
2020-05-27 17:09:11 +02:00
Jarek Potiuk 00642a46d0
Fixed name of 20 remaining wrongly named operators. (#8994) 2020-05-26 19:12:21 +02:00
Jarek Potiuk 375d1ca229
Release candidate 2 for backport packages 2020.05.20 (#8898)
Release candidate 2 for backport packages 2020.05.20
2020-05-19 14:17:22 +02:00
Jarek Potiuk 92585ca4cb
Added automated release notes generation for backport operators (#8807)
We have now mechanism to keep release notes updated for the
backport operators in an automated way.

It really nicely generates all the necessary information:

* summary of requirements for each backport package
* list of dependencies (including extras to install them) when package
  depends on other providers packages
* table of new hooks/operators/sensors/protocols/secrets
* table of moved hooks/operators/sensors/protocols/secrets with
  information where they were moved from
* changelog of all the changes to the provider package (this will be
  automatically updated with incremental changelog whenever we decide to
  release separate packages.

The system is fully automated - we will be able to produce release notes
automatically (per-package) whenever we decide to release new version of
the package in the future.
2020-05-15 19:00:15 +02:00
Jarek Potiuk d5c4001f8d
Useful help information in test-target and docker-compose commands (#8796)
There was no useful information printed in test-target and
docker-compose commands. It's fixed now
2020-05-11 11:58:25 +02:00
Jarek Potiuk de453a6710
List of integrations is now maintained in one place. (#8496) 2020-04-22 14:38:56 +02:00
Jarek Potiuk bd7f63b39f
Get rid of Travis CI from the docs (#8488) 2020-04-21 17:27:09 +02:00
Felix Uellendall cf6c254ebd
Expose Airflow Webserver Port in Production Docker Image (#8228) 2020-04-15 13:05:02 +02:00
Jarek Potiuk 62a0396ddc
Help for breeze commands contain relevant flags. (#8261)
* Help for breeze commands contain relevant flags.

* fixup! Help for breeze commands contain relevant flags.

* fixup! fixup! Help for breeze commands contain relevant flags.
2020-04-13 08:51:33 +02:00
Jarek Potiuk 07fd0d71c8
Add Production Docker image support (#7832) 2020-04-02 18:52:11 +01:00
yajna pandith 11a4983bf9
Update BREEZE.rst (#8028)
Updating BREEZE.rst with minor grammatical corrections
2020-03-31 17:44:14 +02:00
Jarek Potiuk 88bfd37cc0
Install version is not persistent in breeze (#7914) 2020-03-28 11:03:52 +01:00
Jarek Potiuk 3fb5f1568c
Requirements now depend on python version (#7841) 2020-03-27 15:27:53 +01:00
Jarek Potiuk 210de87d6d
Move Dockerfile to Dockerfile.ci (#7829) 2020-03-23 08:56:26 +01:00
Jarek Potiuk 8c5638832f
[AIRFLOW-7067] Pinned version of Apache Airflow (#7730) 2020-03-22 13:34:48 +01:00
Kamil Breguła 029c84e552
[AIRFLOW-5421] Add Presto to GCS transfer operator (#7718) 2020-03-18 14:42:05 +01:00