Skip to content
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

nginx recursive content routing for non-production environments #4855

Open
wants to merge 4 commits into
base: hotfixes
Choose a base branch
from

Conversation

bjester
Copy link
Member

@bjester bjester commented Dec 6, 2024

Summary

  • Refactors nginx configuration and image to avoid templating, and instead perform a hotswap of configuration files
  • Implements nginx configuration for non-production environments which recursively checks multiple locations for requests to the /content reverse proxy
  • Updates storage emulator and uses embedded bucket creation controlled through docker-compose.yml
  • Adds licensing mention to README considering storage emulator cannot and should not be distributed with Studio-- they have conflicting licenses

Value add

  • This allows us to empty Studio's non-production storage bucket (develop-studio-content) every time we restore a database. Furthermore, this saves us a ton money because we no longer have to replicate storage files from the production bucket.

References

Discussion https://learningequality.slack.com/archives/C0WHZ9FPX/p1733344134300819

Reviewer guidance

  1. Modify your /etc/hosts and set minio to resolve to your machine (this is an unaddressed caveat with running everything through docker-- the internal API needs to use the docker network hostname)
  2. Run the build process docker-compose build
  3. Bring everything up docker-compose up
  4. Verify a content file that only exists in the production bucket can be accessed via localhost:8081. A real example, http://localhost:8081/content/storage/0/d/0d66e3e3c85faf413bc0033dcb6510ce.pdf
  5. Verify a content file that only exists in the development bucket can be accessed via localhost:8081. A real example, http://localhost:8081/content/storage/b/b/bbfad3ef03bc1e08d3c31ad8052ee5b5.pdf
  6. Upload a file to your local Studio instance
  7. Find its URL and ensure it can be accessed via localhost:8081

Post-merge followup

When this is merged, we can proceed with cleaning things up:

  1. Restore a production database to hotfixes and unstable
  2. Empty the development bucket
  3. Remove the nightly storage transfer job

@bjester
Copy link
Member Author

bjester commented Dec 6, 2024

Python tests failed, but they pass locally. I just realized I need to update the Github workflow. On it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant