Skip to content

Commit 5157148

Browse files
authored
Merge pull request #220 from sentinel-hub/feat/docker-images
Feat/docker images
2 parents c872490 + f07d6dd commit 5157148

File tree

5 files changed

+92
-3
lines changed

5 files changed

+92
-3
lines changed

Diff for: .dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git
2+
docs

Diff for: README.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![License](https://img.shields.io/pypi/l/eo-learn.svg)](https://github.com/sentinel-hub/eo-learn/blob/master/LICENSE)
55
[![Overall downloads](http://pepy.tech/badge/eo-learn)](https://pepy.tech/project/eo-learn)
66
[![Last month downloads](https://pepy.tech/badge/eo-learn/month)](https://pepy.tech/project/eo-learn)
7+
[![Docker pulls](https://img.shields.io/docker/pulls/sentinelhub/eolearn.svg)](https://hub.docker.com/r/sentinelhub/eolearn)
78
[![codecov](https://codecov.io/gh/sentinel-hub/eo-learn/branch/master/graph/badge.svg)](https://codecov.io/gh/sentinel-hub/eo-learn)
89
<img align="right" src="docs/source/figures/eo-learn-logo.png" alt="" width="300"/>
910

@@ -25,7 +26,7 @@ to use any of the available tasks and is encouraged to improve the, develop new
2526

2627
**`eo-learn`** makes extraction of valuable information from satellite imagery as easy as defining a sequence of operations to be performed on satellite imagery. Image below illustrates a processing chain that maps water in satellite imagery by thresholding the Normalised Difference Water Index in user specified region of interest.
2728

28-
![eo-learn-workflow0illustration](docs/source/figures/eo-learn-illustration.png)
29+
![](docs/source/figures/eo-learn-illustration.png)
2930

3031
**`eo-learn`** _library acts as a bridge between Earth observation/Remote sensing field and Python ecosystem for data science and machine learning._ The library is written in Python and uses NumPy arrays to store and handle remote sensing data. Its aim is to make entry easier for non-experts to the field of remote sensing on one hand and bring the state-of-the-art tools for computer vision, machine learning, and deep learning existing in Python ecosystem to remote sensing experts.
3132

@@ -110,6 +111,30 @@ conda install eo-learn-ml-tools
110111
conda install eo-learn-visualization
111112
```
112113

114+
### Run with Docker
115+
116+
A docker image with the latest released version of `eo-learn` is available at [Docker Hub](https://hub.docker.com/r/sentinelhub/eolearn). It provides a full installation of `eo-learn` together with a Jupyter notebook environment. You can pull and run it with:
117+
118+
```bash
119+
docker pull sentinelhub/eolearn:latest
120+
docker run -p 8888:8888 sentinelhub/eolearn:latest
121+
```
122+
123+
An extended version of the `latest` image additionally contains all example notebooks and data to get you started with `eo-learn`. Run it with:
124+
125+
```bash
126+
docker pull sentinelhub/eolearn:latest-examples
127+
docker run -p 8888:8888 sentinelhub/eolearn:latest-examples
128+
```
129+
130+
Both docker images can also be built manually from GitHub repository:
131+
132+
```bash
133+
docker build -f docker/eolearn.dockerfile . --tag=sentinelhub/eolearn:latest
134+
docker build -f docker/eolearn-examples.dockerfile . --tag=sentinelhub/eolearn:latest-examples
135+
```
136+
137+
113138
## Documentation
114139

115140
For more information on the package content, visit [readthedocs](https://eo-learn.readthedocs.io/).

Diff for: docker/eolearn-examples.dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM sentinelhub/eolearn:latest
2+
3+
COPY ./examples ./examples
4+
COPY ./example_data ./example_data

Diff for: docker/eolearn.dockerfile

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM python:3.8-buster
2+
3+
LABEL maintainer="Sinergise EO research team <[email protected]>"
4+
5+
RUN apt-get update && apt-get install -y \
6+
gcc \
7+
libgdal-dev \
8+
graphviz \
9+
proj-bin \
10+
libproj-dev \
11+
libspatialindex-dev \
12+
&& apt-get clean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
13+
14+
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
15+
ENV C_INCLUDE_PATH=/usr/include/gdal
16+
17+
RUN pip3 install --no-cache-dir shapely --no-binary :all:
18+
19+
WORKDIR /tmp
20+
21+
COPY core core
22+
COPY coregistration coregistration
23+
COPY features features
24+
COPY geometry geometry
25+
COPY io io
26+
COPY mask mask
27+
COPY ml_tools ml_tools
28+
COPY visualization visualization
29+
COPY setup.py README.md requirements-dev.txt ./
30+
31+
RUN pip3 install --no-cache-dir \
32+
./core \
33+
./coregistration \
34+
./features \
35+
./geometry \
36+
./io \
37+
./mask \
38+
./ml_tools \
39+
./visualization \
40+
.
41+
42+
RUN pip3 install --no-cache-dir \
43+
./visualization[FULL] \
44+
rtree \
45+
jupyter
46+
47+
RUN rm -r ./*
48+
49+
ENV TINI_VERSION=v0.19.0
50+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
51+
RUN chmod +x /tini
52+
ENTRYPOINT ["/tini", "--"]
53+
54+
WORKDIR /home/eolearner
55+
56+
EXPOSE 8888
57+
CMD ["/usr/local/bin/jupyter", "notebook", "--no-browser", "--port=8888", "--ip=0.0.0.0", \
58+
"--NotebookApp.token=''", "--allow-root"]

Diff for: visualization/eolearn/visualization/xarray_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ def new_coordinates(data, crs, new_crs):
229229
y_values = data.coords['y'].values
230230
bbox = BBox((x_values[0], y_values[0], x_values[-1], y_values[-1]), crs=crs)
231231
bbox = bbox.transform(new_crs)
232-
xmin, ymin = bbox.get_lower_left()
233-
xmax, ymax = bbox.get_upper_right()
232+
xmin, ymin = bbox.lower_left
233+
xmax, ymax = bbox.upper_right
234234
new_xs = np.linspace(xmin, xmax, len(x_values))
235235
new_ys = np.linspace(ymin, ymax, len(y_values))
236236

0 commit comments

Comments
 (0)