-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into api-docstrings
- Loading branch information
Showing
65 changed files
with
777 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
engines: | ||
pep8: | ||
enabled: true | ||
eslint: | ||
enabled: true | ||
channel: "eslint-3" | ||
config: | ||
config: client/.eslintrc.js | ||
checks: | ||
import/no-unresolved: | ||
enabled: false | ||
ratings: | ||
paths: | ||
- "redash/**/*.py" | ||
- "client/**/*.js" | ||
exclude_paths: | ||
- tests/**/*.py | ||
- migrations/**/*.py | ||
- old_migrations/**/*.py | ||
- setup/**/* | ||
- bin/**/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
client/.tmp/ | ||
client/node_modules/ | ||
node_modules/ | ||
.tmp/ | ||
.git/ | ||
.vagrant/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,6 @@ venv | |
|
||
dump.rdb | ||
|
||
# Docker related | ||
docker-compose.yml | ||
|
||
node_modules | ||
.tmp | ||
.sass-cache | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,10 @@ | ||
FROM ubuntu:trusty | ||
FROM redash/base:latest | ||
|
||
# Ubuntu packages | ||
RUN apt-get update && \ | ||
apt-get install -y python-pip python-dev curl build-essential pwgen libffi-dev sudo git-core wget \ | ||
# Postgres client | ||
libpq-dev \ | ||
# Additional packages required for data sources: | ||
libssl-dev libmysqlclient-dev freetds-dev libsasl2-dev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
# 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 | ||
|
||
# Users creation | ||
RUN useradd --system --comment " " --create-home redash | ||
COPY . ./ | ||
|
||
# Pip requirements for all data source types | ||
RUN pip install -U setuptools==23.1.0 && \ | ||
pip install supervisor==3.1.2 | ||
|
||
COPY . /opt/redash/current | ||
RUN chown -R redash /opt/redash/current | ||
|
||
# Setting working directory | ||
WORKDIR /opt/redash/current | ||
|
||
# Install project specific dependencies | ||
RUN pip install -r requirements_all_ds.txt && \ | ||
pip install -r requirements.txt | ||
|
||
RUN curl https://deb.nodesource.com/setup_4.x | bash - && \ | ||
apt-get install -y nodejs && \ | ||
sudo -u redash -H make deps && \ | ||
rm -rf node_modules client/node_modules /home/redash/.npm /home/redash/.cache && \ | ||
apt-get purge -y nodejs && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Setup supervisord | ||
RUN mkdir -p /opt/redash/supervisord && \ | ||
mkdir -p /opt/redash/logs && \ | ||
cp /opt/redash/current/setup/docker/supervisord/supervisord.conf /opt/redash/supervisord/supervisord.conf | ||
|
||
# Fix permissions | ||
RUN chown -R redash /opt/redash | ||
|
||
# Expose ports | ||
EXPOSE 5000 | ||
EXPOSE 9001 | ||
|
||
# Startup script | ||
CMD ["supervisord", "-c", "/opt/redash/supervisord/supervisord.conf"] | ||
ENTRYPOINT ["/app/bin/docker-entrypoint"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
worker() { | ||
WORKERS_COUNT=${WORKERS_COUNT:-2} | ||
QUEUES=${QUEUES:-queries,scheduled_queries,celery} | ||
|
||
echo "Starting $WORKERS_COUNT workers for queues: $QUEUES..." | ||
exec sudo -E -u redash /usr/local/bin/celery worker --app=redash.worker -c$WORKERS_COUNT -Q$QUEUES -linfo --maxtasksperchild=10 -Ofair | ||
} | ||
|
||
scheduler() { | ||
WORKERS_COUNT=${WORKERS_COUNT:-1} | ||
QUEUES=${QUEUES:-celery} | ||
|
||
echo "Starting scheduler and $WORKERS_COUNT workers for queues: $QUEUES..." | ||
|
||
exec sudo -E -u redash /usr/local/bin/celery worker --app=redash.worker --beat -c$WORKERS_COUNT -Q$QUEUES -linfo --maxtasksperchild=10 -Ofair | ||
} | ||
|
||
server() { | ||
exec sudo -E -u redash /usr/local/bin/gunicorn -b 0.0.0.0:5000 --name redash -w4 redash.wsgi:app | ||
} | ||
|
||
help() { | ||
echo "Redash Docker." | ||
echo "" | ||
echo "Usage:" | ||
echo "" | ||
|
||
echo "server -- start Redash server (with gunicorn)" | ||
echo "worker -- start Celery worker" | ||
echo "scheduler -- start Celery worker with a beat (scheduler) process" | ||
echo "" | ||
echo "shell -- open shell" | ||
echo "dev_server -- start Flask development server with debugger and auto reload" | ||
echo "create_db -- create database tables" | ||
} | ||
|
||
tests() { | ||
export REDASH_DATABASE_URL="postgresql://postgres@postgres/tests" | ||
exec sudo -E -u redash make test | ||
} | ||
|
||
case "$1" in | ||
worker) | ||
shift | ||
worker | ||
;; | ||
server) | ||
shift | ||
server | ||
;; | ||
scheduler) | ||
shift | ||
scheduler | ||
;; | ||
dev_server) | ||
exec sudo -E -u redash /app/manage.py runserver --debugger --reload -h 0.0.0.0 | ||
;; | ||
shell) | ||
exec sudo -E -u redash /app/manage.py shell | ||
;; | ||
create_db) | ||
exec sudo -E -u redash /app/manage.py database create_tables | ||
;; | ||
tests) | ||
tests | ||
;; | ||
*) | ||
help | ||
;; | ||
esac |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.menu-search { | ||
margin-top: 3px; | ||
} | ||
|
||
.menu-search input[type="text"] { | ||
height: 30px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.