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

feat(ci): try fetching olean caches from older commits #2278

Merged
merged 17 commits into from
Mar 30, 2020

Conversation

bryangingechen
Copy link
Collaborator

Currently, during CI, we search for oleans on Azure using the lean_file_hash. If nothing matches, then we give up and build from scratch.

This PR changes the fetch_olean_cache.sh script so that if the above search fails, we attempt to look for olean caches using the first 10 commits in git log --first-parent. This should save quite a bit of build time for commits that only touch files which aren't imported by very much.

For testing, I made some docstring formatting edits (splitting long lines, removing indentation) to surreal.lean since it isn't imported by any other files. See an example result here, corresponding to commit d097188.

@bryangingechen bryangingechen added CI This issue or PR is about continuous integration awaiting-review The author would like community review of the PR labels Mar 29, 2020
@bryangingechen bryangingechen changed the title feat(ci): try fetchnig older branch oleans feat(ci): try fetching older branch oleans Mar 29, 2020
@bryangingechen bryangingechen changed the title feat(ci): try fetching older branch oleans feat(ci): try fetching olean caches from older commits Mar 29, 2020
.github/workflows/build.yml Outdated Show resolved Hide resolved
scripts/fetch_olean_cache.sh Show resolved Hide resolved
@gebner gebner added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Mar 29, 2020
@bryangingechen bryangingechen added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Mar 29, 2020
scripts/fetch_olean_cache.sh Outdated Show resolved Hide resolved
scripts/fetch_olean_cache.sh Show resolved Hide resolved
@gebner gebner added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Mar 29, 2020
@mergify mergify bot merged commit 7dad872 into master Mar 30, 2020
@bryangingechen bryangingechen deleted the try_fetch_older_olean branch March 30, 2020 02:23
mergify bot pushed a commit that referenced this pull request Apr 4, 2020
PR #2048 changed the CI so that olean caches are not pushed to Azure if a later commit on the same branch occurs. The reasoning was that it was unlikely that anyone would fetch those caches. That's changed as of #2278, since `fetch_olean_cache.sh` now looks for caches from commits earlier in the history. This means that currently, we can observe the following wasteful sequence of events in several PRs (e.g. #2258):

1. commit A gets pushed to a certain branch and CI_A starts.
2. While CI_A is still running the `leanpkg build` step, commit B is pushed and CI_B starts.
3. CI_A finishes `leanpkg build` but doesn't upload its cache to Azure because of #2048 
4. Now commit C is pushed and can't use the results of CI_A
5. CI_B finishes `leanpkg build` but doesn't upload its cache
6. Commit D is pushed and can't use the results of CI_A or CI_B ...

(This can keep happening as long as the next commit arrives before the most recent CI uploads to Azure).

I also cleaned up some stuff that was left over from when we ran the build on both "pr" and "push" events.
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
…mmunity#2278)

* feat(ci): try fetching older branch oleans

* docstring edits for set_theory.surreal

* debug

* debug 2

* formatting

* try fetching

* just increase depth

* improve script, improve surreal docstrings

* env context

* quieter curl

* fix overwriting

* git clean

* ci test: delete surreal.lean

* fix env var GIT_HISTORY_DEPTH

* add back surreal

* reviewer comments

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
PR leanprover-community#2048 changed the CI so that olean caches are not pushed to Azure if a later commit on the same branch occurs. The reasoning was that it was unlikely that anyone would fetch those caches. That's changed as of leanprover-community#2278, since `fetch_olean_cache.sh` now looks for caches from commits earlier in the history. This means that currently, we can observe the following wasteful sequence of events in several PRs (e.g. leanprover-community#2258):

1. commit A gets pushed to a certain branch and CI_A starts.
2. While CI_A is still running the `leanpkg build` step, commit B is pushed and CI_B starts.
3. CI_A finishes `leanpkg build` but doesn't upload its cache to Azure because of leanprover-community#2048 
4. Now commit C is pushed and can't use the results of CI_A
5. CI_B finishes `leanpkg build` but doesn't upload its cache
6. Commit D is pushed and can't use the results of CI_A or CI_B ...

(This can keep happening as long as the next commit arrives before the most recent CI uploads to Azure).

I also cleaned up some stuff that was left over from when we ran the build on both "pr" and "push" events.
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 16, 2020
…mmunity#2278)

* feat(ci): try fetching older branch oleans

* docstring edits for set_theory.surreal

* debug

* debug 2

* formatting

* try fetching

* just increase depth

* improve script, improve surreal docstrings

* env context

* quieter curl

* fix overwriting

* git clean

* ci test: delete surreal.lean

* fix env var GIT_HISTORY_DEPTH

* add back surreal

* reviewer comments

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 16, 2020
PR leanprover-community#2048 changed the CI so that olean caches are not pushed to Azure if a later commit on the same branch occurs. The reasoning was that it was unlikely that anyone would fetch those caches. That's changed as of leanprover-community#2278, since `fetch_olean_cache.sh` now looks for caches from commits earlier in the history. This means that currently, we can observe the following wasteful sequence of events in several PRs (e.g. leanprover-community#2258):

1. commit A gets pushed to a certain branch and CI_A starts.
2. While CI_A is still running the `leanpkg build` step, commit B is pushed and CI_B starts.
3. CI_A finishes `leanpkg build` but doesn't upload its cache to Azure because of leanprover-community#2048 
4. Now commit C is pushed and can't use the results of CI_A
5. CI_B finishes `leanpkg build` but doesn't upload its cache
6. Commit D is pushed and can't use the results of CI_A or CI_B ...

(This can keep happening as long as the next commit arrives before the most recent CI uploads to Azure).

I also cleaned up some stuff that was left over from when we ran the build on both "pr" and "push" events.
cipher1024 pushed a commit to cipher1024/mathlib that referenced this pull request Mar 15, 2022
PR leanprover-community#2048 changed the CI so that olean caches are not pushed to Azure if a later commit on the same branch occurs. The reasoning was that it was unlikely that anyone would fetch those caches. That's changed as of leanprover-community#2278, since `fetch_olean_cache.sh` now looks for caches from commits earlier in the history. This means that currently, we can observe the following wasteful sequence of events in several PRs (e.g. leanprover-community#2258):

1. commit A gets pushed to a certain branch and CI_A starts.
2. While CI_A is still running the `leanpkg build` step, commit B is pushed and CI_B starts.
3. CI_A finishes `leanpkg build` but doesn't upload its cache to Azure because of leanprover-community#2048 
4. Now commit C is pushed and can't use the results of CI_A
5. CI_B finishes `leanpkg build` but doesn't upload its cache
6. Commit D is pushed and can't use the results of CI_A or CI_B ...

(This can keep happening as long as the next commit arrives before the most recent CI uploads to Azure).

I also cleaned up some stuff that was left over from when we ran the build on both "pr" and "push" events.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI This issue or PR is about continuous integration ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants