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

Add job to upload pre-rendered versions files to S3 #3775

Merged
merged 1 commit into from May 7, 2023

Conversation

segiddins
Copy link
Member

This way, the rails app won't need to serve so many compact index requests per second.

VCL to enable this is in progress.
As a follow-up, we can also upload info files into S3 for the same reason, though that is lower priority.

@segiddins segiddins requested a review from indirect May 7, 2023 22:02
@@ -128,6 +128,7 @@ def after_write
Mailer.gem_pushed(user.id, @version_id, notified_user.id).deliver_later
end
Indexer.perform_later
UploadVersionsFileJob.perform_later
ReindexRubygemJob.perform_later(rubygem:)
GemCachePurger.call(rubygem.name)
Copy link
Member

Choose a reason for hiding this comment

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

Does this need any changes to be delayed until after the background job to update the compact index has completed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not right now -- when we change to serving from S3 by default, we probably want to remove the versions purge from GemCachePurger and only call it in UploadVersionsFileJob, but since we're explicitly only purging the S3 file in UploadVersionsFileJob (and also not serving it by default, see the VCL PR), I think we're good for now

@codecov
Copy link

codecov bot commented May 7, 2023

Codecov Report

Merging #3775 (4b3e1c2) into master (a62fce6) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3775   +/-   ##
=======================================
  Coverage   98.80%   98.81%           
=======================================
  Files         212      213    +1     
  Lines        5199     5220   +21     
=======================================
+ Hits         5137     5158   +21     
  Misses         62       62           
Impacted Files Coverage Δ
app/controllers/api/compact_index_controller.rb 100.00% <100.00%> (ø)
app/jobs/upload_versions_file_job.rb 100.00% <100.00%> (ø)
app/models/pusher.rb 95.38% <100.00%> (+0.03%) ⬆️
lib/rubygem_fs.rb 96.63% <100.00%> (+0.11%) ⬆️

@segiddins segiddins force-pushed the segiddins/s3-versions-file branch from 2ea94ad to 5f22e2c Compare May 7, 2023 22:20
@segiddins segiddins force-pushed the segiddins/s3-versions-file branch from 5f22e2c to 4b3e1c2 Compare May 7, 2023 22:31
@indirect indirect merged commit 368c55b into master May 7, 2023
11 checks passed
@indirect indirect deleted the segiddins/s3-versions-file branch May 7, 2023 22:44
@rubygems-org-shipit rubygems-org-shipit bot temporarily deployed to staging May 7, 2023 22:57 Inactive
@rubygems-org-shipit rubygems-org-shipit bot temporarily deployed to production May 8, 2023 05:40 Inactive
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.

None yet

2 participants