Skip to content

Commit

Permalink
Merge pull request #13 from tum-bgd/tutorial
Browse files Browse the repository at this point in the history
add the Tutorial and Docker Installation of AtlasHDF
  • Loading branch information
bobleegogogo committed Jan 23, 2023
2 parents a814766 + f6a3eb5 commit d675788
Show file tree
Hide file tree
Showing 8 changed files with 814 additions and 66 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
*.h5
*.csv
*.osm.pbf
data
atlashdf/atlashdf
.vscode
Expand Down
57 changes: 57 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# You may need to adapt this configuration in case you want to use this docker
# file to build a wheel for your system. Take a builder image that fits your machine
# and be prepared to update the installation of a matching protobuflite version.

FROM python:3.10.9-bullseye AS builder

# This stage is for building only. Output wheels are in `/atlashdf/dist`.
# You can mount it or run the container and inspect what you have.

RUN apt-get update && apt-get install -y --no-install-recommends \
libosmpbf-dev \
libhdf5-dev \
libboost-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /atlashdf

COPY ./ .

# Build JQ
WORKDIR /atlashdf/python_module/jq
RUN autoreconf -vfi
RUN ./configure --disable-maintainer-mode
RUN make


# Build atlashdf python wheel
RUN pip3 install pybind11
WORKDIR /atlashdf/python_module
RUN python3 setup.py bdist_wheel

# Now, the wheel is in /atlashdf/python_module/dist and can be copied by running a container and mounting:
# $ docker run -it -v dist:/out image-tag
# root@f029b3ad9157:/atlashdf/python_module# cp dist/atlashdf-0.1-cp310-cp310-linux_x86_64.whl /out
# root@f029b3ad9157:/atlashdf/python_module# exit
#
# Then, you can install this beast (but be sure to have all shared objects or use auditwheel to repair it)


FROM jupyter/tensorflow-notebook AS jupyter

USER root

RUN apt-get update && apt-get install -y --no-install-recommends \
libosmpbf-dev \
libhdf5-dev \
libboost-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

USER ${NB_UID}

COPY --from=builder /atlashdf/python_module/dist/* ./
COPY --from=builder /atlashdf/assets/* assets/
COPY --from=builder /atlashdf/*.ipynb ./

RUN pip install atlashdf-0.1-cp310-cp310-linux_x86_64.whl
RUN pip install rasterio
Loading

0 comments on commit d675788

Please sign in to comment.