Skip to content

Commit

Permalink
Merge pull request #83 from marius311/pkgext
Browse files Browse the repository at this point in the history
Use 1.9 package extensions
  • Loading branch information
marius311 committed Apr 20, 2023
2 parents 262f635 + 44d92ce commit ca02b0d
Show file tree
Hide file tree
Showing 38 changed files with 779 additions and 738 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
*
!src
!ext
!dat
!Project.toml
!CondaPkg.toml
!README.md
!docs
**/.ipynb_checkpoints
6 changes: 3 additions & 3 deletions .github/workflows/runtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1.7', '1.8', '^1.9.0-0']
julia-version: ['1.8', '^1.9.0-0']
os: [ubuntu-latest]
provider: ['mkl', 'fftw']
fail-fast: false
Expand All @@ -16,13 +16,13 @@ jobs:

steps:
- uses: actions/checkout@v1.0.0
- uses: julia-actions/setup-julia@latest
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
- run: >
sudo apt-get install --no-install-recommends gfortran python3-setuptools python3-wheel
&& pip3 install camb healpy
&& julia -e 'using Pkg; Pkg.add(url="https://github.com/EthanAnderes/CirculantCov.jl")'
&& julia --project .github/set_fftw_provider.jl "${{ matrix.provider }}"
- uses: julia-actions/julia-runtest@master
- uses: julia-actions/julia-runtest@v1
timeout-minutes: 30
3 changes: 3 additions & 0 deletions CondaPkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

[pip.deps]
camb = ""
36 changes: 11 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ RUN apt-get update \
libsqlite3-dev \
nodejs \
npm \
python-openssl \
python3 \
python3-pip \
python3-openssl \
tk-dev \
wget \
xz-utils \
Expand All @@ -29,7 +31,7 @@ RUN apt-get update \

## install julia
RUN mkdir /opt/julia \
&& curl -L https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.5-linux-x86_64.tar.gz | tar zxf - -C /opt/julia --strip=1 \
&& curl -L https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.0-rc2-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 All @@ -39,40 +41,21 @@ ARG NB_UID=1000
ENV USER $NB_USER
ENV NB_UID $NB_UID
ENV HOME /home/$NB_USER
ENV PATH=$HOME/.local/bin:$PATH
RUN adduser --disabled-password --gecos "Default user" --uid $NB_UID $NB_USER
USER $NB_USER

## pyenv
# install python with pyenv since we need a dynamically-linked executable so
# that PyJulia works
ENV PATH="$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH"
RUN curl https://pyenv.run | bash \
&& CFLAGS="-O2" PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.9.13 \
&& pyenv global 3.9.13

## install Python packages
# see https://github.com/jupyter/jupyter_client/issues/637 re: jupyter-client==6.1.12
RUN pip install --no-cache-dir \
cython \
RUN pip3 install --no-cache-dir \
"jinja2<3.1.0" \
julia \
juliacall \
"jupyterlab>=3" \
jupyter-client==6.1.12 \
jupytext \
matplotlib \
"nbconvert<6" \
numpy \
scipy \
setuptools \
&& rm -rf $HOME/.cache

## install CAMB
RUN mkdir -p $HOME/src/camb \
&& curl -L https://github.com/cmbant/camb/tarball/e8184bb | tar zxf - -C $HOME/src/camb --strip=1 \
&& cd $HOME/src/camb \
&& NONNATIVE=1 python setup.py make install


## build args
# build with PRECOMPILE=0 and/or PACKAGECOMPILE=0 to skip precompilation steps,
# which makes for a quicker build but slower startup (mostly useful for
Expand All @@ -88,13 +71,15 @@ ARG JULIA_FFTW_PROVIDER=FFTW
# to improve Docker caching, we first precompile dependencies by copying in
# 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 Project.toml CondaPkg.toml $HOME/CMBLensing/
COPY --chown=1000 docs/Project.toml $HOME/CMBLensing/docs/
RUN mkdir $HOME/CMBLensing/src && mkdir $HOME/CMBLensing/docs/build && touch $HOME/CMBLensing/src/CMBLensing.jl
ENV JULIA_PROJECT=$HOME/CMBLensing/docs
RUN JULIA_PKG_PRECOMPILE_AUTO=0 julia -e 'using Pkg; pkg"status; dev ~/CMBLensing; instantiate"' \
&& rm -rf $HOME/.julia/conda/3/pkgs
COPY --chown=1000 src $HOME/CMBLensing/src
COPY --chown=1000 ext $HOME/CMBLensing/ext
COPY --chown=1000 dat $HOME/CMBLensing/dat
RUN (test $PRECOMPILE = 0 || julia -e 'using Pkg; pkg"precompile"')


