Skip to content

Commit 784e148

Browse files
Upload local sccache to S3
1 parent 8859e3f commit 784e148

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.drone.jsonnet

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,14 @@ 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',
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
737739
SCCACHE_REGION: 'us-east-1',
738740
SCCACHE_S3_USE_SSL: 'true',
739741
SCCACHE_S3_KEY_PREFIX: result + branch + server + arch + '${DRONE_PULL_REQUEST}',
740-
//SCCACHE_ERROR_LOG: '/tmp/sccache_log.txt',
741-
//SCCACHE_LOG: 'debug',
742+
SCCACHE_ERROR_LOG: '/tmp/sccache_log.txt',
743+
SCCACHE_LOG: '/tmp/sccache_debug.txt',
742744
},
743745
commands: [
744746
'export CLICOLOR_FORCE=1',
@@ -752,7 +754,13 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
752754
'--server-version ' + server + ' | ' +
753755
'/mdb/' + builddir + '/storage/columnstore/columnstore/build/ansi2txt.sh ' +
754756
'/mdb/' + builddir + '/' + result + '/build.log"' ,
755-
'sccache --show-stats',
757+
'sccache --show-adv-stats',
758+
759+
// if this is a nightly build, archive local sccache dir and upload it to S3
760+
'du -hs /tmp/sccache',
761+
'time tar -I pzstd -cf sccache.tar.zst /tmp/sccache',
762+
'time aws s3 cp sccache.tar.zst s3://cspkg/nightly-sccache/stable-23.10-' + server + '-' + arch + '-' + std.strReplace(platform, ':', '-') + '/sccache.tar.zst',
763+
'echo "Nightly build cache uploaded to: s3://cspkg/nightly-sccache/stable-23.10-' + server + '-' + arch + '-' + std.strReplace(platform, ':', '-') + '/sccache.tar.zst"',
756764

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

0 commit comments

Comments
 (0)