Getting started hacking redash

Edited:

I want to start hacking redash, specifically developing a query runner.

What does the development/deploy cycle look like?

Specifically:

  1. What files am I editing and,

  2. After I edit how to I build and deploy via docker?

I have read the “how to create query runners” and am working through the development setup guide from the source.

Cheers, Jon

Have a look in:

What query_runner do you intend to add?

I wouldn’t use Docker for development; personally I just use a virtualenv for Redash; it’s pretty straightforward. I might do some sort of write up of that, as I’m not a fan of the move to Docker, so I’m also deploying to production in the same manner (with virtualenv & supervisord running within that). If you drop a local python & node.js into the deployment you can make it totally OS independent anyway.

Hey JonDash,

Check out the detailed explanation on how to create query runners to get started.

Let us know if you have any further questions,
Omer

1 Like

Question edited for clarity…

Some clarifications:

  • If you use the docker-compose.yml provided in the git repo, it already mounts the code as a volume. So you don’t need to rebuild the Docker container to apply changes. Also the default commands run everything with “restart on changes”, so your changes are always applied. It might cause the containers to stop when saving broken code, so just be aware of it and check status if needed.
  • There is a step by step guide on how to create a Docker based dev environment. If anything isn’t clear there, feel free to follow up with questions and hopefully we can improve it based on this.

All the existing query runners are in redash/query_runner and you can add yours there as well. The post @rauchy linked to is a good referenced on the steps required to create a new query runner.

It’s missing some details on adding the logo for your data source in client/app/assets/images/db-logos. It should be a .png file with the same name as your data source type identifier, which is by default the lowercased class name.

Btw, what query runner are you planning on implementing?

Good luck :slight_smile:

Firstly thanks all of you for the pointers. I’ve been working on that step-by-step Docker based dev guide today and I think I’ve cracked that now - I was getting errors on npm run start, but I reinstalled my VM and started again after checking out origin/release/8.0.x instead of trying to do it on origin/master.

Arikfr, if I hadnt been reading the log messages I wouldn’t understand, but your first 2 sentences are like a little nugget of gold :slight_smile: now.

All in all this is a great experience with a new piece of software and I can’t believe it’s open source.

I started thinking about writing query runners because I was using the Python Query Runner to hook up to some cloud based services but didn’t like the way that I would need to expose credentials to anyone who could read the query definition.

1 Like

Do you have our Docker setup running inside a VM on your own machine?

This make sense. We have some services like this already: Google Analytics and JIRA come to mind.

BlockquoteDo you have our Docker setup running inside a VM on your own machine?<

Yes - I do now, and I’m of to the races :slight_smile: It’s ubuntu 18.4.03 on Virtualbox on my macbook.

Have you considered using Docker directly on your MacOS?

Yep thanks, just got it running today.

I think I originally had problems due to not having Docker Desktop installed - I was trying to use the docker installed with homebrew. Then I switched to Linux in a VM, figured out I needed to do sudu docker-compose, figured out I had to checkout the right branch to docker, then eventually jackpot.

I tried it on Windows 10 yesterday but hit lots of issues, (rm -rf, NODEENV etc) and gave up.

Today I went back to the Mac and blitzed it straight in.

Learning all the time, it’s good :slight_smile: