Skip to content

Commit 0ddcb6b

Browse files
committed
Docker container: Change depot modification workaround.
This should speed up the build, and hopefully fix the arm64 failure. [ci skip]
1 parent 24c236a commit 0ddcb6b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,25 @@ LABEL org.opencontainers.image.authors="Tim Besard <tim.besard@gmail.com>" \
2727

2828
# system-wide packages
2929

30-
# no trailing ':' as to ensure we don't touch anything outside this directory. without it,
31-
# Julia touches the compilecache timestamps in its shipped depot (for some reason; a bug?)
32-
ENV JULIA_DEPOT_PATH=/usr/local/share/julia
30+
ENV JULIA_DEPOT_PATH=/usr/local/share/julia:
3331

3432
# pre-install the CUDA toolkit from an artifact. we do this separately from CUDA.jl so that
3533
# this layer can be cached independently. it also avoids double precompilation of CUDA.jl in
3634
# order to call `CUDA.set_runtime_version!`.
37-
RUN julia -e '#= configure the preference =# \
35+
RUN julia -e '#= make bundled depot non-writable (JuliaLang/Pkg.jl#4120) =# \
36+
bundled_depot = last(DEPOT_PATH); \
37+
run(`find $bundled_depot/compiled -type f -writable -exec chmod -w \{\} \;`); \
38+
#= configure the preference =# \
3839
env = "/usr/local/share/julia/environments/v$(VERSION.major).$(VERSION.minor)"; \
3940
mkpath(env); \
4041
write("$env/LocalPreferences.toml", \
4142
"[CUDA_Runtime_jll]\nversion = \"'${CUDA_VERSION}'\""); \
4243
\
4344
#= install the JLL =# \
4445
using Pkg; \
45-
Pkg.add("CUDA_Runtime_jll")' && \
46+
Pkg.add("CUDA_Runtime_jll"); \
47+
#= revert bundled depot changes =# \
48+
run(`find $bundled_depot/compiled -type f -writable -exec chmod +w \{\} \;`)' && \
4649
#= demote the JLL to an [extras] dep =# \
4750
find /usr/local/share/julia/environments -name Project.toml -exec sed -i 's/deps/extras/' {} + && \
4851
#= remove nondeterminisms =# \
@@ -69,7 +72,6 @@ RUN mkdir -m 0777 /depot
6972

7073
# we add the user environment from a start-up script
7174
# so that the user can mount `/depot` for persistency
72-
ENV JULIA_DEPOT_PATH=/usr/local/share/julia:
7375
COPY <<EOF /usr/local/share/julia/config/startup.jl
7476
if !isdir("/depot/environments/v$(VERSION.major).$(VERSION.minor)")
7577
if isinteractive() && Base.JLOptions().quiet == 0

0 commit comments

Comments
 (0)