https://prefect.io logo
Title
s

sjammula

05/17/2023, 7:43 PM
@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

Jamie Zieziula

05/17/2023, 7:44 PM
Hey @sjammula - are you using prefect projects?
s

sjammula

05/17/2023, 7:53 PM
@Jamie Zieziula in prefect1 we used projects style, not sure what else you mean
j

Jamie Zieziula

05/17/2023, 7:56 PM
Are you using prefect 1 or 2?
s

sjammula

05/17/2023, 7:58 PM
prefect2 we are migrating
we are using single repo with multiple project paths in it
@Jamie Zieziula
j

Jamie Zieziula

05/17/2023, 8:14 PM
can you share your prefect.yaml / deployment.yaml file?
s

sjammula

05/17/2023, 8:17 PM
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

Jamie Zieziula

05/17/2023, 8:19 PM
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

sjammula

05/17/2023, 8:21 PM
No I'm not using this
I'm referring to this
j

Jamie Zieziula

05/17/2023, 9:08 PM
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
# 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

sjammula

05/17/2023, 10:24 PM
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

Jamie Zieziula

05/18/2023, 3:11 PM
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

sjammula

05/18/2023, 4:03 PM
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

Jamie Zieziula

05/18/2023, 6:05 PM
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

sjammula

05/18/2023, 9:31 PM
I'm seeing this error when I provided the --path argument I did cross check that my file is at the github location.
j

Jamie Zieziula

05/18/2023, 10:11 PM
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

sjammula

05/19/2023, 7:33 PM
thanks @Jamie Zieziula that worked
j

Jamie Zieziula

05/19/2023, 7:35 PM
great!