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
ci: share data between jobs using workspaces #28928
Conversation
d1acaa9
to
b062782
Compare
95cbb79
to
aaf0362
Compare
aaf0362
to
8fa57c9
Compare
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.
the rest looks great. we can rename the name in a follow up PR. I want this change now because it's so good ! :-)
version: 2 | ||
jobs: | ||
lint: | ||
install: |
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.
is install the right name? how about init
or setup
or prepare
? we do much more than just "install"
merge-assistance: if this fails to cherry-pick to patch and the conflict can't be easily resolved, please merge it to master-only and ask @filipesilva to send a separate PR for the patch branch. thanks! |
I think it would be a good idea to capture in the commit message (and PR description) why we did this change (and why "it is so good" 😛). |
@gkalpak I am a bit late to change the commits but added details and comparison to the PR message. |
Followup to #28928 (review) PR Close #28935
Followup to angular#28928 (review) PR Close angular#28935
Followup to #28928 (review) PR Close #28935 PR Close #28965
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the new behavior?
This PR expands usage of the CircleCI workspaces feature to share artifacts between jobs of the same workflow.
The current mindset WRT to artifacts is that we cache some artifacts at the end of the
build-npm-packages
job, which is then restored on each job. This works well even for jobs prior to that specific cache because of partial cache hits.With workspaces the mindset is slightly different. There is an initial job that creates a workspace from the cache, which other jobs use and might enhance.
The key difference is that subsequent jobs do not repeat setup, which can yield different results since part of setup is merging a PR with latest master. Another desirable characteristic of this setup is that it enables easier sharing of artifacts between jobs, and lessens repetition in the circleci configuration.
Here is a sample of comparison of workflows taken roughly at the same time. It's important to capture this comparison at similar times because CircleCI workload varies during the day:
Before: https://circleci.com/workflow-run/155fc8ea-2ea5-45ec-8f75-05f3297f4052
After: https://circleci.com/workflow-run/97e4f222-75f3-426c-bcdf-a583f1524045
Of these we can compare specific jobs:
The gains in individual job setup are lessened by the new common
install
step though. In https://circleci.com/gh/angular/angular/218899 we can see it took 1m58s.Of these, 27s seem to be due to yarn behaviour where
--frozen-lockfile
with a cached directory can still fetch dependencies in some cases (yarnpkg/yarn#5840 (comment)). Updating the AIO lockfile should reduce it to ~2s.The gain on correctness cannot be compared. Under the previous setup it was possible for individual jobs to run over different code.
Further additions to persisted workspace files can also improve performance of subsequent runs.
It's also important to note that this PR also adds caching of AIO node_modules, which wasn't done before.
Does this PR introduce a breaking change?
Other information