Skip to content

Commit 23501a5

Browse files
Upload local sccache to S3
1 parent 8859e3f commit 23501a5

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.drone.jsonnet

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -733,16 +733,19 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
733733
AWS_SECRET_ACCESS_KEY: {
734734
from_secret: 'aws_secret_access_key',
735735
},
736-
SCCACHE_BUCKET: 'cs-sccache',
737-
SCCACHE_REGION: 'us-east-1',
738-
SCCACHE_S3_USE_SSL: 'true',
739-
SCCACHE_S3_KEY_PREFIX: result + branch + server + arch + '${DRONE_PULL_REQUEST}',
740-
//SCCACHE_ERROR_LOG: '/tmp/sccache_log.txt',
741-
//SCCACHE_LOG: 'debug',
736+
SCCACHE_DIR: '/tmp/sccache', // local cache for sccache
737+
SCCACHE_CACHE_SIZE: '20G',
738+
// SCCACHE_BUCKET: 'cs-sccache', // remote S3 cache in case we have a local miss
739+
// SCCACHE_REGION: 'us-east-1',
740+
// SCCACHE_S3_USE_SSL: 'true',
741+
// SCCACHE_S3_KEY_PREFIX: result + branch + server + arch + '${DRONE_PULL_REQUEST}',
742+
SCCACHE_ERROR_LOG: '/tmp/sccache_log.txt',
743+
SCCACHE_LOG: 'sccache_debug.txt',
742744
},
743745
commands: [
744746
'export CLICOLOR_FORCE=1',
745747
get_sccache,
748+
'mkdir -p /tmp/sccache',
746749
'mkdir /mdb/' + builddir + '/' + result,
747750

748751
'bash -c "set -o pipefail && bash /mdb/' + builddir + '/storage/columnstore/columnstore/build/bootstrap_mcs.sh ' +
@@ -752,7 +755,13 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
752755
'--server-version ' + server + ' | ' +
753756
'/mdb/' + builddir + '/storage/columnstore/columnstore/build/ansi2txt.sh ' +
754757
'/mdb/' + builddir + '/' + result + '/build.log"' ,
755-
'sccache --show-stats',
758+
'sccache --show-adv-stats',
759+
760+
// if this is a nightly build, archive local sccache dir and upload it to S3
761+
'du -hs /tmp/sccache',
762+
'time tar -I pzstd -cf sccache.tar.zst /tmp/sccache',
763+
'time aws s3 cp sccache.tar.zst s3://cspkg/nightly-sccache/stable-23.10-' + server + '-' + arch + '-' + std.strReplace(platform, ':', '-') + '/sccache.tar.zst',
764+
'echo "Nightly build cache uploaded to: s3://cspkg/nightly-sccache/stable-23.10-' + server + '-' + arch + '-' + std.strReplace(platform, ':', '-') + '/sccache.tar.zst"',
756765

757766
// move engine and cmapi packages to one dir and make a repo
758767
if (pkg_format == 'rpm') then "mv -v -t ./" + result + "/ /mdb/" + builddir + "/*.rpm /drone/src/cmapi/" + result + "/*.rpm && createrepo ./" + result

0 commit comments

Comments
 (0)