<@U02EFFCT5JP> Team can someone provide me example...
# ask-community
s
@prefect Team can someone provide me examples around how to implement flow code storage using github repo ,I did notice only githubrepourl/reponame ,how to include multiple paths
1
j
Hey @sjammula - are you using prefect projects?
s
@Jamie Zieziula in prefect1 we used projects style, not sure what else you mean
j
Are you using prefect 1 or 2?
s
prefect2 we are migrating
we are using single repo with multiple project paths in it
@Jamie Zieziula
j
can you share your prefect.yaml / deployment.yaml file?
s
sure will share .I need to create github infra block correct?earlier I'm using s3 infra block
any examples can you provide me how to use the github paths
j
If you are using prefect projects, you won’t need infra or storage blocks - those are now defined in your work pool definition & your prefect.yaml respectively
s
No I'm not using this
I'm referring to this
j
ah ok - you’ll want to create a block type of
GitHub
and then specify the path to your flow code in the
entrypoint
of your deployment.yaml
Copy code
# Build deployment
prefect deployment build ./path/to/flow/flow.py:flow \
  --infra-block INFRA_BLOCK \
  --name NAME \
  --work-queue WORK_QUEUE \
  --storage-block github/BLOCK_NAME \
  --apply
s
I can create seperate file for infrablock right?I dont see examples in prefect docs for github
@Jamie Zieziula I'm recieving this error not sure why when I try to create a deployment Deployment storage GitHub(repository='https://github.com/xxx/xx/, reference=None, access_token=SecretStr('xxx), include_git_objects=True) does not have upload capabilities; no files uploaded.
j
When do you receive that error? The github block will not upload code for you, rather it tells Prefect where to load your code from at runtime
s
That's correct I thought the file is already present in the github location ,corrected it Thanks is the "path" supported here in github? @Jamie Zieziula
I noticed only these 2 args in block Gthub(repository=, accesstoken=)
@Jamie Zieziula
j
Hey Sravani, please don’t tag people - it creates notification noise for us; we monitor the community and will respond when we’re able to!
you have to specify the path as a part of your entry point.
it’s the argument immediately following the prefect deployment build
s
I'm seeing this error when I provided the --path argument I did cross check that my file is at the github location.
j
yep the path argument isn’t what you want! you’ll need to run prefect deployment build <path/to/flow:flow> (aka your entry point)
so - prefect deployment build ./dev/prefect2/flow.py:flow (or whatever your flow file & flow function are called)
s
thanks @Jamie Zieziula that worked
j
great!