Skip to content

Commit

Permalink
Merge pull request #23 from louisl3grand/master
Browse files Browse the repository at this point in the history
Dockerfile to run the code in a container
  • Loading branch information
carronj authored Jun 17, 2022
2 parents 2a7d832 + 2e8cc76 commit 62a6b6f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Dockerfile adapted from jupyter/scipy-notebook by Louis Legrand
# https://github.com/jupyter/docker-stacks/blob/master/scipy-notebook/Dockerfile

ARG OWNER=jupyter
ARG BASE_CONTAINER=$OWNER/scipy-notebook
FROM $BASE_CONTAINER

USER root


# We need a fortran compiler for plancklens
RUN apt-get update --yes
RUN apt-get install gfortran --yes


# Install plancklens
WORKDIR "${HOME}"
COPY . "${HOME}/plancklens"
WORKDIR "${HOME}/plancklens"
RUN pip install -r requirements.txt
RUN pip install -e .

# Install lenspyx
WORKDIR "${HOME}"
RUN git clone https://github.com/carronj/lenspyx.git
WORKDIR "${HOME}/lenspyx"
RUN pip install -r requirements.txt
RUN pip install -e .

WORKDIR "${HOME}"


# Setting the plancklens env variable for writing stuff
ENV PLENS="${HOME}/plens_write"
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,36 @@ After cloning the repository, build an editable installation with

The –-user is required only if you don’t have write permission to your main python installation. A fortran compiler is required for a successful installation.

Alternatively, you can use the Dockerfile to install the code in a separate container (see below).


#### Docker installation

The Dockerfile allows you to install plancklens and lenspyx in a [Docker](https://docs.docker.com/) container and to run Jupyter.
This image is based on the [jupyter/scipy-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/) image.
After [installing docker](https://docs.docker.com/get-docker/) on your machine, go in the plancklens repository and build the image with

docker build -t plancklens .

You can then start the container with

docker run -it -p 8888:8888 plancklens

Visiting `http://<hostname>:8888/?token=<token>` in a browser loads JupyterLab, where:

`hostname` is the name of the computer running Docker

`token` is the secret token printed in the console.

If you only wish to run a terminal within the container type

docker run -it plancklens /bin/sh



### Contents

This code contains most of the Planck 2018 lensing pipeline. In particular it possible to reproduce the published map and band-powers basically exactly. Some more detailed parts of the pipeline have been left out or are not yet translated to python 3. This is the case notably of the band-powers likelihood code.
This code contains most of the Planck 2018 lensing pipeline. In particular it is possible to reproduce the published map and band-powers basically exactly. Some more detailed parts of the pipeline have been left out or are not yet translated to python 3. This is the case notably of the band-powers likelihood code.

The code used to produce lensed CMB skies is the stand-alone pip package [lenspyx](https://github.com/carronj/lenspyx) (with big speed improvement expected soon)

Expand Down Expand Up @@ -80,3 +107,5 @@ Typical keys include then:
<a href="./docs/SNF_logo_standard_web_color_neg_e.svg#gh-dark-mode-only">
<img src="./docs/SNF_logo_standard_web_color_neg_e.svg#gh-dark-mode-only" width="500" height="150" />
</a>


0 comments on commit 62a6b6f

Please sign in to comment.