90 Commits

Author SHA1 Message Date
Eric Radman
fae354fcce Update Poetry to 2.1.4 (#7509)
* Relocate [tool.poetry] to [project] section
* Add dependencies section to [project]
* Format authors and maintainers as objects
2025-08-26 08:08:19 -04:00
Eric Radman
b922730482 Docker build: use heredoc for multi-line actions (#7210) 2024-10-29 10:23:15 +10:00
Zach Liu
c073c1e154 Fix mismatched poetry version (#7122)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-16 16:01:53 +10:00
SeongTae Jeong
8725fa4737 Add support for 'linux/arm64' platforms (#7094)
Co-authored-by: Justin Clift <justin@postgresql.org>
2024-08-01 08:52:45 +00:00
Justin Clift
714b950fde Match FROM and AS capitalisation in Dockerfile (#7093) 2024-08-01 17:48:57 +10:00
Ezra Odio
bceaab0496 Update to Python 3.10 (#6991)
Updated from Python 3.8 to 3.10. Python 3.10 is the default for Ubuntu 22. This change necessitated upgrading to
SQLAlchemy_Utils 0.38.3, and importing the sort_query function from an older version of SQLAlchemy_Utils because it was dropped in newer versions.

Co-authored-by: Ezra Odio <eodio@starfishstorage.com>
2024-06-05 17:41:49 +10:00
Eric Radman
408ba78bd0 Update MSSQL OBDC driver to v18 (#6968) 2024-05-15 01:55:32 +10:00
Eric Radman
58cc49bc88 Revert build (2 of 2) (#6967) 2024-05-14 12:30:48 +00:00
Andrii Chubatiuk
3399e3761e mssql-odbc-arm64 (#6924)
Co-authored-by: Peter Lee <yankeeguyu@gmail.com>
2024-04-24 10:05:07 +00:00
Justin Clift
9601660751 Update Node image in Dockerfile to 18-bookworm 2024-04-12 15:08:56 +10:00
Andrii Chubatiuk
95ecb8e229 fix for coverage (#6872)
Co-authored-by: Andrii Chubatiuk <wachy@Andriis-MBP-2.lan>
2024-04-11 05:35:14 +00:00
Andrii Chubatiuk
3f19534301 reuse built frontend in ci, merge compose files (#6674)
* reuse built frontend in ci, merge compose files

* pr comments

* added make create_db alias to create_database

* fixed lint

---------

Co-authored-by: Andrii Chubatiuk <wachy@Andriis-MBP-2.lan>
2024-04-10 19:53:14 +10:00
Justin Clift
24dec192ee Update yarn to current latest in 1.22.x series (#6858)
* Update yarn to current latest in 1.22.x series

* Use an environment variable for the yarn version

As suggested by @lucydodo:

  https://github.com/getredash/redash/pull/6858#discussion_r1555131358

Thanks heaps. :)
2024-04-08 01:52:45 +00:00
Eric Radman
2fe0326280 Allow WebPack configuration when building in Docker (#6780)
Co-authored-by: github-actions <github-actions@github.com>
2024-02-27 05:28:39 +10:00
Andrii Chubatiuk
094984f564 Node 18 (#6752)
* Snapshot: 24.02.0-dev

* node-18

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
2024-02-22 22:10:20 +00:00
Genki Sugawara
84d1693419 Update Debian image in Dockerfile (#6524) 2023-10-16 08:51:38 +00:00
Justin Clift
650ec90df3 Add kerberos development headers to Redash image (#6454)
Without these headers, compiling pymssql on arm64 fails:

  gcc -pthread -shared build/temp.linux-aarch64-cpython-38/src/pymssql/_mssql.o -L/usr/local/lib -lsybdb -lgssapi_krb5 -lkrb5 -lssl -lcrypto -o build/lib.linux-aarch64-cpython-38/pymssql/_mssql.cpython-38-aarch64-linux-gnu.so
  /usr/bin/ld: cannot find -lgssapi_krb5
  /usr/bin/ld: cannot find -lkrb5
  collect2: error: ld returned 1 exit status
2023-09-14 21:54:13 +10:00
Guido Petri
c97afeb327 Convert project to poetry (#6423)
* poetry init

* add all dependencies

* update pyproject.toml

* add poetry.lock

* remove requirements txt fixer

* add ldap3 group and make all groups optional

* remove requirements files

* convert dockerfile to use poetry instead of pip

* fix ldap 3 dependency group typo

* update ldap3 inline error

* update cypress to install only main poetry group

* convert test_all_deps

* update redis/rq

* don't create virtualenv

* add -dev suffix and make version snapshot work

* fix typo in snapshot commit message

* remove importlib-resources
2023-09-08 23:57:26 +00:00
Justin Clift
2a2c90a014 Add pkg-config to the Docker image (#6419)
Without pkg-config the MySQL client install doesn't always work
2023-09-03 07:10:54 +00:00
Justin Clift
87adad9afc Update our dev and CI docker to use NodeJS 16.20.1 (#6178) 2023-07-19 08:59:42 +00:00
Jun
537d153986 CI: add test_all_deps on docker build (#6152)
* add test_all_deps on docker build

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* upgrade pip version

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-08 12:00:36 +09:00
Jesse
cdd4849f96 Install python dependencies one-by-one. Don't exit on failures. (#5788)
Cat code taken from https://stackoverflow.com/a/54053100
2023-07-08 12:02:49 +10:00
Justin Clift
241dcfacd9 Update to latest in yarn 1.22.x series (#6140) 2023-06-30 18:50:22 +00:00
Will Lachance
46f67fd44b Upgrade Python version to 3.8 (#6130)
* Upgrade Python version to 3.8 (with ci too)

3.7 is now end-of-life: this is a minimal change to get us on a supported version.
2023-06-29 04:26:28 +10:00
Will Lachance
f45bd27e68 Update Simba ODBC driver (#6110) 2023-06-23 08:23:51 -07:00
Arik Fraimovich
28b0a2379d Remove extensions mechanism (#5895)
* Remove extensions mechanism.

* Missing change.
2023-03-20 07:39:21 -07:00
trigremm
75cb59f4be Databricks ODBC Driver: follow redirects (#5814)
Use curl --location
2022-08-24 09:26:09 -05:00
Gabriel A. Devenyi
46ea3b1f0b Fix hard-coding of amd64 platform, make ARM build work. (#5687)
* Fix hard-coding of amd64 platform and make amd64 package installation conditional
* Cleanup Dockerfile for best practices
* Enable BuildKit for docker building
2022-04-28 11:20:13 -05:00
adamzwakk
b713f6b240 Update Dockerfile CHOWN into COPY (#5660)
Its more efficient to chown while COPY for large stacks of files as per https://github.com/docker/for-linux/issues/388
2022-03-02 09:34:52 -06:00
Robin Zheng
965db26cab Fix"Unable to locate package msodbcsql17"on M1 (#5638)
If you run the docker-compose on a Mac with the new M1 chip, you will get the "Unable to locate package msodbcsql17" error. Because there are currently no msodbcsql17 packages for arm64 architecture. The solution was to change the base image in the Dockerfile to change the installation to the older AMD architecture. 

FROM --platform=linux/amd64 python:3.7-slim-buster
2021-12-16 00:50:13 -08:00
Dan Goldin
2e67227f1b Typo(#5636) 2021-10-28 14:55:48 -05:00
Levko Kravets
380345bb08 Pin python3 image version (#5570) 2021-08-18 11:04:46 -07:00
Levko Kravets
7445080d1a Use Yarn instead of NPM (#5541) 2021-08-02 13:16:33 +03:00
Omer Lachish
5085495dd4 Refine Dockerfile caching (#5484) 2021-05-14 06:48:10 -07:00
Rafael Wendel
f018c0a7b7 fix: rollback pip version to avoid legacy resolver problem (#5467)
Co-authored-by: Lingkai Kong <lingkai.kong@databricks.com>
2021-04-09 15:34:42 -03:00
Vipul Mathur
829247c2d2 Use legacy resolver in pip to fix broken build (#5309)
Fixes #5300 and fixes #5307 

There have been upstream (`python:37-slim` image) changes that
bring in `pip` version 20.3.1, which makes new `2020-resolver`
the default.  Due to that, un-resolvable dependency conflicts
in  `requirements_all_ds.txt` now cause the build to fail.

This is a workaround until the package versions can be updated
to work with the new pip resolver.
2021-01-20 12:17:39 -08:00
Gabriel Dutra
fa7ecca485 Frontend updates from internal fork (#5259)
* DynamicComponent for QuerySourceAlerts

* General Settings updates

* Dynamic Date[Range] updates

* EmptyState updates

* Query and SchemaBrowser updates

* Adjust page headers and add disablePublish

* Policy updates

* Separate Home FavoritesList component

* Update FormatQuery

* Autolimit frontend fixes

* Misc updates

* Keep registering of QuerySourceDropdown

* Undo changes in DynamicComponent

* Change sql-formatter package.json syntax

* Allow opening help trigger in new tab

* Don't run npm commands as root in Dockerfile

* Cypress: Remove extra execute query
2020-11-10 14:59:15 +02:00
Gabriel Dutra
f4dcb2918a Move Cypress to dev dependencies (#3991)
* Test Cypress on package list

* Skip Puppeteer Chromium as well

* Put back missing npm install on netlify.toml

* Netlify: move env vars to build.environment

* Remove cypress:install script

* Update Cypress dockerfile

* Copy package-lock.json to Cypress dockerfile
2020-09-29 09:51:28 +03:00
Gabriel Dutra
c821cab4cb Generate Code Coverage report for Cypress (#5137) 2020-09-28 21:43:04 -03:00
Arik Fraimovich
05540164e1 Small updates to Dockerfile (#4964) 2020-06-11 12:28:59 +03:00
Arik Fraimovich
8907a86e33 Make frontend build in Docker image optional (#4879)
* Add build arg to Dockerfile to control if we should build frontend assets

* Move more env settings into the shared one.

* Use build arg in docker-compose to skip frontend build.

* CirlceCI: Skip building frontend assets in backend tests

* Create dummy template files

* Expand file names manually.

* Add build arg to skip dev dependencies.

* Update Dockerfile

* Reverse logic of skip_dev_deps to what it should be.
2020-05-12 16:46:53 +03:00
Arik Fraimovich
a8a2964cb0 Make the Databricks driver URL and environment variable (#4878)
* Make the Databricks driver URL and environment variable

* Replace ENV with ARG
2020-05-11 13:24:11 +03:00
Gabriel Dutra
fc246aafc4 Separate visualizations into their own package (#4837)
* Add visualizations project settings

* Move visualizations to redash-visualizations

* Delete shared components

* Remove antd from deps

* Remove p-r-5 from table utils

* Remove visualization deps from package.json

* Rename package and change its version

* Test preinstall script

* Update Dockerfile build for frontend

* Test adding dockerignore

* Update jest tests

* Add step for jest tests

* Include viz-lib on dev commands

* User prettier v1 for now

* Delete unused libs on the app

* Add readme draft (to be finished)

* Add getOptions to Editor

* Add required libraries and finish basic example

* Bump version
2020-05-06 10:49:15 +03:00
Arik Fraimovich
ea8a075a2d ODBC Based Databricks Connector (#4814)
* ODBC Based Databricks connector.

* Install Databricks' ODBC driver in Docker image

* Add useragent string.

* Add Types enum to redash.query_runner to replace the seprate constants.

* Databricks connector:

1. Parse types.
2. Send additional connection options.
3. Correctly parse errors.

* Switch to TYPE constants to use code with Python 2.

* Add note about the Databricks driver terms and conditions.

* Show message about Databricks driver terms and conditions.

* Handle cases when the query doesn't return any results.

* Update redash/query_runner/databricks.py

Co-Authored-By: Jesse <jesse@whitehouse.dev>

* Use new Databricks logo

* Fix connection string options

Co-authored-by: Jesse <jesse@whitehouse.dev>
2020-04-24 18:04:44 +03:00
lihan
7f2a0af841 Removing the PIP cache from the built image (#4766) 2020-04-03 12:06:55 +03:00
Levko Kravets
7043951f00 Use npm ci instead of npm install in CI scripts (#4688) 2020-02-26 19:23:32 +02:00
Arik Fraimovich
f1a2f8cb88 Enable ODBC and MS SQL ODBC support (#4676)
Closes #4356.
2020-02-23 11:57:39 +02:00
Arik Fraimovich
7c05a730dc Remove --max-old-space-size=4096 from npm build command (#4381)
* Remove --max-old-space-size=4096 from build

Looks like it's no longer needed.

* Update to node v12.

* Add build:old-node-version for those who have Node < 12.
2019-12-05 22:41:57 +02:00
Nicolas Le Manchet
246eca1121 Migrate the application to Python 3 (#4251)
* Make core app compatible with Python 3

No backward compatibility with Python 2.7 is kept.
This commit mostly contains changes made with 2to3 and manual
tweaking when necessary.

* Use Python 3.7 as base docker image

Since it is not possible to change redash/base:debian to Python 3
without breaking future relases, its Dockerfile is temporarly
copied here.

* Upgrade some requirements to newest versions

Some of the older versions were not compatible with Python 3.

* Migrate tests to Python 3

* Build frontend on Python 3

* Make the HMAC sign function compatible with Python 3

In Python 3, HMAC only works with bytes so the strings and the
float used in the sign function need to be encoded.
Hopefully this is still backward compatible with already generated
signatures.

* Use assertCountEqual instead of assertItemsEqual

The latter is not available in Python 3.
See https://bugs.python.org/issue17866

* Remove redundant encoding header for Python 3 modules

* Remove redundant string encoding in CLI

* Rename list() functions in CLI

These functions shadow the builtin list function which is
problematic since 2to3 adds a fair amount of calls to the builtin
list when it finds dict.keys() and dict.values().

Only the Python function is renamed, from the perspective of the
CLI nothing changes.

* Replace usage of Exception.message in CLI

`message` is not available anymore, instead use the string
representation of the exception.

* Adapt test handlers to Python 3

* Fix test that relied on dict ordering

* Make sure test results are always uploaded (#4215)

* Support encoding memoryview to JSON

psycopg2 returns `buffer` objects in Python 2.7 and `memoryview`
in Python 3. See #3156

* Fix test relying on object address ordering

* Decode bytes returned from Redis

* Stop using e.message for most exceptions

Exception.message is not available in Python 3 anymore, except
for some exceptions defined by third-party libraries.

* Fix writing XLSX files in Python 3

The buffer for the file should be made of bytes and the actual
content written to it strings.

Note: I do not know why the diff is so large as it's only a two
lines change. Probably a white space or file encoding issue.

* Fix test by comparing strings to strings

* Fix another exception message unavailable in Python 3

* Fix export to CSV in Python 3

The UnicodeWriter is not used anymore. In Python 3, the interface
provided by the CSV module only deals with strings, in and out.
The encoding of the output is left to the user, in our case
it is given to Flask via `make_response`.

* (Python 3) Use Redis' decode_responses=True option (#4232)

* Fix test_outdated_queries_works_scheduled_queries_tracker (use utcnow)

* Make sure Redis connection uses decoded_responses option

* Remove unused imports.

* Use Redis' decode_responses option

* Remove cases of explicit Redis decoding

* Rename helper function and make sure it doesn't apply twice.

* Don't add decode_responses to Celery Redis connection URL

* Fix displaying error while connecting to SQLite

The exception message is always a string in Python 3, so no
need to try to decode things.

* Fix another missing exception message

* Handle JSON encoding for datasources returning bytes

SimpleJSON assumes the bytes it receives contain text data, so it
tries to UTF-8 encode them. It is sometimes not true, for instance
the SQLite datasource returns bytes for BLOB types, which typically
do not contain text but truly binary data.

This commit disables SimpleJSON auto encoding of bytes to str and
instead uses the same method as for memoryviews: generating a
hex representation of the data.

* Fix Python 3 compatibility with RQ

* Revert some changes 2to3 tends to do (#4261)

- Revert some changes 2to3 tends to do when it errs on the side of caution regarding dict view objects.

- Also fixed some naming issues with one character variables in list comprehensions.

- Fix Flask warning.

* Upgrade dependencies

* Remove useless `iter` added by 2to3

* Fix get_next_path tests (#4280)

* Removed setting SERVER_NAME in tests setup to avoid a warning.

* Change get_next_path to not return empty string in case of a domain only value.

* Fix redirect tests:

Since version 0.15 of Werkzeug it uses full path for fixing the location header instead of the root path.

* Remove explicit dependency for Werkzeug

* Switched pytz and certifi to unbinded versions.

* Switch to new library for getting country from IP

`python-geoip-geolite2` is not compatible with Python 3, instead
use `maxminddb-geolite2` which is very similar as it includes
the geolite2 database in the package .

* Python 3 RQ modifications (#4281)

* show current worker job (alongside with minor cosmetic column tweaks)

* avoid loading entire job data for queued jobs

* track general RQ queues (default, periodic and schemas)

* get all active RQ queues

* call get_celery_queues in another place

* merge dicts the Python 3 way

* extend the result_ttl of refresh_queries to 600 seconds to allow it to continue running periodically even after longer executions

* Remove legacy Python flake8 tests
2019-10-24 12:42:13 +03:00
Jianchao Yang
a00c5a8857 Dockerfile front end stage copies client side files only (#3924)
So that changing other files will not trigger the
very expensive rebuild process.
2019-06-23 11:33:52 +03:00