-
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 pull request #1 from getredash/master
Upstream Update
- Loading branch information
Showing
139 changed files
with
2,498 additions
and
882 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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.py] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.{js,css,html}] | ||
indent_style = space | ||
indent_size = 2 |
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 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 |
---|---|---|
@@ -1,51 +1,13 @@ | ||
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 . ./ | ||
RUN npm install && npm run build && rm -rf node_modules | ||
RUN chown -R redash /app | ||
USER redash | ||
|
||
# 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 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,78 @@ | ||
#!/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 /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 /usr/local/bin/celery worker --app=redash.worker --beat -c$WORKERS_COUNT -Q$QUEUES -linfo --maxtasksperchild=10 -Ofair | ||
} | ||
|
||
server() { | ||
exec /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" | ||
echo "manage -- CLI to manage redash" | ||
} | ||
|
||
tests() { | ||
export REDASH_DATABASE_URL="postgresql://postgres@postgres/tests" | ||
exec make test | ||
} | ||
|
||
case "$1" in | ||
worker) | ||
shift | ||
worker | ||
;; | ||
server) | ||
shift | ||
server | ||
;; | ||
scheduler) | ||
shift | ||
scheduler | ||
;; | ||
dev_server) | ||
exec /app/manage.py runserver --debugger --reload -h 0.0.0.0 | ||
;; | ||
shell) | ||
exec /app/manage.py shell | ||
;; | ||
create_db) | ||
exec /app/manage.py database create_tables | ||
;; | ||
manage) | ||
shift | ||
exec /app/manage.py $* | ||
;; | ||
tests) | ||
tests | ||
;; | ||
*) | ||
help | ||
;; | ||
esac |
Oops, something went wrong.