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

cache only the downloaded bottles in ~/Library/Caches/Homebrew instead #1026

Merged
merged 2 commits into from
Oct 1, 2020

Conversation

jieru-hu
Copy link
Contributor

@jieru-hu jieru-hu commented Sep 30, 2020

Motivation

We've been experiencing a lot of macos tests failures with brew, which seems might be related with caching

#!/bin/bash --login -eo pipefailbrew updatebrew upgrade gitbrew install fish
Connection to github.com closed by remote host.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
To restore the stashed changes to /usr/local/Homebrew run:
  'cd /usr/local/Homebrew && git stash pop'
To restore the stashed changes to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask run:
  'cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask && git stash pop'
To restore the stashed changes to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions run:
  'cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions && git stash pop'
Updated 3 taps (homebrew/cask-versions, homebrew/cask and adoptopenjdk/openjdk).

I reached out to circleCI support and they suggested that we should only cache the downloaded bottles.

Response from them below:

I have experienced slow pulls from homebrew-core repository recently and it could be related.
Also, you are seeing these Homebrew messages, because you are caching the Homebrew metadata, and doing this also could lead to many problems.
I advice you to cache only the downloaded bottles in ~/Library/Caches/Homebrew instead. It will only take a few seconds to install.

  - run:
      name: Preparing environment - Brew
      command: |
        brew update
        brew upgrade git
        brew install fish
        brew cleanup # Optional step: cleanup old bottles
  - save_cache:
        paths: ~/Library/Caches/Homebrew

Have you read the Contributing Guidelines on pull requests?

Yes/No

Test Plan

CI should pass.

Related Issues and PRs

(Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 30, 2020
@jieru-hu
Copy link
Contributor Author

jieru-hu commented Sep 30, 2020

Well, same issues still occurs https://app.circleci.com/pipelines/github/jieru-hu/hydra/590/workflows/3eb9766e-734e-4dfe-9fed-d5002fc905eb/jobs/6418
Even with no caching :(
Seems like a brew issue then?

will investigate further.

@jieru-hu
Copy link
Contributor Author

open issue with brew Homebrew/homebrew-core#61772

I think it's still worth to land this PR though. so i'm keeping it open :)

@jieru-hu jieru-hu marked this pull request as ready for review October 1, 2020 16:38
@jieru-hu jieru-hu requested a review from omry October 1, 2020 16:38
@omry
Copy link
Collaborator

omry commented Oct 1, 2020

CI is failign due to something with Ax, can you take a look?

@jieru-hu
Copy link
Contributor Author

jieru-hu commented Oct 1, 2020

CI is failign due to something with Ax, can you take a look?

yea I was planning on following up on that today, but saw that you got it resolved in a separate thread :)

@omry omry merged commit bd1be13 into facebookresearch:master Oct 1, 2020
@jieru-hu jieru-hu deleted the macos_cache branch July 20, 2021 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants