Hi I want to get the gcs bucket data and inside th...
# ask-ai
a
Hi I want to get the gcs bucket data and inside the bucket if the folders is older than 2 days it should delte those folders how to do this? @ancient-wolf-19325
a
It could be possible that Flyte itself does not provide a built-in API or command to directly list or delete folders in a GCS bucket based on age. However, you might be able to achieve this by using Google Cloud SDK (gsutil) or Python scripts within a Flyte task, after granting the appropriate permissions to the Flyte service account for your bucket. The process to grant access is described in Enabling Google Cloud Storage, where you add the
<UserFlyteGSA>
as a principal and assign roles like Storage Object Viewer and Storage Object Creator. Though I'm not entirely certain, it might be that you need to implement the logic for listing and deleting objects older than 2 days using Python (e.g., with the
google-cloud-storage
library) inside a Flyte task. Flyte can execute such code if the service account has the necessary permissions. Would you like more detail on how to write such a Flyte task or on the GCS permissions setup? Sources: - Enabling Google Cloud Storage 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.