Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit cd5e43d

Browse files
General-Beckniklasad1
authored andcommitted
Switching sccache from local to Redis (#10971)
* Switching cache from local to Radis * sccache -s won't work. All the images are taken from own registry * new images addresses * statisticss after stop sccache server sccache CC&CXX
1 parent d9ce1e9 commit cd5e43d

File tree

5 files changed

+22
-30
lines changed

5 files changed

+22
-30
lines changed

.gitlab-ci.yml

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ stages:
55
- optional
66

77
image: ${REGISTRY}/parity-ci-linux:latest
8+
89
variables:
910
GIT_STRATEGY: fetch
1011
GIT_SUBMODULE_STRATEGY: recursive
1112
CI_SERVER_NAME: "GitLab CI"
1213
CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}"
13-
SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache"
1414
CARGO_TARGET: x86_64-unknown-linux-gnu
1515
REGISTRY: registry.parity.io/parity/infrastructure/scripts
1616

17-
1817
.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
1918
only: &releaseable_branches
2019
- stable
@@ -38,22 +37,6 @@ variables:
3837
before_script:
3938
- rustup show
4039
- cargo --version
41-
- SCCACHE_ERROR_LOG=/builds/parity/parity-ethereum/sccache_debug.log
42-
RUST_LOG=sccache=debug
43-
sccache --start-server
44-
- sccache -s
45-
after_script:
46-
# sccache debug info
47-
- if test -e sccache_debug.log;
48-
then
49-
echo "_____All crate-types:_____";
50-
grep 'parse_arguments.*--crate-type' sccache_debug.log | sed -re 's/.*"--crate-type", "([^"]+)".*/\1/' | sort | uniq -c;
51-
echo "_____Non-cacheable reasons:_____";
52-
grep CannotCache sccache_debug.log | sed -re 's/.*CannotCache\((.+)\).*/\1/' | sort | uniq -c;
53-
else
54-
echo "_____No logs from sccache_____";
55-
exit 0;
56-
fi
5740
tags:
5841
- linux-docker
5942

@@ -63,7 +46,6 @@ variables:
6346
<<: *collect_artifacts
6447
script:
6548
- scripts/gitlab/build-linux.sh
66-
- sccache -s
6749
after_script:
6850
- mkdir -p tools
6951
- cp -r scripts/docker/hub/* ./tools
@@ -81,21 +63,21 @@ cargo-check 0 3:
8163
<<: *docker-cache-status
8264
script:
8365
- time cargo check --target $CARGO_TARGET --locked --no-default-features --verbose --color=always
84-
- sccache -s
66+
- sccache --stop-server
8567

8668
cargo-check 1 3:
8769
stage: test
8870
<<: *docker-cache-status
8971
script:
9072
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --no-default-features --verbose --color=always
91-
- sccache -s
73+
- sccache --stop-server
9274

9375
cargo-check 2 3:
9476
stage: test
9577
<<: *docker-cache-status
9678
script:
9779
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --features "mio" --verbose --color=always
98-
- sccache -s
80+
- sccache --stop-server
9981

10082
cargo-check-evmbin:
10183
stage: test
@@ -123,37 +105,32 @@ validate-chainspecs:
123105
<<: *docker-cache-status
124106
script:
125107
- ./scripts/gitlab/validate-chainspecs.sh
126-
- sccache -s
127108

128109
test-cpp:
129110
stage: build
130111
<<: *docker-cache-status
131112
script:
132113
- ./scripts/gitlab/test-cpp.sh
133-
- sccache -s
134114

135115
test-linux:
136116
stage: build
137117
<<: *docker-cache-status
138118
script:
139119
- ./scripts/gitlab/test-linux.sh stable
140-
- sccache -s
141120

142121
test-linux-beta:
143122
stage: build
144123
only: *releaseable_branches
145124
<<: *docker-cache-status
146125
script:
147126
- ./scripts/gitlab/test-linux.sh beta
148-
- sccache -s
149127

150128
test-linux-nightly:
151129
stage: build
152130
only: *releaseable_branches
153131
<<: *docker-cache-status
154132
script:
155133
- ./scripts/gitlab/test-linux.sh nightly
156-
- sccache -s
157134
allow_failure: true
158135

159136
build-android:
@@ -234,7 +211,7 @@ publish-docker:
234211
DOCKER_DRIVER: overlay2
235212
GIT_STRATEGY: none
236213
# DOCKERFILE: tools/Dockerfile
237-
# CONTAINER_IMAGE: parity/parity
214+
# CONTAINER_IMAGE: parity/parity
238215
script:
239216
- ./tools/publish-docker.sh
240217
tags:
@@ -350,7 +327,7 @@ publish-release-awss3-nightly: &publish-release-awss3
350327
- linux-docker
351328

352329
publish-release-awss3-manually:
353-
<<: *publish-release-awss3
330+
<<: *publish-release-awss3
354331
only: *releaseable_branches
355332
when: manual
356333

scripts/gitlab/build-linux.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
set -e # fail on any error
44
set -u # treat unset variables as error
55

6+
export CC="sccache "$CC
7+
export CXX="sccache "$CXX
68
echo "__________Show ENVIROMENT__________"
79
echo "CI_SERVER_NAME: " $CI_SERVER_NAME
810
echo "CARGO_HOME: " $CARGO_HOME
@@ -57,3 +59,5 @@ do
5759
echo "> ${binary} cannot be hashed with cross-compiled binary (keccak256)"
5860
fi
5961
done
62+
#show sccache statistics
63+
sccache --stop-server

scripts/gitlab/test-cpp.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -e # fail on any error
44
set -u # treat unset variables as error
55
#use nproc `linux only
66
THREADS=$(nproc)
7+
export CC="sccache gcc"
8+
export CXX="sccache g++"
79

810
echo "________Running the C++ example________"
911
DIR=parity-clib/examples/cpp/build
@@ -15,3 +17,5 @@ make VERBOSE=1 -j $THREADS
1517
# that to happen on CI
1618
cd -
1719
rm -rf $DIR
20+
#show sccache statistics
21+
sccache --stop-server

scripts/gitlab/test-linux.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ echo "________Running test-linux.sh________"
55
set -e # fail on any error
66
set -u # treat unset variables as error
77

8+
export CC="sccache gcc"
9+
export CXX="sccache g++"
810
FEATURES="json-tests"
11+
912
OPTIONS="--release"
1013
#use nproc `linux only
1114
THREADS=$(nproc)
@@ -16,3 +19,6 @@ rustup show
1619
echo "________Running Parity Full Test Suite________"
1720
# Why are we using RUSTFLAGS? See https://github.com/paritytech/parity-ethereum/pull/10719
1821
CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C overflow-checks=on -C debuginfo=2 -Ctarget-feature=+aes,+sse2,+ssse3" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=never -- --test-threads $THREADS
22+
23+
#show sccache statistics
24+
sccache --stop-server

scripts/gitlab/validate-chainspecs.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ done
1515
for spec in ethcore/res/ethereum/*.json; do
1616
if ! ./target/release/chainspec "$spec"; then ERR=1; fi
1717
done
18-
18+
#show sccache statistics
19+
sccache --stop-server
1920
exit $ERR

0 commit comments

Comments
 (0)