-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interacting with dbt inside docker container #15
Comments
hey @srpwnd, while I haven't tested this full, I have a theory and it's all about the difference between a command and an argument.
In your case, One option might be to set Then set By default,
I would override that whole thing and just set it to the docker args. What that should do is change the way it builds the dbt command here: dbtpal/lua/dbtpal/commands.lua Line 15 in 46d6b7a
But again, very much untested so we might have to work on this one together and I've never used dbt within a docker container within meltano before. |
It's a progress! So I set up the path and pre-cmd-args like so path_to_dbt = "docker",
pre_cmd_args = {
"exec",
"$(docker ps | grep meltano-airflow-scheduler | sed -e \'s/ .*$//\')",
"meltano",
"invoke",
"dbt-duckdb"
}, And now the telescope window opens up (although it doesn't do anything) but when running
The output of build command log message is following
I tried running the generated command straight from my terminal and it throws following error:
Which after a bit of thinking made sense, because the path to dbt project and profiles is different on my local host and inside the docker container. Since all my dbt docker projects follow the same folder structure I tried manually setting the project and profiles dir path_to_dbt_project = "/project/transform",
path_to_dbt_profiles_dir = "/project/transform/profiles/duckdb", but it seems that somewhere along the code is accidentally overwriting the
I tried looking for where this might happen but my lack of knowledge of Lua didn't serve me very much and I was unable to find it. I'm happy to debug and try this further if you can point me into the right directions! |
What version of neovim are you running?
This is a little suspicious to me. It comes from this line:
I am wondering if One thing that might help with the rest is increasing the log level to TRACE.
Once you open a dbt file, before running it, you can view the log messages and then paste the output of that after opening a SQL file, should help isolate the problem!
Here's a loom showing how it's done. |
As far as I'm aware it's the latest release build:
Trace messages when opening up a dbt model:
But then it outputs different config when I try to do
|
Ah interesting, looks like title is only from the nightly version. I removed title for now, give this a shot: https://github.com/PedramNavid/dbtpal/releases/tag/v0.0.2 Still very odd that |
Ok, so the updated release helped with the I get the following messages:
The pop-up shows nothing except for "Press q to close" message. This is the full require("dbtpal").setup({
path_to_dbt = "docker",
pre_cmd_args = {
"exec",
"$(docker ps | grep meltano-airflow-scheduler | sed -e \'s/ .*$//\')",
"meltano",
"invoke",
"dbt-duckdb"
},
path_to_dbt_project = "/project/transform",
path_to_dbt_profiles_dir = "/project/transform/profiles/duckdb",
extended_path_search = true,
protect_compiled_files = true
})
vim.keymap.set('n', '<leader>drf', require("dbtpal").run)
vim.keymap.set('n', '<leader>drp', require("dbtpal").run_all)
vim.keymap.set('n', '<leader>dtf', require("dbtpal").test)
vim.keymap.set('n', '<leader>dm', require('dbtpal.telescope').dbt_picker)
require('telescope').load_extension('dbtpal') In case you need the full picture here is a Packer config in full file and here is the above mentioned config of |
Looks like it does end up loading the
if you run that command locally does it work? Try these two commands in neovim:
Do either of these work? |
When running the
and neither of the two commands in neovim work. Both of them give me the same error
and again the pop-up shows nothing. Should I include any screenshots or more info? |
I'm not sure if that will help. At this point, I would have to go and say that running dbt inside a docker container isn't supported. I'd recommend installing dbt locally and using that when developing in neovim, until someone else can figure out how to get this working. |
I've done some digging around and from my point of view it seems there might be some issue in Hopefully someone will be able to help. Unfortunatelly using dbt locally is not possible in my workflow. |
My setup utilizes running dbt inside a docker container as a part of whole Meltano-based stack.
I was wondering if this plugin could interact with dbt executable inside such container. I tried replacing dbt executable with
docker exec
command accordingly:but I'm receiving
Executable not found
error.Is it possible to configure
dbtpal
to work with dbt inside docker container?The text was updated successfully, but these errors were encountered: