From 30e8ef5c1ab6a19fa2b56cb4cc6b885b8bedd5c4 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Wed, 10 Oct 2018 22:57:30 +0300 Subject: [PATCH 1/4] Speed up builds by skipping requirements_all_ds.txt --- .circleci/config.yml | 2 +- Dockerfile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e07a29343c..29b3d87d43 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ jobs: name: Build Docker Images command: | set -x - docker-compose up -d + docker-compose build --build-arg skip_ds_deps=true sleep 10 - run: name: Create Test Database diff --git a/Dockerfile b/Dockerfile index e289bbde18..1a864cc6b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,13 @@ FROM redash/base:latest +# Controls whether to install extra dependencies needed for all data sources. +ARG skip_ds_deps + # We first copy only the requirements file, to avoid rebuilding on every file # change. COPY requirements.txt requirements_dev.txt requirements_all_ds.txt ./ -RUN pip install -r requirements.txt -r requirements_dev.txt -r requirements_all_ds.txt +RUN pip install -r requirements.txt -r requirements_dev.txt +RUN if [ "x$skip_ds_deps" = "x" ] ; then pip install -r requirements_all_ds.txt ; else echo "Skipping pip install -r requirements_all_ds.txt" ; fi COPY . ./ RUN npm install && npm run build && rm -rf node_modules From 1c303a01abe93cc6dfa5032db482a42c52dd2b61 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Wed, 10 Oct 2018 22:59:17 +0300 Subject: [PATCH 2/4] Update docker compose file version --- .circleci/docker-compose.circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/docker-compose.circle.yml b/.circleci/docker-compose.circle.yml index 166b22a98b..e756a92ff3 100644 --- a/.circleci/docker-compose.circle.yml +++ b/.circleci/docker-compose.circle.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3' services: redash: build: ../ From 99c438c5f7ee89ffd3aeb4bceaee34110c618f69 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Wed, 10 Oct 2018 23:18:57 +0300 Subject: [PATCH 3/4] Start services before running commands --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 29b3d87d43..b8fa637b7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,6 +27,7 @@ jobs: command: | set -x docker-compose build --build-arg skip_ds_deps=true + docker-compose up -d sleep 10 - run: name: Create Test Database From ec482955d843ed40af0f4ae66fbf82591879c8d8 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Thu, 11 Oct 2018 09:19:38 +0300 Subject: [PATCH 4/4] Add boto and Athena dependencies to requirements_dev.txt --- requirements_dev.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index af2d34aa46..e885cb8319 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -4,5 +4,8 @@ pytest-watch==4.1.0 coverage==4.0.3 mock==2.0.0 -# PyMongo is needed for one of the unit tests: +# PyMongo and Athena dependencies are needed for some of the unit tests: +# (this is not perfect and we should resolve this in a different way) pymongo==3.6.1 +botocore==1.10.2 +PyAthena>=1.0.0