Skip to content

Commit 1717b70

Browse files
authored
ci: add sccache to testrunner image (#15179)
## Description - Adds `sccache` to the testrunner image - Mounts the `./.cache/` as `/home/bits/.cache` in the test runner With these small changes I can get `riot -v run <hash>` to take only 10-ish seconds to start running pytest (after the first run which builds our library, and etc) We will need to update the testrunner image in CI and docker-compose.yml once this Dockerfile change is published for people to get the benefits from it. ## Testing <!-- Describe your testing strategy or note what tests are included --> ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> ## Additional Notes <!-- Any other information that would be helpful for reviewers -->
1 parent 7a191ce commit 1717b70

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

docker-compose.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,16 @@ services:
191191
DD_FAST_BUILD: "1"
192192
CMAKE_BUILD_PARALLEL_LEVEL: "12"
193193
CARGO_BUILD_JOBS: "12"
194+
CYTHON_CACHE_DIR: "/home/bits/.cache/cython"
195+
DD_USE_SCCACHE: "1"
196+
SCCACHE_DIR: "/home/bits/.cache/sccache"
194197
network_mode: host
195198
userns_mode: host
196199
working_dir: /home/bits/project/
197200
volumes:
198201
- ddagent:/tmp/ddagent
202+
- ./.cache:/home/bits/.cache
199203
- ./:/home/bits/project
200-
- ./.riot:/home/bits/project/.riot
201204

202205
localstack:
203206
image: localstack/localstack:1.4.0

docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ RUN apt-get update \
5151
nodejs \
5252
npm \
5353
patch \
54+
sccache \
5455
unixodbc-dev \
5556
wget \
5657
zlib1g-dev \

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,7 @@ def get_exts_for(name):
12081208
force=os.getenv("DD_SETUP_FORCE_CYTHONIZE", "0") == "1",
12091209
annotate=os.getenv("_DD_CYTHON_ANNOTATE") == "1",
12101210
compiler_directives={"language_level": "3"},
1211+
cache=True,
12111212
)
12121213
+ get_exts_for("psutil"),
12131214
distclass=PatchedDistribution,

0 commit comments

Comments
 (0)