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

Commit

Permalink
Сaching through docker volume (#10477)
Browse files Browse the repository at this point in the history
* _old codebase_ before docker update

* before docker update, testing runnr

* docker update, testing the caching

* distributed job cargo homes

* distributed job cargo homes 2

* distributed job cargo homes 3

* dockerfile with gitlab checkout, audit uses template

* dockerfile gets repo in volume

* change builds_dir

* trying docker cache for repo

* repo cached automatically

* after script is not concatenated

* check sccache non-cacheable reasons nature

* watch cache

* log sccache

* log sccache 2

* debug log sccache

* fix debug log sccache

* fix debug log sccache 2

* debug log cache 3

* debug log cache 3

* trace log all sccache

* test wo cargo cache

* test w removed cargo cache

* report non-cacheable reasons, cargo cache is back and empty

* report non-cacheable reasons, cargo cache is back and empty 2

* report non-cacheable reasons, cargo cache is back and empty 3

* wrap into after_script

* restore CI tags

`qa` -> `linux-docker`

* return to main runners, this will fail until config on runners And Dockerfile won't be updated

* typo fix CI lint

* return to docker tag
  • Loading branch information
TriplEight authored and General-Beck committed Mar 19, 2019
1 parent fb46165 commit a8ee3c9
Showing 1 changed file with 32 additions and 20 deletions.
52 changes: 32 additions & 20 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ variables:
GIT_STRATEGY: fetch
GIT_SUBMODULE_STRATEGY: recursive
CI_SERVER_NAME: "GitLab CI"
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo"
CARGO_TARGET: x86_64-unknown-linux-gnu

.no_git: &no_git #disable git strategy
.no_git: &no_git # disable git strategy
variables:
GIT_STRATEGY: none
GIT_SUBMODULE_STRATEGY: none
Expand All @@ -32,12 +31,17 @@ variables:
paths:
- artifacts/

.docker-cache-status: &docker-cache-status
dependencies: []
.docker-cache-status: &docker-cache-status
variables:
CARGO_HOME: "/cargo/${CI_JOB_NAME}"
before_script:
- SCCACHE_ERROR_LOG=/builds/parity/parity-ethereum/sccache_error.log RUST_LOG=sccache::server=debug sccache --start-server
- sccache -s
after_script:
- sccache -s
- echo "All crate-types:"
- grep 'parse_arguments.*--crate-type' sccache_error.log | sed -re 's/.*"--crate-type", "([^"]+)".*/\1/' | sort | uniq -c
- echo "Non-cacheable reasons:"
- grep CannotCache sccache_error.log | sed -re 's/.*CannotCache\((.+)\).*/\1/' | sort | uniq -c
tags:
- linux-docker

Expand All @@ -47,50 +51,68 @@ cargo-check 0 3:
<<: *docker-cache-status
script:
- time cargo check --target $CARGO_TARGET --locked --no-default-features
- 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
- 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"
- sccache -s

cargo-audit:
stage: test
<<: *docker-cache-status
script:
- cargo audit
tags:
- linux-docker
- sccache -s

validate-chainspecs:
stage: test
<<: *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
- sccache -s

build-android:
stage: build
image: parity/rust-android:gitlab-ci
variables:
CARGO_TARGET: armv7-linux-androideabi
script:
- scripts/gitlab/build-linux.sh
tags:
- linux-docker
<<: *collect_artifacts

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

build-linux-i386:
Expand Down Expand Up @@ -138,7 +160,7 @@ build-windows:
publish-docker:
stage: publish
only: *releaseable_branches
cache: {}
cache: {}
dependencies:
- build-linux
tags:
Expand All @@ -152,7 +174,7 @@ publish-snap: &publish-snap
image: snapcore/snapcraft
variables:
BUILD_ARCH: amd64
cache: {}
cache: {}
dependencies:
- build-linux
tags:
Expand Down Expand Up @@ -227,19 +249,9 @@ publish-docs:
- tags
except:
- nightly
cache: {}
cache: {}
script:
- scripts/gitlab/publish-docs.sh
tags:
- linux-docker

build-android:
stage: build
image: parity/rust-android:gitlab-ci
variables:
CARGO_TARGET: armv7-linux-androideabi
script:
- scripts/gitlab/build-linux.sh
tags:
- linux-docker
<<: *collect_artifacts

0 comments on commit a8ee3c9

Please sign in to comment.