-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Update build with "Pulling cache" when downloading the cache #6800
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
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4135bcc
Update build with "Pulling cache" when downloading the cache
humitos 28e3944
Migration file for new Build state
humitos d463e3d
Show "Pushing cache" status before finishing the build
humitos e2b8777
Show "Uploading" state when uploading artifacts to storage
humitos 09ae249
Merge branch 'master' into humitos/pulling-cache-status
humitos f56e8de
Update migration file
humitos 37c0781
Merge pull request #6810 from readthedocs/humitos/uploading-build-state
ericholscher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
readthedocs/builds/migrations/0015_pulling_cache_build_state.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.11 on 2020-03-24 15:59 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('builds', '0014_migrate-doctype-from-project-to-version'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='build', | ||
name='state', | ||
field=models.CharField(choices=[('triggered', 'Triggered'), ('pulling-cache', 'Pulling cache'), ('cloning', 'Cloning'), ('installing', 'Installing'), ('building', 'Building'), ('pushing-cache', 'Pushing cache'), ('finished', 'Finished')], default='finished', max_length=55, verbose_name='State'), | ||
), | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It would be good to call this something that works for both pushing & pulling, perhaps
Updating cache
.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.
If we want this, we will need to change how we handle the FINISHED status.
Currently, the build is first marked as FINISHED and then the push is performed. The FINISHED status is sent when we leave the context manager of the environment (
__exit__
) and the cache is pushed after that only if the build was successful.Taking a look at the code, it seems that our options are:
__exit__
methodupdate_on_success=False
when initializing the environment and update the build status to FINISHED manually after pushing the cache.I think that 2) is our better option since it uses the API we already have in the code to avoid updating the status automatically.
If we are going in this direction, why not to add an specific status for each operation? Pulling/Pushing or Downloading/Uploading or similar.
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.
I went ahead and implemented 2).
It shows "Pushing cache" if the project has the feature and the build is marked as finished outside the
__exit__
method. With these changes, the total build time will count pulling/pushing the cache as well, so it will be more realistic.