Skip to content

Use minio instead of postgres locally #463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jyn514 opened this issue Nov 2, 2019 · 4 comments · Fixed by #597
Closed

Use minio instead of postgres locally #463

jyn514 opened this issue Nov 2, 2019 · 4 comments · Fixed by #597

Comments

@jyn514
Copy link
Member

jyn514 commented Nov 2, 2019

Discussed on discord:

@QuietMisdreavus @jynelson btw... if we want to "bless" docker-compose we could add minio to it (to replicate s3) and completly ditch storing files in the db

QuietMisdreavusYesterday at 4:32 PM
true, if there's a stock minio container then we could do that

pietroalbiniYesterday at 4:33 PM
yeah -- https://docs.min.io/docs/minio-docker-quickstart-guide

QuietMisdreavusYesterday at 4:34 PM
my current dev server would have to start running minio but that sounds fairly easy
based on your descriptions

jynelsonYesterday at 4:42 PM
minio is like s3 but locally? I like databases, but that would allow us to get rid of the database code which sounds nice ..

I think this involves spinning up a minio container instead of a postgres container and using rusoto_s3 to interact with it. @pietroalbini would know more.

@pietroalbini
Copy link
Member

minio wouldn't replace PostgreSQL altogether: on production we store documentation files in S3, and the rest (queue, build logs, releases...) on PostgreSQL. Adding minio locally would allow us to get rid of parts of the database code, but more importantly align the development environment with production.

@yvrhdn
Copy link

yvrhdn commented Feb 6, 2020

Hi 👋 I would like to dive into this.

@jyn514
Copy link
Member Author

jyn514 commented Feb 6, 2020

@koenaad 👋 I've never used minio myself, so you'll have to experiment with that. Here are some of the things you'll have to modify, though:

  • Add a new minio container to the docker-compose.yml file. Make sure you give it a persistent volume.
  • Set the AWS_ACCESS_KEY_ID and S3_ENDPOINT environment variables in the docker-compose file (it will be read in src/db/file.rs)
  • ... possibly other things?

This is the actual code for uploading files: https://github.com/rust-lang/docs.rs/blob/master/src/db/file.rs#L214

@jyn514 jyn514 added the wishlist label Feb 6, 2020
@yvrhdn
Copy link

yvrhdn commented Feb 6, 2020

Thanks for the pointers @jyn514. Don't have any experience with minio either, but I'll simply spin up the docker and see what I can do with it 😃

jyn514 pushed a commit that referenced this issue Feb 9, 2020
jyn514 pushed a commit that referenced this issue Feb 9, 2020
docs.rs expects there to be a bucket 'rust-docs-rs', the minio Docker
image does not provide a nice way to launch with a default bucket.

As a workaround, we have to override the entrypoint to do some work
before starting the minio server. When the minio server is launched
with a directory that is not empty, it will interpret the directories
present as buckets it needs to create. So by adding an empty directory
'rust-docs-rs', we can trick minio in creating a similarly named
bucket.

This solution is a mixture of the following comments:
 - minio/minio#4769 (comment)
 - minio/minio#4769 (comment)
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 a pull request may close this issue.

3 participants