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

Enable ccache in travis #6370

Merged
merged 1 commit into from
Dec 15, 2018
Merged

Enable ccache in travis #6370

merged 1 commit into from
Dec 15, 2018

Conversation

junghans
Copy link
Contributor

@junghans junghans commented Nov 18, 2017

This is save time in build tests phase

@junghans
Copy link
Contributor Author

@tgamblin @scheibelp

Copy link
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a line here needs to be removed

@alalazo alalazo dismissed their stale review January 15, 2018 14:32

The review comment didn't appear

Copy link
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one line here needs to be remove. And sorry for the noise.

.travis.yml Outdated Show resolved Hide resolved
Copy link
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have numbers on how much time will be saved for build tests?

@junghans
Copy link
Contributor Author

I only helps once you have a cache, but for the mpich builds in phase 3 of Travis CI it saved a min or so.

@alalazo
Copy link
Member

alalazo commented Jan 15, 2018

😢 I hoped more, but a min is better than nothing

@alalazo
Copy link
Member

alalazo commented Jan 18, 2018

Restarted CI.

@alalazo alalazo closed this Jan 20, 2018
@alalazo alalazo reopened this Jan 20, 2018
@adamjstewart adamjstewart added tests General test capability(ies) performance travis labels Mar 23, 2018
@alalazo
Copy link
Member

alalazo commented Jun 27, 2018

@junghans Recently I had to work on a C++ project. Bottomline, I had a much higher cache hit rate by adding:

addons:
  apt:
    sources:
      - sourceline: 'ppa:likemartinma/devel'
    packages:
      - ccache
      - ...
cache: 
  ccache: true
  ...

before_install:
   - ccache -M 2G
...

which updates ccache to the latest release, and increases the cache size. That said, I'd like to get this merged if the time for build tests is reduced noticeably 😅

@junghans
Copy link
Contributor Author

Fine with me, ping @tgamblin @scheibelp

@junghans
Copy link
Contributor Author

@adamjstewart all added.

@junghans
Copy link
Contributor Author

ping @scheibelp

@scheibelp
Copy link
Member

I'll be able to look at this by tomorrow (8/1)

Copy link
Member

@scheibelp scheibelp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions:

- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then virtualenv venv; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source venv/bin/activate; fi
- ccache -M 2G && ccache -z
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this move after the next line on osx (otherwise, how is ccache found there?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the line below it to add the compiler wrappers to the path, ccache is already in the path.

@junghans
Copy link
Contributor Author

junghans commented Aug 2, 2018

@scheibelp, added ccache: True.

To answer your other question, the ccache compiler wrapper are used by spack, so spack doesn't know it is ccached.

@scheibelp
Copy link
Member

To answer your other question, the ccache compiler wrapper are used by spack, so spack doesn't know it is ccached.

Sorry but I'm not clear how that is coming about: is ccache placing a wrapper in /usr/bin/gcc (for example, or otherwise presenting itself as the compiler)?

@junghans
Copy link
Contributor Author

junghans commented Aug 2, 2018

It places a wrapper in /usr/lib/ccache and export PATH=/usr/lib/ccache:$PATH make spack pick up the gcc from in there instead of /usr/bin.

@scheibelp
Copy link
Member

I think I get it now. I wish this took advantage of #3761 to get spack to use ccache explicitly. If ccache creates wrappers for all instances of gcc on PATH then the PR as is should work fine. I'd prefer not to have to reason about that though (and if something ever goes wrong with that I think we'd suddenly lose ccache benefits without knowing it).

I think that would be as simple as creating share/spack/qa/configuration/config.yaml:

config:
  ccache: true

@scheibelp
Copy link
Member

Thanks! However: it looks like you updated .travis.yml but did not add the customized config.yaml

@junghans
Copy link
Contributor Author

junghans commented Aug 3, 2018

Doh!

@junghans
Copy link
Contributor Author

junghans commented Aug 3, 2018

@scheibelp Better now?

@scheibelp
Copy link
Member

This seems very clear to me so thanks for that update.

However now I'm looking at sourceline: 'ppa:likemartinma/devel' - where did that come from? Is there a more-official source for this?

@alalazo
Copy link
Member

alalazo commented Dec 13, 2018

Closed and reopened to trigger a re-build

@alalazo
Copy link
Member

alalazo commented Dec 13, 2018

@adamjstewart I was wondering if this could be beneficial to avoid Travis erroring out when it builds mpich.

@alalazo
Copy link
Member

alalazo commented Dec 13, 2018

@junghans Can you push any change, or rebase on develop, to see how many cache hits do we get?

@adamjstewart
Copy link
Member

Yeah, if this helps with the mpich builds, that would be great!

@junghans
Copy link
Contributor Author

@alalazo Done

@junghans
Copy link
Contributor Author

@alalazo: search for ccache -s in log to see the hit rate.

@alalazo

This comment has been minimized.

@alalazo

This comment has been minimized.

@junghans

This comment has been minimized.

@alalazo

This comment has been minimized.

@junghans

This comment has been minimized.

.travis.yml Outdated Show resolved Hide resolved
@junghans
Copy link
Contributor Author

caching seems to work again.

@alalazo
Copy link
Member

alalazo commented Dec 14, 2018

@junghans I give up: I think I restarted the mpich build ~10 times and they always fail due to time-out (the failure obviously not being related to this PR).

@alalazo
Copy link
Member

alalazo commented Dec 14, 2018

@junghans I am not strongly opposed to travis_wait, but I tried to avoid it because if the runner stalls for any other reason than waiting a for a long build to finish (e.g. network) we'll wait 20 mins. before failing instead of 10.

#10105 is an alternative solution that does not use travis_wait

EDIT: Travis failed with a 20 min. time-out 😭

@junghans
Copy link
Contributor Author

@alalazo, rebased and works!

@alalazo
Copy link
Member

alalazo commented Dec 14, 2018

Great! @tgamblin Can we merge this?

@alalazo alalazo merged commit 71a86bb into develop Dec 15, 2018
@alalazo alalazo deleted the features/ccache branch December 15, 2018 09:52
@alalazo
Copy link
Member

alalazo commented Dec 15, 2018

@tgamblin PR merged

LimitlessGreen added a commit to LimitlessGreen/OpenHDKernelBuilder that referenced this pull request Jul 21, 2020
LimitlessGreen added a commit to LimitlessGreen/OpenHDKernelBuilder that referenced this pull request Jul 21, 2020
LimitlessGreen added a commit to LimitlessGreen/OpenHDKernelBuilder that referenced this pull request Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance tests General test capability(ies) travis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants