-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Local development setup ‐ Debian 12
This document is written on a Debian 12 desktop, so the instructions may need some adjustment on other distributions.
The asdf runtime version manager is used for installing Python and NodeJS.
$ sudo apt -y install --no-install-recommends build-essential curl default-libmysqlclient-dev \
freetds-dev git libbz2-dev libffi-dev libncurses-dev libpq-dev libreadline-dev libsasl2-dev \
libsasl2-modules-gssapi-mit libsqlite3-dev libssl-dev liblzma-dev python3-dev pwgen \
unixodbc-dev xmlsec1 xvfb
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
$ cat <<EOF >> ~/.bashrc
. "\$HOME/.asdf/asdf.sh"
. "\$HOME/.asdf/completions/asdf.bash"
EOF
Then restart the terminal session so asdf becomes available.
$ curl -fsSL https://get.docker.com | sudo sh
$ sudo docker run hello-world
$ sudo usermod -aG docker $USER
Then logout of your desktop and login again, so the group membership change becomes effective.
Otherwise you'll receive docker errors further down the page when you try to build the docker image.
$ git clone https://github.com/getredash/redash
$ cd redash
$ asdf plugin add python
$ asdf install python 3.10.15
$ asdf local python 3.10.15
This ensures any Python libraries we install only affect the virtual environment, not the whole system:
$ python3 -m venv ~/redashvenv1
$ source ~/redashvenv1/bin/activate
Note
When the Python virtual environment is active in your session, it changes the prompt to look like this:
(redashvenv1) $
Install Redash's Python dependencies into the virtual environment:
(redashvenv1) $ pip3 install wheel # "wheel" needs to be installed by itself first
(redashvenv1) $ pip3 install --upgrade black ruff launchpadlib pip setuptools
(redashvenv1) $ pip3 install poetry && poetry install --only main,all_ds,dev
(redashvenv1) $ pre-commit install
$ asdf plugin add nodejs
$ asdf install nodejs 18.20.4
$ asdf local nodejs 18.20.4
$ npm install -g yarn@1.22.22
$ yarn
Redash uses GNU Make to run things, so if you're not sure about something it's often a good idea to take a look over the Makefile which can help. 😄
$ make build
$ make compose_build
On my desktop (Ryzen 5600X) that took about 12 minutes to complete the first time. After that though, it's much faster at about a minute and a half each time.
It's a good idea to check that the docker images were built ok. We do that by telling docker to show us the local "docker images", which should include these three new ones. It's important the "created" time shows them to be very recent... if it's not, then they're old images left over from something else. 😉
$ docker image list
REPOSITORY TAG IMAGE ID CREATED SIZE
redash_scheduler latest 85bc2dc57801 2 minutes ago 1.38GB
redash_server latest 85bc2dc57801 2 minutes ago 1.38GB
redash_worker latest 85bc2dc57801 2 minutes ago 1.38GB
$ make create_database
$ make up
The docker compose ps
command should show all of the docker pieces
are running:
$ docker compose ps
Name Command State Ports
---------------------------------------------------------------------------------------------------------------------------------
redash_email_1 bin/maildev Up (healthy) 1025/tcp, 1080/tcp, 0.0.0.0:1080->80/tcp,:::1080->80/tcp
redash_postgres_1 docker-entrypoint.sh postg ... Up 0.0.0.0:15432->5432/tcp,:::15432->5432/tcp
redash_redis_1 docker-entrypoint.sh redis ... Up 6379/tcp
redash_scheduler_1 /app/bin/docker-entrypoint ... Up 5000/tcp
redash_server_1 /app/bin/docker-entrypoint ... Up 0.0.0.0:5001->5000/tcp,:::5001->5000/tcp,
0.0.0.0:5678->5678/tcp,:::5678->5678/tcp
redash_worker_1 /app/bin/docker-entrypoint ... Up 5000/tcp
The Redash web interface should also be available at http://localhost:5001, ready to be configured:
Once you've finished confirming everything works the way you want, then shut down the containers with:
$ make down