-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Only copy HTML build output to web servers #6326
Conversation
We do not need to copy localmedia, search, pdf and epub anymore because they are uploaded to Cloud storage and served from there directly via django-storages.
There are some test failures here to address before review maybe. So far the change looks good! I won't sign off on it just yet as I think @davidfischer can provide the best feedback around storage and our asset syncing. I'm excited to get closer to not having web disks around though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, this may still needed for local development while we still use readthedocs.builds.syncers.LocalSyncer (won't be needed anymore if we decide to use #6295, though)
We can just use a local file system storage backend, I think we already do actually.
There are more things that can be removed. Actually, all parameters that are not html
can be removed from those functions.
Wouldn't that break file syncing on the commercial site, where we are not yet serving files from remote storage? |
I thought that we were serving files from remote storage if the
I think we can remove that condition since this URL ( readthedocs.org/readthedocs/projects/views/public.py Lines 311 to 312 in f41a84d
So, I think there is no need to keep serving files from disk in corporate. |
We can't remove them all because they are used to call an API endpoint that set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I think there is no need to keep serving files from disk in corporate.
If we feel comfortable serving from S3 for corporate, that's fine. I figured by just using S3 for search at first, we could ease into more "storage" features on corporate. I'm fine speeding that process up.
PDFs and ePubs are currently served from disk but we could change that and that was my eventual plan. I'd like to get the settings and setup between community and corporate as close as possible (using cloud storage, serving from storage, etc.). We can't merge this until PDFs and ePubs are served from storage AND we have copied all the existing ones into storage.
@@ -1207,61 +1200,6 @@ def move_files( | |||
target = version.project.rtd_build_path(version.slug) | |||
Syncer.copy(from_path, target, host=hostname) | |||
|
|||
if search: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I'm fine removing this (large) block of code although I have no idea if there are any private installs using it. We probably want to make that clear in the changelog.
Eventually however, it's likely that the entire move_files
function can be removed as everything will be done with storage. I like this solution because it doesn't treat HTML as a special case separate from PDFs or ePubs which has been the source of some problems. We will also then be able to remove the syncers entirely.
Are you talking about corporate, community or both? My guess is that we are serving PDFs and ePubs in community from storage and in corporate from disk. |
Some good points were raised here:
I'm 👍 going in this direction. |
Hrm... Another idea, maybe easier and that does not need code changes, could be to use the |
Just corporate. On community, ePubs and PDFs are served from cloud storage. |
For now, yes. Longer term, I think we'll reverse proxy to storage. |
@agjohnson I updated the tests and all of them should be passing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me once we have downloads serving properly from .com 👍
Of note, I'd like to hold off merging this until after the deploy when we start serving via proxito. I like having a good deprecation path, instead of turning off the old thing in the same deploy when we turn on the new thing. Especially in this case, once this code is deployed, it's going to be almost impossible to revert, because we won't have the files on disk, and will have to try and copy them back down from cloud hosting. |
This was deployed yesterday and it's working. We can plan to merge this PR and deploy on next release. |
From our talk in chat:
|
To clarify where we are with this PR: the worry here is about backwards compatibility and we will be timing this at the same time as removing HTML syncing, to make one tidy backwards incompatible release. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
We are probably closed to serve all the docs via El Proxito and remove all this code completely at this point. I'm not sure if it worth to keep this PR open or even merge it before #6535 |
I think we can close this, and take a larger approach addressing a full removal of this code at some point. |
We do not need to copy localmedia, search, pdf and epub anymore because they are uploaded to Cloud storage and served from there directly via django-storages.
This PR removes this code completely because we don't really need anymore. Although, this may still needed for local development while we still use
readthedocs.builds.syncers.LocalSyncer
(won't be needed anymore if we decide to use #6295, though)Another possibility here is to modify
readthedocs.builds.syncers.RemotePuller
(used in production) to skip these paths. This will keepLocalSyncer
to continue working on development.Our corporate site is going to start using Cloud storage soon, so this PR also makes sense in that context as well. Although, that should happen in Corporate before merging this PR here.