hey! I am trying to do prefect deployment build wi...
# ask-community
a
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
hi @Adam - can you share your
prefect deployment build
command?
a
Copy code
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
yep, we interpret that first argument like
local_filepath_containing_flow:flow_fn
, so when this happens, a link wouldn't work
a
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
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
Copy code
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
Copy code
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
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
sure thing 😄 anytime
a
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
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
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
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
I was an idiot and had the git repo wrong and then missed a _ in the pip packages for dbt