GNS-Science / toshi-hazard-post

Hazard post-processing pipeline as serverless AWS infrastructure.
MIT License
0 stars 1 forks source link

docker image missing requests_toolbelt dependency #14

Closed chrisdicaprio closed 9 months ago

chrisdicaprio commented 1 year ago

poetry install in a clean cloned repo works. This has not been a problem in the AWS deployment of the docker, either (though it has not been recently tested).

docker build . -t toshi-hazard-post
docker run --rm -it toshi-hazard-post -s bash
(toshi-hazard-post-py3.10) root@ac119a3a70c5:/WORKING# python /app/scripts/cli.py --help
Traceback (most recent call last):
  File "/app/scripts/cli.py", line 12, in <module>
    from toshi_hazard_post.hazard_aggregation.aggregation import process_aggregation
  File "/app/toshi_hazard_post/hazard_aggregation/aggregation.py", line 16, in <module>
    from toshi_hazard_post.data_functions import (
  File "/app/toshi_hazard_post/data_functions.py", line 13, in <module>
    from toshi_hazard_post.logic_tree.logic_tree import HazardLogicTree
  File "/app/toshi_hazard_post/logic_tree/logic_tree.py", line 15, in <module>
    from toshi_hazard_post.toshi_api_support import SourceSolutionMap, toshi_api
  File "/app/toshi_hazard_post/toshi_api_support.py", line 11, in <module>
    from nshm_toshi_client.toshi_file import ToshiFile
  File "/app/.venv/lib/python3.10/site-packages/nshm_toshi_client/__init__.py", line 8, in <module>
    from .toshi_file import ToshiFile
  File "/app/.venv/lib/python3.10/site-packages/nshm_toshi_client/toshi_file.py", line 12, in <module>
    from .toshi_client_base import ToshiClientBase, kvl_to_graphql
  File "/app/.venv/lib/python3.10/site-packages/nshm_toshi_client/toshi_client_base.py", line 8, in <module>
    from gql.transport.requests import RequestsHTTPTransport
  File "/app/.venv/lib/python3.10/site-packages/gql/transport/requests.py", line 11, in <module>
    from requests_toolbelt.multipart.encoder import MultipartEncoder
ModuleNotFoundError: No module named 'requests_toolbelt'
(toshi-hazard-post-py3.10) root@ac119a3a70c5:/WORKING# pip install requests_toolbelt
Collecting requests_toolbelt
  Downloading requests_toolbelt-1.0.0-py2.py3-none-any.whl (54 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.5/54.5 kB 7.6 MB/s eta 0:00:00
Requirement already satisfied: requests<3.0.0,>=2.0.1 in /app/.venv/lib/python3.10/site-packages (from requests_toolbelt) (2.31.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /app/.venv/lib/python3.10/site-packages (from requests<3.0.0,>=2.0.1->requests_toolbelt) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in /app/.venv/lib/python3.10/site-packages (from requests<3.0.0,>=2.0.1->requests_toolbelt) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /app/.venv/lib/python3.10/site-packages (from requests<3.0.0,>=2.0.1->requests_toolbelt) (1.26.16)
Requirement already satisfied: certifi>=2017.4.17 in /app/.venv/lib/python3.10/site-packages (from requests<3.0.0,>=2.0.1->requests_toolbelt) (2023.5.7)
Installing collected packages: requests_toolbelt
Successfully installed requests_toolbelt-1.0.0
(toshi-hazard-post-py3.10) root@ac119a3a70c5:/WORKING# python /app/scripts/cli.py --help
logging config not found: toshi_hazard_post/logging.yaml
logging config not found: toshi_hazard_post/logging.yaml
Usage: cli.py [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  aggregate   aggregate hazard curves or disaggregations
  build-grid  calculate hazard grids used to create maps
(toshi-hazard-post-py3.10) root@ac119a3a70c5:/WORKING#