From 6a42a0b513ec0a656809b7b4ad240f83af33ab27 Mon Sep 17 00:00:00 2001 From: raphaelrpl Date: Fri, 7 May 2021 15:35:12 -0300 Subject: [PATCH] Fix bugs related with 0.8.0; Landsat publish and setup dependencies (close #234) --- CHANGES.rst | 7 +++++++ bdc_collection_builder/celery/publish.py | 4 ++-- bdc_collection_builder/controller.py | 2 +- bdc_collection_builder/version.py | 2 +- docker/Dockerfile | 13 ++++++------- docker/Dockerfile.atm | 3 ++- setup.py | 5 +++-- 7 files changed, 22 insertions(+), 14 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 16c8979..c5488cf 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -11,6 +11,13 @@ Changes ======= +Version 0.8.1 (2021-05-07) +-------------------------- + +- Fix dependency resolver for Docker images. +- Fix PosixPath entry while publish Landsat files `234 `_. + + Version 0.8.0 (2021-05-04) -------------------------- diff --git a/bdc_collection_builder/celery/publish.py b/bdc_collection_builder/celery/publish.py index 17d9dbf..ad68285 100644 --- a/bdc_collection_builder/celery/publish.py +++ b/bdc_collection_builder/celery/publish.py @@ -199,7 +199,7 @@ def publish_collection(scene_id: str, data: BaseCollection, collection: Collecti geom = convex_hull = None - is_compressed = file.endswith('.zip') or file.endswith('.tar.gz') + is_compressed = str(file).endswith('.zip') or str(file).endswith('.tar.gz') if is_compressed: destination = data.compressed_file(collection).parent @@ -253,7 +253,7 @@ def publish_collection(scene_id: str, data: BaseCollection, collection: Collecti tile_id = data.parser.tile_id() - if file.endswith('.hdf'): + if str(file).endswith('.hdf'): from ..collections.hdf import to_geotiff opts = dict(prefix=Config.CUBES_DATA_DIR) diff --git a/bdc_collection_builder/controller.py b/bdc_collection_builder/controller.py index 75a1f6c..7579674 100644 --- a/bdc_collection_builder/controller.py +++ b/bdc_collection_builder/controller.py @@ -224,7 +224,7 @@ def radcor(cls, args: dict): cloud = float(args['cloud']) action = args.get('action', 'preview') - collections = Collection.query().filter(Collection.collection_type == 'collection').all() + collections = Collection.query().filter(Collection.collection_type.in_(['collection', 'cube'])).all() # TODO: Review this code. The collection name is not unique anymore. collections_map = {f'{c.name}-{c.version}': c.id for c in collections} diff --git a/bdc_collection_builder/version.py b/bdc_collection_builder/version.py index 7ed2759..51a99c2 100644 --- a/bdc_collection_builder/version.py +++ b/bdc_collection_builder/version.py @@ -13,4 +13,4 @@ """ -__version__ = '0.8.0' +__version__ = '0.8.1' diff --git a/docker/Dockerfile b/docker/Dockerfile index 35dbfdd..32a1c47 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,18 +1,17 @@ -FROM registry.dpi.inpe.br/brazildatacube/geo:0.2 +FROM osgeo/gdal:ubuntu-full-3.2.1 ENV LC_ALL C.UTF-8 ENV LANG C.UTF-8 -ADD . /app - -WORKDIR /app - RUN apt-get update && \ - apt-get install --yes nano && \ + apt-get install --yes nano python3-pip git pkg-config cmake libtool autoconf && \ pip3 install pip --upgrade && \ rm -rf /var/lib/apt/lists/* +ADD . /app + +WORKDIR /app + RUN pip install wheel && \ - pip install gdal==2.4.0 && \ pip install pymodis && \ pip install -e .[all] diff --git a/docker/Dockerfile.atm b/docker/Dockerfile.atm index 95af1db..7764b35 100644 --- a/docker/Dockerfile.atm +++ b/docker/Dockerfile.atm @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM osgeo/gdal:ubuntu-full-3.2.1 ENV LC_ALL C.UTF-8 ENV LANG C.UTF-8 @@ -17,6 +17,7 @@ RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ docker-ce-cli \ git \ python3 \ + pkg-config cmake libtool autoconf \ python3-pip \ nano && \ rm -rf /var/lib/apt/lists/* diff --git a/setup.py b/setup.py index b6d21db..7e3abcc 100644 --- a/setup.py +++ b/setup.py @@ -58,14 +58,15 @@ 'docutils>=0.10,<0.15' 'Flask>=1.1.1', 'marshmallow-sqlalchemy>=0.19.0', - 'rasterio>=1.1.2', + 'rasterio>=1.1.2,<1.2', 'rio-cogeo>=1.1,<2', 'numpy>=1.17.2', 'numpngw>=0.0.8', 'scikit-image>=0.16.2', - 'SQLAlchemy[postgresql_psycopg2binary]>=1.3,<2', + 'SQLAlchemy[postgresql_psycopg2binary]>=1.3,<1.4', 'bdc-collectors @ git+git://github.com/brazil-data-cube/bdc-collectors.git@v0.4.0#egg=bdc-collectors', 'celery[librabbitmq]>=4.3,<4.4.3', + 'python-dateutil>=2,<3', 'Werkzeug>=0.16,<1.0', 'shapely>=1.7,<2' ]