From fbfcb120f1452005203b509b79a80170f54cda9f Mon Sep 17 00:00:00 2001 From: louisl3grand Date: Fri, 17 Jun 2022 12:21:31 +0200 Subject: [PATCH 1/3] dockerfile --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..60de7c7 --- /dev/null +++ b/Dockerfile @@ -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}" +RUN git clone https://github.com/carronj/plancklens.git +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" From 3dc4fe3753acfc6f5e205fc4487aa680c15d2b36 Mon Sep 17 00:00:00 2001 From: louisl3grand Date: Fri, 17 Jun 2022 12:56:01 +0200 Subject: [PATCH 2/3] update reame --- Dockerfile | 2 +- README.md | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 60de7c7..4949658 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get install gfortran --yes # Install plancklens WORKDIR "${HOME}" -RUN git clone https://github.com/carronj/plancklens.git +COPY . "${HOME}/plancklens" WORKDIR "${HOME}/plancklens" RUN pip install -r requirements.txt RUN pip install -e . diff --git a/README.md b/README.md index ddbeda7..c38cc65 100644 --- a/README.md +++ b/README.md @@ -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 the code with 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://:8888/?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 the 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) @@ -80,3 +107,5 @@ Typical keys include then: + + From 2e8cc7643a5109e165cbc83ff71649b17ce89f8b Mon Sep 17 00:00:00 2001 From: louisl3grand Date: Fri, 17 Jun 2022 12:57:38 +0200 Subject: [PATCH 3/3] small --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c38cc65..a1e9bea 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Alternatively, you can use the Dockerfile to install the code in a separate cont #### Docker installation - The Dockerfile allows you to install plancklens and lenspyx in a [Docker](https://docs.docker.com/) container and to run the code with jupyter. + 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 @@ -38,7 +38,7 @@ Visiting `http://:8888/?token=` in a browser loads JupyterLab, `token` is the secret token printed in the console. -If you only wish to run the terminal within the container type +If you only wish to run a terminal within the container type docker run -it plancklens /bin/sh