Skip to content

Conversation

tillywoodfield
Copy link
Contributor

Depends on #20

Closes #8

session = boto3.session.Session()
return session.client(
"s3",
endpoint_url=f"https://{BUCKET_REGION}.digitaloceanspaces.com/",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole Endpoint URL could be a env var? Allows changing provider easily.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, but then maybe the addressing_style config below should be a config? Maybe then it gets confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I also ran into an issue later down the line where the boto3 client doesn't return the public URL of the uploaded file, so we have to construct that ourselves, which can be different depending on the provider, and it's easier to have all the parts, rather than a single URL. This ended up being the nicest way I could find

Base automatically changed from 18-remove-deleted-datasets to live February 12, 2025 07:03
@tillywoodfield tillywoodfield merged commit 0cf9466 into live Feb 12, 2025
1 check passed
@tillywoodfield tillywoodfield deleted the 8-storage-bucket branch February 12, 2025 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store ingested files in a cloud storage bucket instead of on the local filesystem
2 participants