<@U06RKAMK0UC> I am using containertasks to proces...
# ask-ai
h
@ancient-wolf-19325 I am using containertasks to process some files and return a flytedirectory , has anyone figured out a way to set the upload path in s3 instead of the randomly generated path?
j
Yes, you can set the upload path in S3 for a
FlyteDirectory
instead of using the randomly generated path. You can specify the
remote_path
parameter when returning a
FlyteDirectory
object. This allows you to control where the directory contents are uploaded in your S3 bucket. Here's an example:
Copy code
from flytekit import task, FlyteDirectory

@task
def process_files() -> FlyteDirectory:
    local_dir = "/path/to/local/dir"
    remote_path = "s3://your-bucket/specific/path/"
    return FlyteDirectory(local_dir, remote_path=remote_path)
According to the FlyteDirectory documentation, if you provide a
remote_path
, the contents of the local directory will be uploaded to the specified S3 path. Would you like more details on this or any other aspect of Flyte? Sources: - FlyteDirectory documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.