Skip to content

Commit 7f94891

Browse files
committed
fix mybinder
1 parent 411c679 commit 7f94891

File tree

7 files changed

+914
-8
lines changed

7 files changed

+914
-8
lines changed

.github/workflows/docbuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
username: ${{ secrets.DOCKER_USERNAME }}
1818
password: ${{ secrets.DOCKER_PASSWORD }}
1919
repository: marius311/cmblensing.jl
20-
build_args: PACKAGECOMPILE=0
20+
build_args: PACKAGECOMPILE=1, PRECOMPILE=0, RUNDOCS=1
2121
tag_with_ref: true
2222
# - name: docker-build-placeholder
2323
# run: docker pull marius311/cmblensing.jl:latest

Dockerfile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RUN apt-get update \
2828

2929
## install julia
3030
RUN mkdir /opt/julia \
31-
&& curl -L https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.0-linux-x86_64.tar.gz | tar zxf - -C /opt/julia --strip=1 \
31+
&& curl -L https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.1-linux-x86_64.tar.gz | tar zxf - -C /opt/julia --strip=1 \
3232
&& chown -R 1000 /opt/julia \
3333
&& ln -s /opt/julia/bin/julia /usr/local/bin
3434

@@ -85,22 +85,32 @@ ARG JULIA_FFTW_PROVIDER=MKL
8585
# Project.toml (and making a dummy src/CMBLensing.jl which we have to), so that
8686
# other changes to files in src/ won't have to redo these steps
8787
COPY --chown=1000 Project.toml $HOME/CMBLensing/
88-
COPY --chown=1000 docs/Project.toml $HOME/CMBLensing/docs/
88+
COPY --chown=1000 docs/Project.toml docs/Manifest.toml $HOME/CMBLensing/docs/
8989
RUN mkdir $HOME/CMBLensing/src && touch $HOME/CMBLensing/src/CMBLensing.jl
9090
ENV JULIA_PROJECT=$HOME/CMBLensing/docs
91-
RUN julia -e 'using Pkg; pkg"dev ~/CMBLensing; instantiate; add ProgressMeter#master; precompile"' \
91+
ENV CMBLENSING_NONLAZY_PYPLOT=1
92+
RUN julia -e 'using Pkg; pkg"instantiate"' \
93+
&& if [ "$PRECOMPILE" = "1" ]; then julia -e 'using Pkg; pkg"precompile"'; fi \
9294
&& rm -rf $HOME/.julia/conda/3/pkgs
9395
COPY --chown=1000 src $HOME/CMBLensing/src
94-
RUN (test $PRECOMPILE = 0 || julia -e 'using Pkg; pkg"precompile"')
96+
RUN if [ "$PRECOMPILE" = "1" ]; then julia -e 'using Pkg; pkg"precompile"'; fi
9597

9698

9799

98100
## PackageCompiler
99101
# bake CMBLensing into the system image to further speed up load times and
100102
# reduce memory usage during package load (the latter is necessary otherwise we
101103
# hit the mybinder memory limit)
102-
RUN test $PACKAGECOMPILE = 0 \
103-
|| julia -e 'using PackageCompiler; create_sysimage([:CMBLensing],cpu_target="generic",replace_default=true)'
104+
COPY docs/pyplot_packagecompiler_script.jl /tmp/
105+
RUN if [ "$PACKAGECOMPILE" = "1" ]; then \
106+
julia -e 'using PackageCompiler; \
107+
create_sysimage(\
108+
[:PyCall, :IJulia, :PyPlot, :CMBLensing], \
109+
cpu_target="generic", \
110+
replace_default=true, \
111+
script="/tmp/pyplot_packagecompiler_script.jl" \
112+
)'; \
113+
fi
104114

105115
## execute documentation notebooks and save outputs
106116
COPY --chown=1000 docs/src $HOME/CMBLensing/docs/src

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
3333
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
3434
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
3535
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
36+
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
3637
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
3738
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3839
Requires = "ae029012-a4dd-5104-9daa-d747884805df"

0 commit comments

Comments
 (0)