Skip to content

Commit

Permalink
fix mybinder
Browse files Browse the repository at this point in the history
  • Loading branch information
marius311 committed May 5, 2020
1 parent 411c679 commit 7f94891
Show file tree
Hide file tree
Showing 7 changed files with 914 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: marius311/cmblensing.jl
build_args: PACKAGECOMPILE=0
build_args: PACKAGECOMPILE=1, PRECOMPILE=0, RUNDOCS=1
tag_with_ref: true
# - name: docker-build-placeholder
# run: docker pull marius311/cmblensing.jl:latest
Expand Down
22 changes: 16 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN apt-get update \

## install julia
RUN mkdir /opt/julia \
&& 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 \
&& 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 \
&& chown -R 1000 /opt/julia \
&& ln -s /opt/julia/bin/julia /usr/local/bin

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



## PackageCompiler
# bake CMBLensing into the system image to further speed up load times and
# reduce memory usage during package load (the latter is necessary otherwise we
# hit the mybinder memory limit)
RUN test $PACKAGECOMPILE = 0 \
|| julia -e 'using PackageCompiler; create_sysimage([:CMBLensing],cpu_target="generic",replace_default=true)'
COPY docs/pyplot_packagecompiler_script.jl /tmp/
RUN if [ "$PACKAGECOMPILE" = "1" ]; then \
julia -e 'using PackageCompiler; \
create_sysimage(\
[:PyCall, :IJulia, :PyPlot, :CMBLensing], \
cpu_target="generic", \
replace_default=true, \
script="/tmp/pyplot_packagecompiler_script.jl" \
)'; \
fi

## execute documentation notebooks and save outputs
COPY --chown=1000 docs/src $HOME/CMBLensing/docs/src
Expand Down
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Expand Down
Loading

0 comments on commit 7f94891

Please sign in to comment.