Hello everyone, I'm trying to figure out the code ...
# ask-community
e
Hello everyone, I'm trying to figure out the code below:
Copy code
import my_lib
from prefect import task, Flow
from prefect.storage import S3

@task
def my_func():
    my_lib.func()

with Flow("myflow") as flow:
   flow.storage = S3(
        bucket="BUCKET_NAME",
        stored_as_script="true",
        local_script_path="main.py"
    )
flow.register('myflow')
my dir looks like this:
Copy code
.
├── main.py
└── my_lib
    ├── __init__.py
    └── db.py
I'm trying to push my code up to s3 bucket but my
my_lib
dir doesn't get package up along with
main.py
what am I missing here?
k
Hey @ek, S3 storage (and most storages) will only copy the flow file. If you want to package dependencies like this, you would need to use a Docker container to package them together. I have a tutorial on this if you want
e
I was hoping that's not the answer to this solution. 😉
I do know how to make docker as a storage but I'd love to read your tutorial as well thank you!
k
The tutorial is here
🙌 1
e
thank you for the speedy response!
k
Of course!