appsembler / configuration

a simple, but flexible, way for anyone to stand up an instance of the edX platform that is fully configured and ready-to-go
GNU Affero General Public License v3.0
14 stars 13 forks source link

RED-2148: Pretend that Studio serves static files; fixes video player editing issues #369

Closed OmarIthawi closed 3 years ago

OmarIthawi commented 3 years ago

RED-2148: TL;DR: Studio doesn't support S3 static files hosting but we needed to set it up until we have image-based deployments.

studio.edx.org serves the files via CloudFlare, so we this fix makes Studio frontend thinks that it's loading the S3 files from the Tahoe studio.tahoe.appsembler.com/static/ directory.

This fix ensures that vendor/requirejs/text.js can load the static files via XHR instead of trying to load it via <script> tag

This fix resolves the issue described in https://appsembler.atlassian.net/browse/RED-2148?focusedCommentId=35118

OmarIthawi commented 3 years ago

@thraxil I'll need your help on this one, it's a draft more than a working code.

thraxil commented 3 years ago

OK. I've got a test deploy of this set up. Found some issues that I'll be fixing this afternoon.

OmarIthawi commented 3 years ago

OK. I've got a test deploy of this set up. Found some issues that I'll be fixing this afternoon.

Thank you so much! I really appreciate it.

thraxil commented 3 years ago

@OmarIthawi Made a couple small fixes and deployed this to staging (just the nginx config part; Django is still using the old S3 URL). You can now request a file like:

https://studio.tahoe-us-juniper-staging.appsembler.com/static/studio/edx-theme-codebase/css/cms-style-vendor.e0061511be54.css

or https://studio.tahoe-us-juniper-staging.appsembler.com/static/studio/index.js

And they are proxying over to S3. We could still add some additional caching and improve some things with the proxy headers, but since nginx is setting cache expiration headers on most requests, I don't think those will make a big difference in performance. We can do those in a later PR if we are still seeing performance issues with studio static files.

OmarIthawi commented 3 years ago

Thanks a lot Anders for taking over this.