Adding Pip cache directory to replace special cache directive. #5281
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.
Explanation
It has been a few days after my #5244 was merged and yet, Travis was still installing codecov and pyyaml on start. Pics from build 11932.1 on develop:
This means that codecov and pyyaml was not cached at all.
In the spirit of careful investigation for every line of code written, I dig up the related #1640 and its parent issue #1636. Toward the end of #1636 thread, pip cache was dropped due to instability and ruled ineffective due to variable time.
We have since grown from running 3 jobs to 13 jobs. Every seconds saved is tangible imo. I started to look into why pip modules are not getting cached. Here is my finding. I then made the changes and tested on my own Oppia's Travis. Here is pic from my Travis's job 138.1 of branch viet_branch_5222:
As you can see, cached pyyaml shaved 8 secs off that one job. 8 x 13 = 104 secs, less than 2 minutes for each PR. In the grand scheme of things, 2 minutes are not a lot but is still worthy of a PR for me!
Checklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.