https://prefect.io logo
Title
a

Adam

03/24/2023, 5:27 PM
hey! I am trying to do prefect deployment build with github and docker blocks. I am getting a
too many values to unpack (expected 2)
error, anyone know what I might be doing wrong? im on version 2.8.6
I think it has to do with my first line getting the flow from a file in git
n

Nate

03/24/2023, 7:20 PM
hi @Adam - can you share your
prefect deployment build
command?
a

Adam

03/24/2023, 7:20 PM
prefect deployment build <https://github.com/.../docker_prefect_test.py:run_dbt> \
  -n dbt-deploy-docker \
  -sb github-repository/git-repo \
  -ib docker-container/prefect-docker \
  -o prefect-docker-deployment \
  --apply
I ran this with a local file and it was fine, so im pretty sure it has to do with me trying to pull it from github
n

Nate

03/24/2023, 7:24 PM
yep, we interpret that first argument like
local_filepath_containing_flow:flow_fn
, so when this happens, a link wouldn't work
a

Adam

03/24/2023, 7:25 PM
so then how do I deploy a flow needs to be version controlled on git?
I think thats where I am getting tripped up, want to store it in git, so when we change its version controlled
n

Nate

03/24/2023, 7:30 PM
the github block is nice in this regard, you can just pass a relative path (if you run
deployment build
from that repo or if you clone the repo in CI or something) and then when your deployment runs and clones your repo (via your github storage block) it will know where to look relative your repo root. so in your case, if you're at your local
bi_etl
repo root you can do
prefect deployment build prefect/docker_prefect_test.py:run_dbt \
  -n dbt-deploy-docker \
  -sb github-repository/git-repo \
  -ib docker-container/prefect-docker \
  -o prefect-docker-deployment \
  --apply
assuming your project is organized like
bi_etl/
   prefect/
      docker_prefect_test.py
worth noting that we're about to release a simplified pattern for git-based deployments like this in the very near future, like in the next week or so
a

Adam

03/24/2023, 7:31 PM
ahhh so run this from my repo it should work with the relative path, maybe thats what I was also missing
and awesome! I look forward to it. It seems like this docker block is already going to save me some time from figuring out how to do that stuff lol
Appreciate your help on this!
n

Nate

03/24/2023, 7:32 PM
sure thing 😄 anytime
a

Adam

03/24/2023, 7:33 PM
and that worked! thanks!!!
👍 1
the blocks seem to be having issues or i dont know how to use them lol, so really looking forward to it being simplified
getting an
KeyError: "No class found for dispatch key 'github-repository' in registry for type 'Block'."
error when I run the deploy
n

Nate

03/24/2023, 8:18 PM
ahh sorry, this confusion is part of the motivation behind the simplification we're rolling out
github-repository
is a block that's defined in the
prefect-github
collection (a separate pypi package that would need to be installed where your agent runs) there is another block
github
that I would recommend using instead - its a part of prefect core, so nothing else to install. I will go ahead and raise this so we can remove
github-repository
from the block catalogue here since that is definitely confusing
a

Adam

03/24/2023, 8:21 PM
yeah, I was playing with both, as I had issues (different ones on each)
im having fun over here if you cant tell 😆
and finally success!
n

Nate

03/24/2023, 10:11 PM
ayy! glad you got it working do you might sharing what your final hurdle was here in case someone else runs into a similar problem? (before we roll out the simplified pattern 😄 )
a

Adam

03/27/2023, 1:09 PM
I was an idiot and had the git repo wrong and then missed a _ in the pip packages for dbt