Skip to content

Commit f721c67

Browse files
authored
Merge pull request planetlabs#61 from planetlabs/update-dockerfile
Update dockerfile, drop python2.7
2 parents bff5682 + 52bce7f commit f721c67

File tree

8 files changed

+16258
-87921
lines changed

8 files changed

+16258
-87921
lines changed

jupyter-notebooks/data-api-tutorials/planet_cli_introduction.ipynb

Lines changed: 289 additions & 229 deletions
Large diffs are not rendered by default.

jupyter-notebooks/data-api-tutorials/planet_data_api_introduction.ipynb

Lines changed: 15663 additions & 87104 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
11
FROM planet-notebooks
22

3+
# libsqlite3-dev and zlib1g-dev are dependencies of tippicanoe
4+
# libcurl4-openssl-dev is a dependency for pycurl
5+
USER root
6+
RUN apt-get update && apt-get install -y \
7+
build-essential \
8+
git \
9+
libcurl4-openssl-dev \
10+
libsqlite3-dev \
11+
zlib1g-dev \
12+
&& rm -rf /var/lib/apt/lists/*
13+
14+
# Install tippecanoe (required for label-maker)
15+
RUN git clone https://github.com/mapbox/tippecanoe.git
16+
WORKDIR tippecanoe
17+
RUN make && make install
18+
WORKDIR ..
19+
20+
# Install label-maker
21+
# Currently label-maker does not recognize planet COG files
22+
# because they do not end in `.tif`. For now, we install
23+
# label-maker from the fixed version in a fork
24+
# ref: https://github.com/developmentseed/label-maker/pull/82
25+
26+
# USER $NB_USER
27+
# RUN pip install --upgrade pip && \
28+
# pip install label-maker==0.3.1
29+
330
USER root
431
RUN apt-get install git
532
RUN git clone https://github.com/jreiberkyle/label-maker.git
633
WORKDIR label-maker
734
RUN git checkout geotiff-download-80
35+
USER $NB_USER
836
RUN pip install .
937
WORKDIR ..
1038
USER $NB_USER

jupyter-notebooks/label-data/label_maker_pl_geotiff.ipynb

Lines changed: 74 additions & 79 deletions
Large diffs are not rendered by default.

jupyter-notebooks/label-data/label_maker_pl_mosaic.ipynb

Lines changed: 59 additions & 412 deletions
Large diffs are not rendered by default.

jupyter-notebooks/toar/toar_planetscope.ipynb

Lines changed: 122 additions & 22 deletions
Large diffs are not rendered by default.

planet-notebook-docker/Dockerfile

Lines changed: 8 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
FROM jupyter/minimal-notebook:2c80cf3537ca
2-
# c88678a1c7c9
3-
4-
# Create Python2 environment
5-
RUN conda create --yes -p $CONDA_DIR/envs/python2 python=2.7
62

73
# Install GDAL
84
# We use conda because it is the only way to get gdal working properly with ipython
@@ -11,89 +7,26 @@ RUN conda create --yes -p $CONDA_DIR/envs/python2 python=2.7
117
# Downloading and building results in the gdal vsicurl driver not working
128
# (not sure why)
139
RUN conda install -y -c conda-forge gdal=2.3.1
14-
RUN conda install -y --name python2 -c conda-forge gdal=2.3.1
15-
16-
# Add pip2.7 shortcut and install Python2 packages
17-
RUN ln -s $CONDA_DIR/envs/python2/bin/pip $CONDA_DIR/bin/pip2.7 && \
18-
pip2.7 install --upgrade pip && \
19-
pip2.7 install numpy>=1.13.1 && \
20-
pip2.7 install \
21-
geojsonio \
22-
geopandas \
23-
ipykernel \
24-
ipyleaflet \
25-
ipywidgets \
26-
matplotlib \
27-
numpy \
28-
opencv-python==3.3.0.10 \
29-
planet \
30-
pygdal==2.3.1.4 \
31-
pyproj \
32-
rasterio==1.0a12 \
33-
setuptools \
34-
scikit-image \
35-
shapely \
36-
scikit-learn \
37-
tqdm
38-
39-
# Install tippecanoe (required for label-maker)
40-
USER root
41-
RUN apt-get update && apt-get install -y \
42-
build-essential \
43-
git \
44-
libsqlite3-dev \
45-
zlib1g-dev
46-
47-
RUN git clone https://github.com/mapbox/tippecanoe.git
48-
WORKDIR tippecanoe
49-
RUN make && make install
50-
WORKDIR ..
51-
52-
53-
# Install dependencies for pycurl, a dependency of label-maker
54-
RUN apt-get update && apt-get install -y libcurl4-openssl-dev
5510

5611
# Add pip shortcut and install Python3 packages
57-
USER $NB_USER
12+
COPY requirements.txt .
5813
RUN pip install --upgrade pip && \
59-
pip install numpy>=1.13.1 && \
60-
pip install \
61-
geojson \
62-
geopandas \
63-
ipyleaflet \
64-
ipywidgets \
65-
label-maker==0.3.1 \
66-
matplotlib \
67-
numpy \
68-
opencv-python==3.3.0.10 \
69-
planet \
70-
pygdal==2.3.1.4 \
71-
pyproj \
72-
rasterio==1.0a12 \
73-
scikit-image \
74-
shapely \
75-
tqdm
76-
77-
# Activate Python2 kernel globally and upon kernel launch.
78-
USER root
79-
RUN pip install kernda --no-cache && \
80-
$CONDA_DIR/envs/python2/bin/python -m ipykernel install && \
81-
kernda -o -y /usr/local/share/jupyter/kernels/python2/kernel.json && \
82-
pip uninstall kernda -y
14+
pip install -r requirements.txt
8315

8416
# Enable Jupyter extentions
85-
USER $NB_USER
8617
RUN jupyter nbextension enable --py widgetsnbextension --sys-prefix && \
8718
jupyter nbextension enable --py --sys-prefix ipyleaflet
8819

89-
# Clean up
90-
USER root
91-
RUN rm -rf /var/lib/{apt,dpkg,cache,log}/
92-
9320
# fix certs for rasterio
9421
# https://stackoverflow.com/a/30154802/2344416
22+
USER root
9523
RUN mkdir -p /etc/pki/tls/certs
9624
RUN cp /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt
9725

26+
# fix ncurses install
27+
# ref: https://github.com/conda-forge/gdal-feedstock/issues/226
28+
USER root
29+
RUN conda install -y -c conda-forge ncurses
30+
9831
WORKDIR work
9932
USER $NB_USER
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
geojson
2+
geojsonio
3+
geopandas
4+
ipyleaflet
5+
ipywidgets
6+
matplotlib
7+
numpy==1.14.* # pinned because numpy 15.0 throws runtime warning
8+
opencv-python==3.3.0.10
9+
planet
10+
pyproj
11+
rasterio==1.0a12
12+
scikit-image
13+
scikit-learn
14+
shapely
15+
tqdm

0 commit comments

Comments
 (0)