Expand All @@ -111,6 +96,7 @@ COPY --chown=1000 docs/src $HOME/CMBLensing/docs/src
COPY --chown=1000 docs/ipython_config.py $HOME/.ipython/profile_default/ipython_config.py
WORKDIR $HOME/CMBLensing/docs/src
ARG RUNDOCS=1

RUN jupytext --to notebook *.md \
&& rm *.md \
&& find . -not -name "*gpu*" -name "*.ipynb" \
Expand Down
36 changes: 27 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ version = "0.10.0"
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Bijections = "e2ed5e7c-b2de-5872-ae92-c73ca462fb04"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
CUDAKernels = "72cfdca4-0801-4ab0-bf6a-d52aa10adc57"
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
CompositeStructs = "534720e6-2374-40c5-8712-bf9a2f1643c6"
CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand All @@ -32,11 +31,11 @@ Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
KahanSummation = "8e2b3108-d4c1-50be-a7a2-16352aec75c3"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
Lazy = "50d2b5c4-7a5e-59d5-8109-a42b560f39c0"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Loess = "4345ca2d-374a-55d4-8d30-97f9976e7612"
MCMCDiagnosticTools = "be115224-59cd-429b-ad48-344e309966f0"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Match = "7eb4fadd-790c-5f42-8a69-bfa0b872bfbf"
Expand All @@ -51,7 +50,6 @@ PlotUtils = "995b91a9-d308-5afd-9ec6-746e21dbc043"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Expand All @@ -70,11 +68,24 @@ Tullio = "bc48ee85-29a4-5162-ae0b-a64e1601d4bc"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[weakdeps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
CUDAKernels = "72cfdca4-0801-4ab0-bf6a-d52aa10adc57"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
MuseInference = "43b88160-90c7-4f71-933b-9d65205cd921"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"

[extensions]
CMBLensingCUDAExt = "CUDA"
CMBLensingMuseInferenceExt = "MuseInference"
CMBLensingPythonCallExt = "PythonCall"
CMBLensingPythonPlotExt = "PythonPlot"

[compat]
AbstractFFTs = "0.5, 1"
Adapt = "1.0.1, 2, 3"
CUDA = "3.4"
CUDAKernels = "0.3.3, 0.4"
CUDA = "3.4, 4"
ChainRules = "1.5"
CodecZlib = "0.7"
Combinatorics = "1"
Expand All @@ -95,21 +106,20 @@ Interpolations = "0.12.8, 0.13, 0.14"
IterTools = "1.3"
JLD2 = "0.4.30"
KahanSummation = "0.1, 0.2"
KernelAbstractions = "0.7.3, 0.8"
Lazy = "0.13.2, 0.14, 0.15"
Loess = "0.5"
MacroTools = "0.5"
Match = "1.1"
Measurements = "2"
Memoization = "0.2"
MuseInference = "0.2.2"
NFFT = "0.13.3"
NamedTupleTools = "0.13"
Optim = "1"
PDMats = "0.11.5"
PlotUtils = "1.3.2"
Preferences = "1.2"
ProgressMeter = "1.2"
PyCall = "1.91.2"
QuadGK = "2.3.1"
RecipesBase = "1.3.2"
Requires = "0.5, 1"
Expand All @@ -123,4 +133,12 @@ TimerOutputs = "0.5"
Tullio = "0.3"
UnPack = "1"
Zygote = "0.6.21"
julia = "1.7"
julia = "1.8"

[extras]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
CUDAKernels = "72cfdca4-0801-4ab0-bf6a-d52aa10adc57"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
MuseInference = "43b88160-90c7-4f71-933b-9d65205cd921"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ services:
- DOCS=${DOCS:-8000}
volumes:
- "./src:/home/cosmo/CMBLensing/src"
- "./ext:/home/cosmo/CMBLensing/ext"
- "./docs:/home/cosmo/CMBLensing/docs"
- "/home/cosmo/.julia"
command: ["sh", "-c", "python3 -m http.server $$DOCS -d /home/cosmo/CMBLensing/docs/build & jupyter lab --ip=0.0.0.0 --no-browser --port $$PORT"]

0 comments on commit ca02b0d

Please sign in to comment.