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] diff --git a/pctiler/Dockerfile b/pctiler/Dockerfile index e418eb8a..86a0cd15 100644 --- a/pctiler/Dockerfile +++ b/pctiler/Dockerfile @@ -1,7 +1,8 @@ -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 @@ -15,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] +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 ENV GDAL_CACHEMAX 200 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 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