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

Switching sccache from local to Redis #10971

Merged
merged 5 commits into from
Oct 2, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 9 additions & 33 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ stages:
- publish
- optional

image: parity/parity-ci-linux:latest
image: $CI_REGISTRY/parity/infrastructure/scripts/parity-ci-linux:latest
variables:
GIT_STRATEGY: fetch
GIT_SUBMODULE_STRATEGY: recursive
CI_SERVER_NAME: "GitLab CI"
CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}"
SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache"
CARGO_TARGET: x86_64-unknown-linux-gnu


.no_git: &no_git # disable git strategy
variables:
GIT_STRATEGY: none
Expand All @@ -37,26 +37,11 @@ variables:
.docker-cache-status: &docker-cache-status
variables:
CARGO_HOME: "/ci-cache/parity-ethereum/cargo/${CI_JOB_NAME}"
SCCACHE_REDIS: "redis://:${REDIS}@172.17.0.1/0"
dependencies: []
before_script:
- rustup show
- cargo --version
- SCCACHE_ERROR_LOG=/builds/parity/parity-ethereum/sccache_debug.log
RUST_LOG=sccache=debug
sccache --start-server
- sccache -s
after_script:
# sccache debug info
- if test -e sccache_debug.log;
then
echo "_____All crate-types:_____";
grep 'parse_arguments.*--crate-type' sccache_debug.log | sed -re 's/.*"--crate-type", "([^"]+)".*/\1/' | sort | uniq -c;
echo "_____Non-cacheable reasons:_____";
grep CannotCache sccache_debug.log | sed -re 's/.*CannotCache\((.+)\).*/\1/' | sort | uniq -c;
else
echo "_____No logs from sccache_____";
exit 0;
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

so debugging will be disabled completely?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, sccache debugging was actually helpful only once.
But what's important and bugs me, is that debug log level somehow hinders sccache to communicate with redis.
Also, had to remove sccache -s as it was failing the job because it couldn't get the info from Redis. I tried some ideas, but think that in order to do that, we should install sccache to CI1 and CI2 which is not really necessary, at least for now.

tags:
- linux-docker

Expand All @@ -66,7 +51,6 @@ variables:
<<: *collect_artifacts
script:
- scripts/gitlab/build-linux.sh
- sccache -s
after_script:
- mkdir -p tools
- cp -r scripts/docker/hub/* ./tools
Expand All @@ -84,21 +68,18 @@ cargo-check 0 3:
<<: *docker-cache-status
script:
- time cargo check --target $CARGO_TARGET --locked --no-default-features --verbose --color=always
- sccache -s

cargo-check 1 3:
stage: test
<<: *docker-cache-status
script:
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --no-default-features --verbose --color=always
- sccache -s

cargo-check 2 3:
stage: test
<<: *docker-cache-status
script:
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --features "mio" --verbose --color=always
- sccache -s

cargo-audit:
stage: test
Expand All @@ -112,42 +93,37 @@ validate-chainspecs:
<<: *docker-cache-status
script:
- ./scripts/gitlab/validate-chainspecs.sh
- sccache -s

test-cpp:
stage: build
<<: *docker-cache-status
script:
- ./scripts/gitlab/test-cpp.sh
- sccache -s

test-linux:
stage: build
<<: *docker-cache-status
script:
- ./scripts/gitlab/test-linux.sh stable
- sccache -s

test-linux-beta:
stage: build
only: *releaseable_branches
<<: *docker-cache-status
script:
- ./scripts/gitlab/test-linux.sh beta
- sccache -s

test-linux-nightly:
stage: build
only: *releaseable_branches
<<: *docker-cache-status
script:
- ./scripts/gitlab/test-linux.sh nightly
- sccache -s
allow_failure: true

build-android:
<<: *build-on-linux
image: parity/parity-ci-android:stretch
image: $CI_REGISTRY/parity/infrastructure/scripts/parity-ci-android:stretch
variables:
CARGO_TARGET: armv7-linux-androideabi

Expand All @@ -158,21 +134,21 @@ build-linux:
build-linux-i386:
<<: *build-on-linux
only: *releaseable_branches
image: parity/parity-ci-i386:latest
image: $CI_REGISTRY/parity/infrastructure/scripts/parity-ci-i386:latest
variables:
CARGO_TARGET: i686-unknown-linux-gnu

build-linux-arm64:
<<: *build-on-linux
only: *releaseable_branches
image: parity/parity-ci-arm64:latest
image: $CI_REGISTRY/parity/infrastructure/scripts/parity-ci-arm64:latest
variables:
CARGO_TARGET: aarch64-unknown-linux-gnu

build-linux-armhf:
<<: *build-on-linux
only: *releaseable_branches
image: parity/parity-ci-armhf:latest
image: $CI_REGISTRY/parity/infrastructure/scripts/parity-ci-armhf:latest
variables:
CARGO_TARGET: armv7-unknown-linux-gnueabihf

Expand Down Expand Up @@ -284,7 +260,7 @@ publish-onchain:
- linux-docker

publish-awss3-release:
image: parity/awscli:latest
image: $CI_REGISTRY/parity/infrastructure/scripts/awscli:latest
stage: publish
only: *releaseable_branches
<<: *no_git
Expand All @@ -311,7 +287,7 @@ publish-awss3-release:

publish-docs:
stage: publish
image: parity/parity-ci-docs:latest
image: $CI_REGISTRY/parity/infrastructure/scripts/parity-ci-docs:latest
only:
- tags
except:
Expand Down