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

All compilation requests result in a cache miss #357

Closed
AliAskari opened this issue Jan 17, 2019 · 4 comments
Closed

All compilation requests result in a cache miss #357

AliAskari opened this issue Jan 17, 2019 · 4 comments

Comments

@AliAskari
Copy link

I am trying to setup sccache with a minio server on my CI servers to build my C++ projects. I have built and installed sccache with all features and in release configuration from latest master commit and sccache is installed under /root/.cargo/bin/sccache.

I am using cmake and ninja generator and this is how I am integrating sccache with cmake

cmake ../src -GNinja -DCMAKE_CXX_COMPILER_LAUNCHER=/root/.cargo/bin/sccache

before building my project I exported the following variables and started the sccahe server on my CI build server:

export SCCACHE_BUCKET=my-cpp-bucket
export SCCACHE_ENDPOINT=my.minio.com:9000
sccache --start-server

then configure and run my build. This is what I get when I query for the cache stat:

Compile requests                        197
Compile requests executed               197
Cache hits                                0
Cache misses                            191
Cache timeouts                            0
Cache read errors                         0
Forced recaches                           0
Cache write errors                      191
Compilation failures                      0
Cache errors                              3
Non-cacheable compilations                0
Non-cacheable calls                       0
Non-compilation calls                     0
Unsupported compiler calls                0
Successful distributed compilations       0
Failed distributed compilations           0
Average cache write                   0.000 s
Average cache read miss               2.206 s
Average cache read hit                0.000 s
Cache location                      S3, bucket: Bucket(name=my-cpp-bucket, base_url=http://my.minio.com:9000/my-cpp-bucket/)

It appears all comilation requests results in a cache miss. I have no clue how I can go about debugging this issue. I assumed there might be a problem with configuration of my minio server and I ran this set of tests and all of them appear to be passing.

(1/13) Running aws-sdk-go tests ... done in 0 seconds
(2/13) Running aws-sdk-java tests ... done in 1 seconds
(3/13) Running aws-sdk-php tests ... done in 40 seconds
(4/13) Running aws-sdk-ruby tests ... done in 2 seconds
(5/13) Running awscli tests ... done in 53 seconds
(6/13) Running mc tests ... done in 8 seconds
(7/13) Running minio-dotnet tests ... done in 9 seconds
(8/13) Running minio-go tests ... done in 0 seconds
(9/13) Running minio-java tests ... done in 2 seconds
(10/13) Running minio-js tests ... done in 34 seconds
(11/13) Running minio-py tests ... done in 14 seconds
(12/13) Running s3cmd tests ... done in 8 seconds
(13/13) Running security tests ... done in 0 seconds

All tests ran successfully

What am I missing in my setup/configuration? Is there a simple setup (rust or C++ or anything else) that I can run to test my setup? Are there any ports that I should add to my firewall for sccache client/server?

@ccotter
Copy link

ccotter commented Jan 17, 2019

Make sure to checkout #343 and ensure the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables are exported in the environment that runs sccache. In particular I had incorrectly specified my AWS* variables and ended up seeing Cache (write)? errors in sccache -s

@randombit
Copy link
Contributor

I ran into this a while back when I was experimenting with using minio with sccache. You must manually create the bucket, and then explicitly enable write access to it, minios default permissions seem to be read only.

@AliAskari
Copy link
Author

@randombit I have already created the bucket and set the permissions. I just had to set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables. As soon as I set them everything worked. Thanks!

@luser
Copy link
Contributor

luser commented Jan 25, 2019

Glad to see you got this sorted out! Sorry that this isn't easier to diagnose. We have a long-standing issue filed on potentially exposing these errors more usefully: #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants