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

Updates to manifest storage #4430

Merged
merged 6 commits into from
Aug 2, 2018

Conversation

davidfischer
Copy link
Contributor

@davidfischer davidfischer commented Jul 25, 2018

Edit 2018-08-01: I removed the actual storage backends. They will be used in a separate repository with deployment customizations. This PR is now relatively minor.

This builds on #4427. This can be merged into that branch or into master and that one can be closed.

  • Because the manifest storage parses files looking for referenced files (eg. theme.css references fonts) all the referenced files must be there. This fixes a few issues found there.
  • I do question whether readthedocs/core/storage.py should be in this repository and not in our extensions. I don't think it is particularly useful to anyone and is particular to our deploy process.
  • This PR removes the references to this storage in readthedocs/settings/base.py. I think that in dev the default Django storage is fine. This should only be used in prod.
  • There will still be a linting error with this PR as the linter will try to import from Azure and django-storages and fail. I can fix this up although as I mentioned above I think this code might be better elsewhere.

Testing

  • Install dependencies

    $ pip install azure django-storages "azure-storage==0.20.3"
    
  • Set settings (readthedocs/settings/base.py or other appropriate settings)

    STATICFILES_STORAGE = 'readthedocs.core.storage.MediaAzureStorage'
    AZURE_ACCOUNT_NAME = 'YOUR ACCOUNT'
    AZURE_ACCOUNT_KEY = 'YOUR KEY'
    AZURE_CONTAINER = 'media'
    AZURE_MEDIA_STORAGE_CONTAINER = AZURE_CONTAINER
    
  • Collect static files

    $ npm run build      # takes about 10 minutes the first time and 2.5 mins thereafter
    

@davidfischer davidfischer requested a review from a team July 25, 2018 22:56
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, the settings change was just for testing. This can probably all just go in ext since it isn't useful for anyone else running RTD.

@davidfischer
Copy link
Contributor Author

Ok. I'm going to remove the changes to readthedocs/core/storage.py from this PR. The other changes are still required if we want to use manifest storage.

- This will be added to -ext
@ericholscher ericholscher merged commit 42cd557 into master Aug 2, 2018
@ericholscher
Copy link
Member

👍 merging these since they are small simple fixes.

@stsewd stsewd deleted the davidfischer/manifest-storage-update branch August 15, 2018 22:24
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 this pull request may close these issues.

2 participants