Skip to content

Commit

Permalink
Name the development docker compose file as docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Jan 19, 2017
1 parent 00e1e90 commit c39f440
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 27 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ venv

dump.rdb

# Docker related
docker-compose.yml

node_modules
.tmp
.sass-cache
Expand Down
24 changes: 0 additions & 24 deletions docker-compose-example.yml

This file was deleted.

44 changes: 44 additions & 0 deletions docker-compose.production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This is an example configuration for Docker Compose. Make sure to atleast update
# the cookie secret & postgres database password.
#
# Some other recommendations:
# 1. To persist Postgres data, assign it a volume host location.
# 2. Split the worker service to adhoc workers and scheduled queries workers.
version: '2'
services:
server:
build: .
command: server
depends_on:
- postgres
- redis
ports:
- "5000:5000"
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
REDASH_COOKIE_SECRET: veryverysecret
worker:
build: .
command: scheduler
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
QUEUES: "queries,scheduled_queries,celery"
WORKERS_COUNT: 2
redis:
image: redis:2.8
postgres:
image: postgres:9.3
# volumes:
# - /opt/postgres-data:/var/lib/postgresql/data
nginx:
image: redash/nginx:latest
ports:
- "80:80"
depends_on:
- server
2 changes: 2 additions & 0 deletions docker-compose.dev.yml → docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This configuration file is for **development** setup. For production, refer to
# docker-compose.production.yml.
version: '2'
services:
server:
Expand Down

8 comments on commit c39f440

@blair55
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this commit breaks compatibility with the docker setup script:
redash/setup/docker/create_database.sh

@arikfr
Copy link
Member Author

@arikfr arikfr commented on c39f440 Jan 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script was deprecated and removed. There is a new setup guide:

https://redash.io/help-onpremise/dev/docker.html

But I realized now that I forgot to update the regular setup guide. Will do now 👍

@blair55
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I can now see the welcome screen, but when I submit the page it crashes.

From the docker image logs it looks like this problem:
http://stackoverflow.com/questions/26756166/django-celery-beat-dbaccesserror

@arikfr
Copy link
Member Author

@arikfr arikfr commented on c39f440 Jan 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share the log?

@blair55
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worker_1    | [2017-01-24 13:57:04,641: INFO/MainProcess] Connected to redis://redis:6379/0
worker_1    | [2017-01-24 13:57:04,674: INFO/MainProcess] mingle: searching for neighbors
worker_1    | [2017-01-24 13:57:04,769: INFO/Beat] beat: Starting...
worker_1    | [2017-01-24 13:57:04,786: ERROR/Beat] Removing corrupted schedule file 'celerybeat-schedule': DBAccessError(13, 'Permission denied')
worker_1    | Traceback (most recent call last):
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 376, in setup_schedule
worker_1    |     self._store = self._open_schedule()
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 366, in _open_schedule
worker_1    |     return self.persistence.open(self.schedule_filename, writeback=True)
worker_1    |   File "/usr/lib/python2.7/shelve.py", line 243, in open
worker_1    |     return DbfilenameShelf(filename, flag, protocol, writeback)
worker_1    |   File "/usr/lib/python2.7/shelve.py", line 227, in __init__
worker_1    |     Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
worker_1    |   File "/usr/lib/python2.7/anydbm.py", line 85, in open
worker_1    |     return mod.open(file, flag, mode)
worker_1    |   File "/usr/lib/python2.7/dbhash.py", line 18, in open
worker_1    |     return bsddb.hashopen(file, flag, mode)
worker_1    |   File "/usr/lib/python2.7/bsddb/__init__.py", line 364, in hashopen
worker_1    |     d.open(file, db.DB_HASH, flags, mode)
worker_1    | DBAccessError: (13, 'Permission denied')
worker_1    | [2017-01-24 13:57:04,805: ERROR/Beat] Process Beat
worker_1    | Traceback (most recent call last):
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/billiard/process.py", line 292, in _bootstrap
worker_1    |     self.run()
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 553, in run
worker_1    |     self.service.start(embedded_process=True)
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 470, in start
worker_1    |     humanize_seconds(self.scheduler.max_interval))
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/kombu/utils/__init__.py", line 325, in __get__
worker_1    |     value = obj.__dict__[self.__name__] = self.__get(obj)
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 512, in scheduler
worker_1    |     return self.get_scheduler()
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 507, in get_scheduler
worker_1    |     lazy=lazy)
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/utils/imports.py", line 53, in instantiate
worker_1    |     return symbol_by_name(name)(*args, **kwargs)
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 358, in __init__
worker_1    |     Scheduler.__init__(self, *args, **kwargs)
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 185, in __init__
worker_1    |     self.setup_schedule()
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 384, in setup_schedule
worker_1    |     self._store = self._destroy_open_corrupted_schedule(exc)
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 372, in _destroy_open_corrupted_schedule
worker_1    |     return self._open_schedule()
worker_1    |   File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 366, in _open_schedule
worker_1    |     return self.persistence.open(self.schedule_filename, writeback=True)
worker_1    |   File "/usr/lib/python2.7/shelve.py", line 243, in open
worker_1    |     return DbfilenameShelf(filename, flag, protocol, writeback)
worker_1    |   File "/usr/lib/python2.7/shelve.py", line 227, in __init__
worker_1    |     Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
worker_1    |   File "/usr/lib/python2.7/anydbm.py", line 85, in open
worker_1    |     return mod.open(file, flag, mode)
worker_1    |   File "/usr/lib/python2.7/dbhash.py", line 18, in open
worker_1    |     return bsddb.hashopen(file, flag, mode)
worker_1    |   File "/usr/lib/python2.7/bsddb/__init__.py", line 364, in hashopen
worker_1    |     d.open(file, db.DB_HASH, flags, mode)
worker_1    | DBAccessError: (13, 'Permission denied')

@arikfr
Copy link
Member Author

@arikfr arikfr commented on c39f440 Jan 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So strange. Does it get resolved if you rebuild the container?

@arikfr
Copy link
Member Author

@arikfr arikfr commented on c39f440 Jan 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, maybe the redash user can't write to this directory. If it persists after the rebuild it will confirm this.

@blair55
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the problem persists after a rebuild. Only the worker has this problem, the server does not.

Please sign in to comment.