Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boundless=True - hangs in docker container rio read #2992

Open
tonybutzer opened this issue Dec 21, 2023 · 1 comment
Open

boundless=True - hangs in docker container rio read #2992

tonybutzer opened this issue Dec 21, 2023 · 1 comment

Comments

@tonybutzer
Copy link

Expected behavior and actual behavior.

I expected to read a band from a geotiff - window it and use boundless=True - inside a docker container - the read hangs forever. - if i remove the boundless parameter everything works as expected. This only happens in a docker container. The same python rasterio on an EC2 instance runs fine. I have built ubuntu and fedora based containers - both exhibit this behavior.

Steps to reproduce the problem.

Dockerfile

from condaforge/mambaforge

env tony 1.0
workdir /home
copy environment.yml /home
run mamba env update -n base --file environment.yml
(water) [ec2-user@ip-10-12-70-10 fail_mamba_forge]$ cat environment.yml
name: ts2023
channels:
  - conda-forge
dependencies:
  - python=3
#jupyter
#xarray-related
  - rioxarray
  - zarr
#other
  - fsspec
  - s3fs
  - folium
#aws
  - boto3
  - awscli
# gaass-py
  - pandas
  - numpy
  - rasterio
  - matplotlib
  - geopandas
  - tqdm
  - geojson
# stac VERSIONS are Important Here - bummer!
  - pystac
  - pystac-client
# CPU
  - pip
  - pip:
    - loguru
    - python-dotenv

For example: a brief script with required inputs.

(water) [ec2-user@ip-10-12-70-10 00_docker_version]$ cat test_docker_rasterio_read.py
import os
import rasterio as rio

os.environ['AWS_REQUEST_PAYER'] = 'requester'
os.environ['GDAL_DISABLE_READDIR_ON_OPEN']='EMPTY_DIR'
os.environ['GDAL_HTTP_MAX_RETRY']='10'
os.environ['GDAL_HTTP_RETRY_DELAY']='3'
os.environ['GDAL_PAM_ENABLED']='NO'


image = 's3://usgs-landsat-ard/collection02/tm/1995/CU/013/013/LT05_CU_013013_19950107_20210424_02/LT05_CU_013013_19950107_20210424_02_SR_B1.TIF'

width=256
height=256

with rio.open(image) as ds:
                    window = rio.windows.Window(0, 0, 256, 256)
                    out = ds.read(1, window=window, boundless=True, fill_value=0, masked=True).filled()

print(type(out))
print(out.shape)

Environment Information

  • Output from: rio --show-versions or python -c "import rasterio; rasterio.show_versions()"
(base) rio --show-versions
rasterio info:
 rasterio: 1.3.3
     GDAL: 3.5.3
     PROJ: 9.1.0
     GEOS: 3.11.1
PROJ DATA: /opt/conda/share/proj
GDAL DATA: /opt/conda/share/gdal

System:
   python: 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:35:26) [GCC 10.4.0]
executable: /opt/conda/bin/python
  machine: Linux-4.14.330-250.540.amzn2.x86_64-x86_64-with-glibc2.34

Python deps:
   affine: 2.3.1
    attrs: 22.1.0
  certifi: 2023.11.17
    click: 8.1.3
    cligj: 0.7.2
   cython: None
    numpy: 1.23.4
   snuggs: 1.4.7
click-plugins: None
setuptools: 65.6.3
  • rasterio version (python -c "import rasterio; print(rasterio.__version__)")
  • GDAL version (python -c "import rasterio; print(rasterio.__gdal_version__)")
  • Python version (python -c "import sys; print(sys.version.replace('\n', ' '))")
  • Operation System Information (python -c "import platform; print(platform.platform())")

Installation Method

condaforge/mambaforge docker image - however this fails on manual conda/mamba installs as well

@sgillies
Copy link
Member

@tonybutzer What do you see if you upgrade Rasterio and GDAL to the latest? There have been many bug fixes since the versions you report above? And if you put CPL_CURL_VERBOSE=YES in your environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants