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

39 Коммитов

Автор SHA1 Сообщение Дата
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 3aca396294
[AIRFLOW-7010] Skip in-container checks for Dockerhub builds (#7652) 2020-03-09 10:00:10 +01:00
Jarek Potiuk d18513ceb1
[AIRFLOW-5828] Move build logic out from hooks/build (#7618)
This is the final step of simplifying the Breeze scripts by
moving all the logic out from Travis' hooks/build
2020-03-07 16:09:06 +01:00
Jarek Potiuk 20b6b34392
[AIRFLOW-6838] Introduce real subcommands for Breeze (#7515)
This change introduces sub-commands in breeze tool.
It is much needed as we have many commands now
and it was difficult to separate commands from flags.

Also --help output was very long and unreadable.

With this change help it is much easier to discover
what breeze can do for you as well as navigate with it.

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

Co-authored-by: Kamil Breguła <mik-laj@users.noreply.github.com>
2020-02-24 22:31:50 +01:00
Jarek Potiuk 24f9f11775
[AIRFLOW-6820] split breeze into functions (#7433) 2020-02-19 01:58:53 +01:00
Ash Berlin-Taylor 1a6b6cb038 [AIRFLOW-XXXX] Less verbose docker builds
`-t` to xargs makes it echo the command it runs, we don't really need
that and it's overly verbose in our build logs
2020-02-17 11:30:29 +00:00
Ash Berlin-Taylor e835df590d
[AIRFLOW-6818] Fix for old versions of git on Dockerhub builds (#7440)
Dockerhub uses an old version of git (2.7.4 as of our testing in Feb
2020) so needs a slightly different syntax for git ls-files with an
exclusion. This works with current-latest git (2.25.0) too
2020-02-17 11:20:37 +00:00
Jarek Potiuk ff7034f39a
[AIRFLOW-6816] Simplified common functions in breeze scripts (#7430) 2020-02-16 20:05:50 +01:00
Ash Berlin-Taylor cec9249f90
[AIRFLOW-6818] Prevent Docker cache-busting on when editing www templates (#7432)
There is two parts to this PR:

1. Only copying www/webpack.config.js and www/static/ before running the
   asset pipeline
2. Making sure that _all_ files (not just the critical ones) have the
   same permissions.
2020-02-16 17:58:46 +01:00
Jarek Potiuk 627365ab74 Revert "[AIRFLOW-XXXX] Prevent Docker cache-busting on when editing www templates (#7427)"
This reverts commit 3eb30ed12c.
2020-02-16 10:10:37 +01:00
Ash Berlin-Taylor 3eb30ed12c
[AIRFLOW-XXXX] Prevent Docker cache-busting on when editing www templates (#7427)
There is two parts to this PR:

1. Only copying www/webpack.config.js and www/static/ before running the
   asset pipeline
2. Making sure that _all_ files (not just the critical ones) have the
   same permissions.

The goal of both of these is to make sure that the docker build cache for the "expensive"
operations (installing NPM modules, running asset pipeline, installing python modules)
isn't run when it isn't necessary.
2020-02-15 20:24:35 +00:00
Jarek Potiuk 73403cc8f4
[AIRFLOW-5704] Improve Kind Kubernetes scripts for local testing (#6516)
* Fixed problem that Kubernetes tests were testing latest master
  rather than what came from the local sources.
* Kind (Kubernetes in Dcocker) is run in the same Docker as Breeze env
* Moved Kubernetes scripts to 'in_container' dir where they belong now
* Kubernetes cluster is reused until it is stopped
* Kubernetes image is build from image in docker already + mounted sources
* Kubectl version name is corrected in the Dockerfile
* KUBERNETES_VERSION can now be used to select Kubernetes version
* Running kubernetes scripts is now easy in Breeze
* We can start/recreate/stop cluster using  --<ACTION>-kind-cluster
* Instructions on how to run Kubernetes tests are updated
* The old "bare" environment is replaced by --no-deps switch
2020-01-11 16:25:19 +01:00
Jarek Potiuk 75a43ccd0c
[AIRFLOW-5887] User is removed from CI images (#6540)
The AIRFLOW_USER is not needed any more in CI images. It will be needed in Prod
images but it will be implemented differently there.
2019-11-12 21:47:20 +01:00
Jarek Potiuk 1b3af10246 Revert "[AIRFLOW-5704] Improve Kind Kubernetes scripts for local testing (#6496)"
This reverts commit 8e789a33a3.
2019-11-07 13:36:05 +01:00
Jarek Potiuk 8e789a33a3
[AIRFLOW-5704] Improve Kind Kubernetes scripts for local testing (#6496)
* [AIRFLOW-5704] Improve Kind Kubernetes scripts for local testing

* Fixed problem that Kubernetes tests were testing latest master
  rather than what came from the local sources.
* Moved Kubernetes scripts to 'in_container' dir where they belong now
* Kubernetes tests are now better suited for running locally
* Kubernetes cluster is not deleted until environment is stopped
* Kubernetes image is built outside of the container and passed as .tar
* Kubectl version name is corrected in the Dockerfile
* Kubernetes Version can be used to select Kubernetes versio
* Running kubernetes scripts is now easy in Breeze
* Instructions on how to run Kubernetes tests are updated
* Better flags in Breeze are used to run Kubernetes environment/tests
* The old "bare" environment is replaced by --no-deps switch
2019-11-06 17:25:11 +01:00
Jarek Potiuk d4ff529743
[AIRFLOW-5829] Get rid of the checklicence image (#6495)
This change is a further step of simplifying the set of scripts
used by CI. The separate checklicence image was implemented as an
optimisation of the licence check time. The image to download was
small and could be downloaded slightly faster in CI. However that
made all the management script more complex and lead to having
separate jobs for check licence and static checks. That lead to
actually longer time of Travis jobs - because new machine had to
be spun-off for checklicence check only.

With this change, the CI image is the only one left and it is slightly
bigger (with RAT tool added) but the same image is used for all the
tests - unit tests, static checks and checklicence checks.

This also makes it easier to manage the images and decreases update
overhead on the developers using Breeze.
2019-11-06 10:31:20 +01:00
Jarek Potiuk b4c7538b86
[AIRFLOW-5830] Get rid of slim image (#6494)
The slim image gave only very small gain on executing the tests in CI. The
image was significantly smaller, but then for local development and testing
you needed both full CI and SLIM-CI image.

This made the scripts and docker image needlessly complex - especially
in the wake of coming Production image it turned to be premature
optimisation really. While it sped-up (slightly - by 10-20 seconds) some
static check jobs in Travis, it increased time needed by developers
to have a working environment and to keep it updated every time it was
needed (by minutes)

Also having two separately managed images made it rather complex to join
some of the Travis CI jobs (there is a follow-up change with getting rid
of Checklicence image).

With this change both static checks and tests are executed using single
image. That also opens doors for further simplification of the scripts
and easier implementation of production image.
2019-11-05 22:30:00 +01:00
Jarek Potiuk bf4cea0b2f [AIRFLOW-5585] Remove docker context from build 2019-10-04 18:13:06 +02:00
Jarek Potiuk 0ccb9256d7 [AIRFLOW-5534] Less verobosity and removal of context container 2019-09-22 19:47:44 +01:00
Jarek Potiuk 857788e305
[AIRFLOW-5369] Adds interactivity to pre-commits (#5976)
This commit adds full interactivity to pre-commits. Whenever you run pre-commit
and it detects that the image should be rebuild, an interactive question will
pop up instead of failing the build and asking to rebuild with REBUILD=yes

This is much nicer from the user perspective. You can choose whether to:
1) Rebuild the image (which will take some time)
2) Not rebuild the image (this will use the old image with hope it's OK)
3) Quit.

Answer to that question is carried across all images needed to rebuild.
There is the special "build" pre-commit hook that takes care about that.

Note that this interactive question cannot be asked if you run only
single pre-commit hook with Dockerfile because it can run multiple processes
and you can start building in parallel. This is not desired so instead we fail
such builds.
2019-09-18 13:43:30 +02:00
Jarek Potiuk 455eb41ba6
[AIRFLOW-5437] Better python version detection/explanation. (#6060)
We have fairly complex python version detection in our CI scripts.

They have to handle several cases:

1) Running builds on DockerHub (we cannot pass different environment
   variables there, so we detect python version based on the image
   name being build (airflow:master-python3.7 -> PYTHON_VERSION=3.7)

2) Running builds on Travis CI. We use python version determined
   from default python3 version available on the path. This way we
   do not have to specify PYTHON_VERSION separately in each job,
   we just specify which host python version is used for that job.
   This makes a nice UI experience where you see python version in
   Travis UI.

3) Running builds locally via scripts where we can pass PYTHON_VERSION
   as environment variable.

4) Running builds locally for the first time with Breeze. By default
   we determine the version based on default python3 version we have
   in the host system (3.5, 3.6 or 3.7) and we use this one.

5) Selecting python version with Breeze's --python switch. This will
   override python version but it will also store the last used version
   of python in .build directory so that it is automatically used next
   time.

This change adds necessary explanations to the code that works for
all the cases and fixes some of the edge-cases we had. It also
extracts the code to common directory.
2019-09-10 10:16:10 +02:00
Jarek Potiuk cfd6022618 [AIRFLOW-5441] Ownership of package*.json file group write is fixed (#6061)
When you use Breeze and you specify "--force-pull" flag, the latest image from
DockerHub is pulled before you attempt to rebuild the image. Currently in
breeze we used an optimised version of "fix-permission" script that only fixes
permissions of several files in the context (the workaround for different
roup write umask setting in DockerHub). However we did not have package.json
and package-lock.json on the list so those files were always seen as "changed"
and npm was reinstalled for the first time (and only the first time) when the
image was force pulled.

After fixing this, the of --force-pull breeze commands will be much faster -
skipping the whole npm package reinstallation. Depending on your network speed,
this might be between 20 seconds to several minutes as npm ci command wipes out
everything and downloads a lot of packages.
2019-09-08 23:07:23 -07:00
Hao Liang 4af841c925 [Airflow-XXXX] Fix a typo 2019-09-03 20:58:59 +02:00
Jarek Potiuk a81a8520e7 [AIRFLOW-5324] Fix hidden dependency on python3 in Breeze 2019-08-28 04:14:55 -04:00
Jarek Potiuk 286aa7a581
[AIRFLOW-3611] Simplified development environment (#4932) 2019-08-27 14:39:36 -04:00
Jarek Potiuk e515072ce2
[AIRFLOW-5287] Base image for chekclicence can be force pulled now (#5886) 2019-08-23 16:23:07 -04:00
Jarek Potiuk a317cd22b1 [AIRFLOW-5247] Move NPM dependencies up in the Dockerfile (#5870) 2019-08-20 11:41:51 +02:00
Jarek Potiuk 64207120fd
[AIRFLOW-5204] Shellcheck + common licences + executable shebangs in shell files (#5807)
* [AIRFLOW-5204] Shellcheck + common licence in shell files
2019-08-20 00:07:39 -04:00
Jarek Potiuk 70e937a8d8
[AIRFLOW-5161] Static checks are run automatically in pre-commit hooks (#5777) 2019-08-14 20:53:28 -04:00
Jarek Potiuk a4e3295e19
[AIRFLOW-5143] Caching works for Checklicence images (#5762) 2019-08-08 23:22:57 +02:00
Jarek Potiuk ea218d5d37
[AIRFLOW-5119] Enable building from scratch in CRON jobs (#5733) 2019-08-06 15:24:33 +02:00
Jarek Potiuk afd3722b58
[AIRFLOW-5091] Build epoch is fixed now (#5704)
We do not need monthly build epoch as we rebuild from the scratch
anyway every time new python patchlevel is released.

This happens every 1-2 months.
2019-08-01 13:56:58 +02:00
Jarek Potiuk b460e5dd1a
[AIRFLOW-5079] Checklicence test uses own, much smaller image (#5692) 2019-07-31 09:48:23 +02:00
Jarek Potiuk 27c79582ba
[AIRFLOW-5077] Skip force pulling latest python in CI environment (#5690)
The latest python will only be pulled by DockerHub when building
master/v1-10-test - which means that it will eventually catch
up with the latest python security releases but it will not
slow down the CI builds.
2019-07-31 09:12:17 +02:00
Jarek Potiuk 94209a8ec9
[AIRFLOW-5001] Moving building image to before_install phase (#5648)
(cherry picked from commit 15d78b723db3bf05f845025fcceafe3170563063)
2019-07-24 10:24:57 +02:00
Jarek Potiuk 207e54f9a9
[AIRFLOW-4997] Support for non-master branches (#5620)
(cherry picked from commit 98c17d97947ef58b3dbc11b341c67c4ca562d5a7)
2019-07-23 09:08:43 +02:00
Jarek Potiuk 2d086d77f1
[AIRFLOW-4117] Travis CI uses multi-stage images to run tests (#4938) 2019-07-17 22:42:43 +02:00
Jarek Potiuk f0ec5fee2a
[AIRFLOW-4755] Fixed default DOCKERHUB_USER (#5397) 2019-06-10 08:52:23 +02:00
Jarek Potiuk 78c592ad86
[AIRFLOW-4116] Dockerfile now supports CI image build on DockerHub (#4937) 2019-06-09 07:58:58 -07:00