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
Migrate to Cloudflare CDN? #1317
Comments
MaxCDN is discontinuing their sponsorship program, which since 2013 has provided DevDocs with free CDN. freeCodeCamp already uses Cloudflare extensively, so we should look to migrate soon.
Rule 104173 adds the
Lastly, the doc packages downloaded by I recommend migrating by setting up new subdomains on |
@Thibaut, thanks for the insights in the current infrastructure setup. A few questions:
For a migration away from MaxCDN we would need to…
Here's my updated understanding of the infrastructure: graph TB
devdocs_user(user on devdocs.io)
thor_up(thor docs:upload)
Travis(Travis CI)
thor_down(thor docs:download)
subgraph domains
devdocs.io
cdn.devdocs.io
devdocs.devdocs.netdna-cdn.com
dl.devdocs.io
docs.devdocs.io
devdocs-assets.s3.amazonaws.com
devdocs-dl.devdocs.netdna-cdn.com
end
subgraph servers
Heroku
S3[(S3)]
MaxCDN[(MaxCDN)]
end
devdocs_user --> docs.devdocs.io --"+CORS headers"--> devdocs-assets.s3.amazonaws.com --> S3
devdocs_user --> cdn.devdocs.io --> devdocs.devdocs.netdna-cdn.com --"only assets"--> devdocs.io
devdocs_user --> devdocs.io --"CloudFlare"--> Heroku
dl.devdocs.io --> devdocs-dl.devdocs.netdna-cdn.com --> MaxCDN
Travis -.-> thor_down --> dl.devdocs.io
Travis -.-> Heroku
thor_up -.-> S3
thor_up -.-> MaxCDN
|
In the MaxCDN control panel. The freeCodeCamp team should have access.
All those rules are in the screenshots. I meant that for example if we didn't re-implement the rule that adds the
I would implement an alternative CDN subdomain.
Yep that'd work; S3 for example. Although we wouldn't even need a CDN in front unless that happens to reduce costs. This bit only powers the
Looks accurate. |
Thanks again for looking into this @simon04 and @Thibaut for confirming. My current plan is just S3 to store everything with Cloudflare in front and some extra caching (if necessary) to minimise the transfers from S3. That and some proxies to make sure all the rules get applied.
Am I right in thinking this is only used in local development? Or is there another use? |
It's also used in Travis CI for deploying to Heroku as sanity check. See https://travis-ci.com/github/freeCodeCamp/devdocs/builds/201642794#L1107 for an example where the check (and thus the deployment) failed because I forgot to |
Ah, good to know. I searched for It sounds like it would be better to put this behind the CDN, given that it's every doc and happens on every merge to master. |
@ojeytonwilliams, out of curiosity: How're you doing in the CDN migration process? Do you need any help? |
It's going reasonably well, I just had to focus on a few other things. Those are more or less under control now, so I should be able to dedicate myself to this again. Thanks for the offer of help. I need to change a few bits of the code (various hard-coded links to the existing infrastructure, mainly), so I'll definitely reach out if I get horribly confused. Also, how's your Nginx knowledge - could I run things by you if it's being weird? |
I do operate a few Nginx servers with a bunch of more or less complex directives |
Awesome. Well, I've not run into huge problems yet, but I'll reach out if I get stuck. Either way, a quick review of the configs before we put them into use would be great. |
Hey, sorry for the long delay. To be transparent, the fCC team has been making a big push to get freecodecamp.org ready for translation and I've been heavily involved with that. My part in that is largely over, though, so now I can rededicate myself to this. I've set up a staging site up at devdocs.in which replaces the Part of the delay was that I tried to maintain the existing structure whereby the assets were proxied to Finally, the proxying to docs.devdocs and dl.devdocs isn't 100% done, but I've been making good progress and that's my next task. |
Wow, this sounds very promising. As expected, I couldn't find any obvious problems when clicking around on https://devdocs.in/. The docs are fetched from Your question regarding nginx redirects does not ring a bell. I'd probably have to call to mind the infrastructure from #1317 (comment) again. Since you've already resolved the issue, this is no longer required... |
This should be resolved now. Thanks for bearing with me while I figured out how to do this. Since it's live, I'm going to close this. If anyone notices any problems because of the migration, we can track them in new issues. |
Awesome, @ojeytonwilliams! Thank you for finishing this monster task. 🚀 |
You're very welcome, Simon, and thanks for putting together the infrastructure charts. They really helped me understand how things came together. It was a fun challenge and I'm glad that it seems to have been a smooth transition. |
Impressive! I can confirm that traffic on MaxCDN has completely stopped. This is a big step towards making DevDocs a sustainable long-term project. Thank you so much! |
The workflow was no longer working due to upstream CDN changes. See freeCodeCamp/devdocs#1317
* Make it work after upstream changes The workflow was no longer working due to upstream CDN changes. See freeCodeCamp/devdocs#1317
As discussed with @ojeytonwilliams, @raisedadead, @j-f1, @jmerle on 2020-11-12, we could/should investigate whether a migration from MaxCDN to Cloudflare CDN is feasible.
https://www.cloudflare.com/en-gb/cdn/
The text was updated successfully, but these errors were encountered: