Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upci: share data between jobs using workspaces #28928
Conversation
googlebot
added
the
cla: yes
label
Feb 22, 2019
filipesilva
force-pushed the
filipesilva:circleci-workspace
branch
8 times, most recently
from
d1acaa9
to
b062782
Feb 22, 2019
benlesh
added
the
comp: build & ci
label
Feb 22, 2019
ngbot
bot
added this to the needsTriage milestone
Feb 22, 2019
filipesilva
force-pushed the
filipesilva:circleci-workspace
branch
3 times, most recently
from
95cbb79
to
aaf0362
Feb 22, 2019
filipesilva
force-pushed the
filipesilva:circleci-workspace
branch
from
aaf0362
to
8fa57c9
Feb 22, 2019
filipesilva
marked this pull request as ready for review
Feb 22, 2019
filipesilva
requested a review
from angular/fw-dev-infra
as a
code owner
Feb 22, 2019
IgorMinar
approved these changes
Feb 22, 2019
|
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: |
This comment has been minimized.
This comment has been minimized.
IgorMinar
Feb 22, 2019
Member
is install the right name? how about init or setup or prepare? we do much more than just "install"
This comment has been minimized.
This comment has been minimized.
|
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! |
benlesh
added
PR target: master-only
and removed
PR target: master & patch
labels
Feb 22, 2019
benlesh
closed this
in
f0989b7
Feb 22, 2019
filipesilva
deleted the
filipesilva:circleci-workspace
branch
Feb 22, 2019
added a commit
to filipesilva/angular
that referenced
this pull request
Feb 22, 2019
gregmagolan
referenced this pull request
Feb 22, 2019
Closed
Fix saucelabs_test cronjob in CI #28939
added a commit
to filipesilva/angular
that referenced
this pull request
Feb 25, 2019
filipesilva
referenced this pull request
Feb 25, 2019
Closed
ci: add bazel_repository_cache to CircleCI workspace #28935
This comment has been minimized.
This comment has been minimized.
|
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" |
This comment has been minimized.
This comment has been minimized.
|
@gkalpak I am a bit late to change the commits but added details and comparison to the PR message. |


filipesilva commentedFeb 22, 2019
•
edited
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-packagesjob, 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
installstep 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-lockfilewith 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