From 13c7c5a8f180a30a96db56a30e16ec2c206cb338 Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 12:55:51 -0700 Subject: [PATCH 01/18] support optional use of AWS_REQUEST_PAYER variable in raster-api lambda environment to agree to pay all S3 transfer costs --- docs/advanced_configuration.md | 3 ++- raster_api/infrastructure/config.py | 5 +++++ raster_api/infrastructure/construct.py | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/advanced_configuration.md b/docs/advanced_configuration.md index 9ea34125..de56fc70 100644 --- a/docs/advanced_configuration.md +++ b/docs/advanced_configuration.md @@ -21,4 +21,5 @@ Environment variables for specific VEDA backend components are prefixed, for exa | `VEDA_DOMAIN_ALT_HOSTED_ZONE_NAME` | Optional second custom domain name, i.e. alt-veda-backend.xyz | | `VEDA_DOMAIN_API_PREFIX` | Optional domain prefix override supports using a custom prefix instead of the STAGE variabe (an alternate version of the stack can be deployed with a unique STAGE=altprod and after testing prod API traffic can be cut over to the alternate version of the stack by setting the prefix to prod) | | `VEDA_RASTER_ENABLE_MOSAIC_SEARCH` | Optional deploy the raster API with the mosaic/list endpoint TRUE/FALSE | -| `VEDA_RASTER_DATA_ACCESS_ROLE_ARN` | Optional arn of IAM Role to be assumed by raster-api for S3 bucket data access, if not provided default role for the lambda construct is used | \ No newline at end of file +| `VEDA_RASTER_DATA_ACCESS_ROLE_ARN` | Optional arn of IAM Role to be assumed by raster-api for S3 bucket data access, if not provided default role for the lambda construct is used | +| `VEDA_RASTER_AWS_REQUEST_PAYER` | Set this optional global parameter to 'requester' if the requester agrees to pay S3 transfer costs | diff --git a/raster_api/infrastructure/config.py b/raster_api/infrastructure/config.py index 586b5dc3..27824217 100644 --- a/raster_api/infrastructure/config.py +++ b/raster_api/infrastructure/config.py @@ -59,6 +59,11 @@ class vedaRasterSettings(BaseSettings): description="Resource name of role permitting access to specified external S3 buckets", ) + aws_request_payer: Optional[str] = Field( + None, + description="Set optional global parameter to 'requester' if the requester agrees to pay S3 transfer costs" + ) + class Config: """model config""" diff --git a/raster_api/infrastructure/construct.py b/raster_api/infrastructure/construct.py index 118e4257..0d3f500b 100644 --- a/raster_api/infrastructure/construct.py +++ b/raster_api/infrastructure/construct.py @@ -69,6 +69,12 @@ def __init__( "VEDA_RASTER_PGSTAC_SECRET_ARN", database.pgstac.secret.secret_full_arn ) + # Optional AWS S3 requester pays global setting + if veda_raster_settings.aws_request_payer: + veda_raster_function.add_environment( + "AWS_REQUEST_PAYER", veda_raster_settings.aws_request_payer + ) + raster_api_integration = ( aws_apigatewayv2_integrations_alpha.HttpLambdaIntegration( construct_id, veda_raster_function From 733bf04017f6a8e7ccab511b9861f4838667a25f Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 13:14:56 -0700 Subject: [PATCH 02/18] lint --- raster_api/infrastructure/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raster_api/infrastructure/config.py b/raster_api/infrastructure/config.py index 27824217..8d2c9436 100644 --- a/raster_api/infrastructure/config.py +++ b/raster_api/infrastructure/config.py @@ -61,7 +61,7 @@ class vedaRasterSettings(BaseSettings): aws_request_payer: Optional[str] = Field( None, - description="Set optional global parameter to 'requester' if the requester agrees to pay S3 transfer costs" + description="Set optional global parameter to 'requester' if the requester agrees to pay S3 transfer costs", ) class Config: From 595ca2d88bd24fa90ad760d92dbc0e5d2f9cf609 Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 15:23:30 -0700 Subject: [PATCH 03/18] update test env setup --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 264d779a..d35ba631 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ "httpx", "pypgstac==0.6.6", "psycopg[binary, pool]", + "pydantic[dotenv]==1.9,<1.10", ], } From 3932b35db094f5ec5573690939d020c86748d977 Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 15:36:56 -0700 Subject: [PATCH 04/18] try update python version github runner --- .github/workflows/pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index dfa43fa5..96130fd7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,7 +10,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.9' - uses: actions/cache@v3 with: @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.9' - uses: actions/cache@v3 with: @@ -72,7 +72,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.9' - name: Setup Node uses: actions/setup-node@v1 From fe7bcf1d95c8dd508bf847dff126084f676c41e9 Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 15:58:45 -0700 Subject: [PATCH 05/18] try use-pep517 and rollback python version in runner --- .github/workflows/pr.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 96130fd7..7c41ca17 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,7 +10,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.8' - uses: actions/cache@v3 with: @@ -20,7 +20,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip - python -m pip install -e .[dev,deploy,test] + python -m pip install -e .[dev,deploy,test] --use-pep517 - name: Run pre-commit run: pre-commit run --all-files @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.8' - uses: actions/cache@v3 with: @@ -43,7 +43,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip - python -m pip install -e .[dev,deploy,test] + python -m pip install -e .[dev,deploy,test] --use-pep517 - name: Launch services run: AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} docker-compose up --build -d stac raster @@ -72,7 +72,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.8' - name: Setup Node uses: actions/setup-node@v1 @@ -102,7 +102,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip - python -m pip install -e .[dev,deploy,test] + python -m pip install -e .[dev,deploy,test] --use-pep517 - name: Get dev environment configuration for develop branch run: ./scripts/get-env.sh "veda-backend-uah-dev-env" From 246417cab47c4c39729fd9ab6b3464ca10b5fa0a Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 16:12:15 -0700 Subject: [PATCH 06/18] try use-pep517 --- .github/workflows/pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7c41ca17..b909c1a0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -20,7 +20,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip - python -m pip install -e .[dev,deploy,test] --use-pep517 + python -m pip install --use-pep517 -e .[dev,deploy,test] - name: Run pre-commit run: pre-commit run --all-files @@ -43,7 +43,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip - python -m pip install -e .[dev,deploy,test] --use-pep517 + python -m pip install --use-pep517 -e .[dev,deploy,test] - name: Launch services run: AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} docker-compose up --build -d stac raster @@ -102,7 +102,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip - python -m pip install -e .[dev,deploy,test] --use-pep517 + python -m pip install --use-pep517 -e .[dev,deploy,test] - name: Get dev environment configuration for develop branch run: ./scripts/get-env.sh "veda-backend-uah-dev-env" From 90faf89bbecf8aa5b0988ad62409723d87a160bf Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 16:24:01 -0700 Subject: [PATCH 07/18] try use-pep517 --- local/Dockerfile.raster | 4 ++-- local/Dockerfile.stac | 2 +- raster_api/runtime/Dockerfile | 2 +- stac_api/runtime/Dockerfile | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/local/Dockerfile.raster b/local/Dockerfile.raster index cf2de385..b0906aee 100644 --- a/local/Dockerfile.raster +++ b/local/Dockerfile.raster @@ -5,10 +5,10 @@ FROM ghcr.io/vincentsarago/uvicorn-gunicorn:${PYTHON_VERSION} ENV CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt # Speed up dev cycle by pre-installing titiler -RUN pip install psycopg[binary,pool] +RUN pip install --use-pep517 psycopg[binary,pool] COPY raster_api/runtime /tmp/raster -RUN pip install /tmp/raster +RUN pip install --use-pep517 /tmp/raster RUN rm -rf /tmp/raster ENV MODULE_NAME src.app diff --git a/local/Dockerfile.stac b/local/Dockerfile.stac index 4a3b1af1..8c18e67e 100644 --- a/local/Dockerfile.stac +++ b/local/Dockerfile.stac @@ -10,7 +10,7 @@ COPY stac_api/runtime /tmp/stac # Installing boto3, which isn't needed in the lambda container instance # since lambda execution environment includes boto3 by default RUN pip install boto3 -RUN pip install /tmp/stac +RUN pip install --use-pep517 /tmp/stac RUN rm -rf /tmp/stac ENV MODULE_NAME src.app diff --git a/raster_api/runtime/Dockerfile b/raster_api/runtime/Dockerfile index 98df9d0f..47c7ab90 100644 --- a/raster_api/runtime/Dockerfile +++ b/raster_api/runtime/Dockerfile @@ -3,7 +3,7 @@ FROM lambci/lambda:build-python3.8 WORKDIR /tmp COPY raster_api/runtime /tmp/raster -RUN pip install "mangum>=0.14,<0.15" /tmp/raster["psycopg-binary"] -t /asset --no-binary pydantic +RUN pip install --use-pep517 "mangum>=0.14,<0.15" /tmp/raster["psycopg-binary"] -t /asset --no-binary pydantic RUN rm -rf /tmp/raster # # Reduce package size and remove useless files diff --git a/stac_api/runtime/Dockerfile b/stac_api/runtime/Dockerfile index 0ac19bd0..7702660d 100644 --- a/stac_api/runtime/Dockerfile +++ b/stac_api/runtime/Dockerfile @@ -3,7 +3,7 @@ FROM lambci/lambda:build-python3.8 WORKDIR /tmp COPY stac_api/runtime /tmp/stac -RUN pip install "mangum>=0.14,<0.15" /tmp/stac -t /asset --no-binary pydantic +RUN pip install --use-pep517 "mangum>=0.14,<0.15" /tmp/stac -t /asset --no-binary pydantic RUN rm -rf /tmp/stac # Reduce package size and remove useless files From 8b0bc97aae39f6c6abd7ecd61531d78321d31d08 Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 16:30:26 -0700 Subject: [PATCH 08/18] try backwards compatible pypgstac 0.7.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d35ba631..2807e8db 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ "pytest", "pytest-asyncio", "httpx", - "pypgstac==0.6.6", + "pypgstac==0.7.1", "psycopg[binary, pool]", "pydantic[dotenv]==1.9,<1.10", ], From 2136e1bfd332e727de8669861f6fe59051bbbdd2 Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 16:31:40 -0700 Subject: [PATCH 09/18] try backwards compatible pypgstac 0.7.1 --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 2807e8db..d18127d4 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,6 @@ "httpx", "pypgstac==0.7.1", "psycopg[binary, pool]", - "pydantic[dotenv]==1.9,<1.10", ], } From a5467a6e5e7d2eea9599a14c5ce3aa58fda330c4 Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 16:35:10 -0700 Subject: [PATCH 10/18] try backwards compatible pypgstac 0.7.1 --- .github/workflows/pr.yml | 6 +++--- local/Dockerfile.raster | 4 ++-- local/Dockerfile.stac | 2 +- raster_api/runtime/Dockerfile | 2 +- stac_api/runtime/Dockerfile | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b909c1a0..bd0bca6b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -20,7 +20,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip - python -m pip install --use-pep517 -e .[dev,deploy,test] + python -m pip install -e .[dev,deploy,test] - name: Run pre-commit run: pre-commit run --all-files @@ -43,7 +43,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip - python -m pip install --use-pep517 -e .[dev,deploy,test] + python -m pip install -e .[dev,deploy,test] - name: Launch services run: AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} docker-compose up --build -d stac raster @@ -102,7 +102,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip - python -m pip install --use-pep517 -e .[dev,deploy,test] + python -m pip install -e .[dev,deploy,test] - name: Get dev environment configuration for develop branch run: ./scripts/get-env.sh "veda-backend-uah-dev-env" diff --git a/local/Dockerfile.raster b/local/Dockerfile.raster index b0906aee..cf2de385 100644 --- a/local/Dockerfile.raster +++ b/local/Dockerfile.raster @@ -5,10 +5,10 @@ FROM ghcr.io/vincentsarago/uvicorn-gunicorn:${PYTHON_VERSION} ENV CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt # Speed up dev cycle by pre-installing titiler -RUN pip install --use-pep517 psycopg[binary,pool] +RUN pip install psycopg[binary,pool] COPY raster_api/runtime /tmp/raster -RUN pip install --use-pep517 /tmp/raster +RUN pip install /tmp/raster RUN rm -rf /tmp/raster ENV MODULE_NAME src.app diff --git a/local/Dockerfile.stac b/local/Dockerfile.stac index 8c18e67e..4a3b1af1 100644 --- a/local/Dockerfile.stac +++ b/local/Dockerfile.stac @@ -10,7 +10,7 @@ COPY stac_api/runtime /tmp/stac # Installing boto3, which isn't needed in the lambda container instance # since lambda execution environment includes boto3 by default RUN pip install boto3 -RUN pip install --use-pep517 /tmp/stac +RUN pip install /tmp/stac RUN rm -rf /tmp/stac ENV MODULE_NAME src.app diff --git a/raster_api/runtime/Dockerfile b/raster_api/runtime/Dockerfile index 47c7ab90..98df9d0f 100644 --- a/raster_api/runtime/Dockerfile +++ b/raster_api/runtime/Dockerfile @@ -3,7 +3,7 @@ FROM lambci/lambda:build-python3.8 WORKDIR /tmp COPY raster_api/runtime /tmp/raster -RUN pip install --use-pep517 "mangum>=0.14,<0.15" /tmp/raster["psycopg-binary"] -t /asset --no-binary pydantic +RUN pip install "mangum>=0.14,<0.15" /tmp/raster["psycopg-binary"] -t /asset --no-binary pydantic RUN rm -rf /tmp/raster # # Reduce package size and remove useless files diff --git a/stac_api/runtime/Dockerfile b/stac_api/runtime/Dockerfile index 7702660d..0ac19bd0 100644 --- a/stac_api/runtime/Dockerfile +++ b/stac_api/runtime/Dockerfile @@ -3,7 +3,7 @@ FROM lambci/lambda:build-python3.8 WORKDIR /tmp COPY stac_api/runtime /tmp/stac -RUN pip install --use-pep517 "mangum>=0.14,<0.15" /tmp/stac -t /asset --no-binary pydantic +RUN pip install "mangum>=0.14,<0.15" /tmp/stac -t /asset --no-binary pydantic RUN rm -rf /tmp/stac # Reduce package size and remove useless files From d3b2d8c96230be896456860151669b9c1240c1c3 Mon Sep 17 00:00:00 2001 From: anayeaye Date: Thu, 9 Mar 2023 16:43:25 -0700 Subject: [PATCH 11/18] isort upgrade in pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e2581a7..c064fbc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: language_version: python - repo: https://github.com/PyCQA/isort - rev: 5.4.2 + rev: 5.12.0 hooks: - id: isort language_version: python From d3c249309ffe0c3fc26dabdac506813f108b849d Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Fri, 10 Mar 2023 11:13:11 +0100 Subject: [PATCH 12/18] update pgstac version for testing --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 395e6a54..1901be8d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -95,7 +95,7 @@ services: database: container_name: veda.db platform: linux/amd64 - image: ghcr.io/stac-utils/pgstac:v0.6.6 + image: ghcr.io/stac-utils/pgstac:v0.7.1 environment: - POSTGRES_USER=username - POSTGRES_PASSWORD=password From a2239dced7851d6817e41f3e482b6bac17367dcb Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Fri, 10 Mar 2023 11:30:40 +0100 Subject: [PATCH 13/18] remove pghost --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1901be8d..524abcef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -102,7 +102,6 @@ services: - POSTGRES_DB=postgis - PGUSER=username - PGPASSWORD=password - - PGHOST=localhost - PGDATABASE=postgis ports: - "5432:5432" From 0c2e266f4d82aec1eba9cf2d5c8c31aa30c2d23d Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Fri, 10 Mar 2023 12:08:38 +0100 Subject: [PATCH 14/18] gives a bit more time to stac --- .github/workflows/pr.yml | 35 ++++++++++++++++++++--------------- docker-compose.yml | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bd0bca6b..ad6eaae9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,7 +11,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.8' - + - uses: actions/cache@v3 with: path: ${{ env.pythonLocation }} @@ -24,17 +24,24 @@ jobs: - name: Run pre-commit run: pre-commit run --all-files - + test: needs: [lint] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + + - name: Launch services + run: | + AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \ + AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} \ + docker-compose up --build -d stac raster + - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.8' - + - uses: actions/cache@v3 with: path: ${{ env.pythonLocation }} @@ -44,8 +51,6 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -e .[dev,deploy,test] - - name: Launch services - run: AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} docker-compose up --build -d stac raster - name: Ingest Stac Items/Collection run: | @@ -62,23 +67,23 @@ jobs: - name: Stop services run: docker-compose stop - predeploy: + predeploy: needs: [test] runs-on: ubuntu-latest steps: - + - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.8' - + - name: Setup Node uses: actions/setup-node@v1 - with: + with: node-version: 17 - + - name: Configure awscli uses: aws-actions/configure-aws-credentials@v1 with: @@ -90,15 +95,15 @@ jobs: with: path: ~/.npm key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - + - name: Install CDK run: npm install -g aws-cdk@2 - + - uses: actions/cache@v3 with: path: ${{ env.pythonLocation }} key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} - + - name: Install python dependencies run: | python -m pip install --upgrade pip @@ -107,7 +112,7 @@ jobs: - name: Get dev environment configuration for develop branch run: ./scripts/get-env.sh "veda-backend-uah-dev-env" - - name: Pre deployment CDK diff + - name: Pre deployment CDK diff run: | echo $STAGE - cdk diff veda-backend-uah-dev \ No newline at end of file + cdk diff veda-backend-uah-dev diff --git a/docker-compose.yml b/docker-compose.yml index 524abcef..469110f2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,7 +35,7 @@ services: depends_on: - database - raster - command: bash -c "bash /tmp/scripts/wait-for-it.sh -t 45 -h database -p 5432 && /start.sh" + command: bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh" volumes: - ./scripts:/tmp/scripts From 0851790122ff74601bf3a29ba6afbe6e9734a654 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Fri, 10 Mar 2023 13:15:43 +0100 Subject: [PATCH 15/18] possible fix --- stac_api/runtime/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stac_api/runtime/Dockerfile b/stac_api/runtime/Dockerfile index 0ac19bd0..200ec28e 100644 --- a/stac_api/runtime/Dockerfile +++ b/stac_api/runtime/Dockerfile @@ -3,7 +3,7 @@ FROM lambci/lambda:build-python3.8 WORKDIR /tmp COPY stac_api/runtime /tmp/stac -RUN pip install "mangum>=0.14,<0.15" /tmp/stac -t /asset --no-binary pydantic +RUN pip install "mangum>=0.14,<0.15" "git+https://github.com/vincentsarago/plpygis/@0521b961519087ef6ca8a96fabcdfa06222a9706#egg=plpygis" /tmp/stac -t /asset --no-binary pydantic RUN rm -rf /tmp/stac # Reduce package size and remove useless files From 560d37415d5ea067fd92f8267fb24f712560f0a0 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Mon, 13 Mar 2023 08:54:07 +0100 Subject: [PATCH 16/18] update plpygis --- stac_api/runtime/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stac_api/runtime/Dockerfile b/stac_api/runtime/Dockerfile index 200ec28e..fbab85a1 100644 --- a/stac_api/runtime/Dockerfile +++ b/stac_api/runtime/Dockerfile @@ -3,7 +3,7 @@ FROM lambci/lambda:build-python3.8 WORKDIR /tmp COPY stac_api/runtime /tmp/stac -RUN pip install "mangum>=0.14,<0.15" "git+https://github.com/vincentsarago/plpygis/@0521b961519087ef6ca8a96fabcdfa06222a9706#egg=plpygis" /tmp/stac -t /asset --no-binary pydantic +RUN pip install "mangum>=0.14,<0.15" "plpygis>=0.2.1" /tmp/stac -t /asset --no-binary pydantic RUN rm -rf /tmp/stac # Reduce package size and remove useless files From 1d688ed4c5b2bbcc55e33da30958b1fcd73d384e Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Mon, 13 Mar 2023 09:09:26 +0100 Subject: [PATCH 17/18] wait more --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 469110f2..1a17cd54 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -87,7 +87,7 @@ services: depends_on: - database - command: bash -c "bash /tmp/scripts/wait-for-it.sh -t 25 -h database -p 5432 && /start.sh" + command: bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh" volumes: - ./scripts:/tmp/scripts - $HOME/.aws/credentials:/root/.aws/credentials From 1f9c054212b93e1a63e344cffdb4fb24922a3e12 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Tue, 14 Mar 2023 10:04:49 +0100 Subject: [PATCH 18/18] use previous fastapi version --- raster_api/runtime/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/raster_api/runtime/setup.py b/raster_api/runtime/setup.py index 9501c0b3..73e160d0 100644 --- a/raster_api/runtime/setup.py +++ b/raster_api/runtime/setup.py @@ -9,6 +9,7 @@ "titiler.pgstac==0.1.0.a9", "titiler.application>=0.5,<0.6", "starlette-cramjam>=0.1.0,<0.2", + "fastapi==0.93.0", "importlib_resources>=1.1.0;python_version<'3.9'", "aws_xray_sdk>=2.6.0,<3", "aws-lambda-powertools>=1.18.0",