Hello, I am starting at prefect 2 I wonder somethi...
# ask-community
j
Hello, I am starting at prefect 2 I wonder something. • I have built some storage block for s3 in a bucket at my org. • also built a deployment.yaml file for my flow using that s3 storage. • I saw that whenever I run the deployment, it copies all the root code from my PC to s3 bucket So my question is, should I create a bucket folder for each flow? Or what is the best practice here?
1
n
hey @Javier Ochoa if you're just starting prefect 2, I would recommend taking a look at the newest deployment UX if you have an S3 bucket to hold your flow code, from your local repo root you could run
prefect init
, select
s3
and follow the CLI wizard to specify your bucket which will automatically configure your
prefect.yaml
with: • a
push
step (how your flow code gets uploaded at deployment time) • a
pull
step (how your worker pulls the code from storage at runtime) anything you don't want to upload you can specify in the
.prefectignore
file generated with
prefect init
if you need to specify credentials from an AwsCredentials block, you can like this in the
prefect.yaml
manually like this
Copy code
push:
  - prefect_aws.deployments.steps.push_to_s3:
      requires: prefect-aws>=0.3.0
      bucket: my-bucket
      folder: project-name
      credentials: "{{ prefect.blocks.aws-credentials.my-credentials-block }}"
let us know if you have any questions!
🙌 1
you can always accomplish this the older way, i.e.
prefect deployment build ... -sb s3/my-bucket-block/path
, but the yaml + CLI wizard based approach is where we're headed going forward
j
ok, I see
thanks for info, I will try this!
👍 1