From 284754c889e76ec23e4cc683946f0b82d31eb8b6 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 24 Mar 2023 15:03:19 -0500 Subject: [PATCH 1/5] Install rasterio & dependencies from conda --- pctiler/Dockerfile | 6 ++++-- pctiler/environment.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 pctiler/environment.yaml diff --git a/pctiler/Dockerfile b/pctiler/Dockerfile index e418eb8a..0b18ca40 100644 --- a/pctiler/Dockerfile +++ b/pctiler/Dockerfile @@ -1,7 +1,9 @@ FROM python:3.9-slim +FROM mambaorg/micromamba:1.4.0 +COPY --chown=$MAMBA_USER:$MAMBA_USER pctiler/environment.yaml /tmp/env.yaml -# git required for pip installs from git -RUN apt update && apt install -y git +RUN micromamba install -y -n base -f /tmp/env.yaml && \ + micromamba clean --all --yes # The devops Personal Access Token for accessing # Azure Artifacts. Note: This will be visible as diff --git a/pctiler/environment.yaml b/pctiler/environment.yaml new file mode 100644 index 00000000..f4b8e1e0 --- /dev/null +++ b/pctiler/environment.yaml @@ -0,0 +1,25 @@ +name: base +channels: + - conda-forge +dependencies: + - python=3.9.16 + - pystac==1.7.1 + - jinja2==3.0.3 + - rasterio==1.3.6 + - pyproj==3.4.1 + - planetary-computer==0.4.9 + - geojson-pydantic==0.4.2 + # colormap dependencies + - matplotlib==3.4.3 + - git + - pip + - pip: + - "titiler.core==0.10.2" + - "titiler.mosaic==0.10.2" + + - # titiler-pgstac + - "psycopg[binary,pool]" + - "titiler.pgstac==0.2.2" + + # - "importlib_resources>=1.1.0;python_version<'3.9'" + # - "pccommon" \ No newline at end of file From fa9b5fbf0a5bda456e81796484b64b26f04ebe6d Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 24 Mar 2023 15:12:00 -0500 Subject: [PATCH 2/5] remove duplicate FROM --- pctiler/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/pctiler/Dockerfile b/pctiler/Dockerfile index 0b18ca40..ef8940cc 100644 --- a/pctiler/Dockerfile +++ b/pctiler/Dockerfile @@ -1,4 +1,3 @@ -FROM python:3.9-slim FROM mambaorg/micromamba:1.4.0 COPY --chown=$MAMBA_USER:$MAMBA_USER pctiler/environment.yaml /tmp/env.yaml From 414efd26153c5d4c288c892ddfda35340b516db1 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 24 Mar 2023 15:18:49 -0500 Subject: [PATCH 3/5] fixup --- pctiler/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pctiler/Dockerfile b/pctiler/Dockerfile index ef8940cc..83e6e9d6 100644 --- a/pctiler/Dockerfile +++ b/pctiler/Dockerfile @@ -16,10 +16,11 @@ ARG DEVOPS_PAT EXPOSE 8000 WORKDIR /opt/src +ARG MAMBA_DOCKERFILE_ACTIVATE=1 COPY pccommon /opt/src/pccommon COPY pctiler /opt/src/pctiler -RUN pip install -e ./pccommon -e ./pctiler[server] +RUN python3 -m pip install -e ./pccommon -e ./pctiler[server] # GDAL config ENV GDAL_CACHEMAX 200 From adb3128922e01a31a9aafebe5adc07cbd21c25b3 Mon Sep 17 00:00:00 2001 From: Matt McFarland Date: Mon, 10 Apr 2023 16:30:52 -0400 Subject: [PATCH 4/5] Set ownership of module directories The mamba user needs to write on the module directories in order to update the egg.info dir. --- pctiler/Dockerfile | 4 ++-- pctiler/Dockerfile.dev | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pctiler/Dockerfile b/pctiler/Dockerfile index 83e6e9d6..86a0cd15 100644 --- a/pctiler/Dockerfile +++ b/pctiler/Dockerfile @@ -18,8 +18,8 @@ EXPOSE 8000 WORKDIR /opt/src ARG MAMBA_DOCKERFILE_ACTIVATE=1 -COPY pccommon /opt/src/pccommon -COPY pctiler /opt/src/pctiler +COPY --chown=$MAMBA_USER:$MAMBA_USER pccommon /opt/src/pccommon +COPY --chown=$MAMBA_USER:$MAMBA_USER pctiler /opt/src/pctiler RUN python3 -m pip install -e ./pccommon -e ./pctiler[server] # GDAL config diff --git a/pctiler/Dockerfile.dev b/pctiler/Dockerfile.dev index 5b0dc900..9c268f6f 100644 --- a/pctiler/Dockerfile.dev +++ b/pctiler/Dockerfile.dev @@ -1,6 +1,8 @@ FROM pc-apis-tiler -COPY requirements-dev.txt requirements-dev.txt -RUN pip install -r requirements-dev.txt +ARG MAMBA_DOCKERFILE_ACTIVATE=1 -RUN pip install -e ./pccommon -e ./pctiler +COPY --chown=$MAMBA_USER:$MAMBA_USER requirements-dev.txt requirements-dev.txt + +RUN python3 -m pip install -r requirements-dev.txt +RUN python3 -m pip install -e ./pccommon -e ./pctiler From 2b62d7c31b7ff9ef4f33de6541172f47f4668fc1 Mon Sep 17 00:00:00 2001 From: Matt McFarland Date: Mon, 10 Apr 2023 16:38:50 -0400 Subject: [PATCH 5/5] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a504ccc4..5dd793c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Updated **stac-fastapi-pgstac** to v2.4.5 [#163](https://github.com/microsoft/planetary-computer-apis/pull/163) +- Updated tiler to use conda to manage dependencies, support LERC [#169](https://github.com/microsoft/planetary-computer-apis/pull/169) ## [2022.4.0]