Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

WIP: Sync with titiler #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

f-skold
Copy link

@f-skold f-skold commented Jun 27, 2022

NOTE: When I do these updates, the result of the docker build get to big to be uploaded to AWS Lambda (which was my primary target)

So I would like help / suggestions on how to get something that can be used on AWS Lambda

What I am changing

The goal is to update to current versions of the depedencies.

How I did it

  • black version, precommit no longer requiers a particular python version (3.7)
  • Update to use titiler 0.7.0, update setup.py, and update accordingly)
  • Update used version of aws-cdk to 1.160.0, and do one update

NOTE: Deploying to AWS Lambda fails since reult is to large to be used by lambda.

How you can test it

Check out, try to deploy to lambda, failure.
Should be no functional changes.

Related Issues

#6 might be helped by this since I advance some packages

@f-skold
Copy link
Author

f-skold commented Jul 8, 2022

I am pretty new to this.
The commit 7052c36 was able to build a docker image and deploy it.

It was a few weeks since I did look at this the previous time.
How can I test the deployment I end up with?

(Now I checked the logs on AWS and saw that it complains like this:)

entrypoint requires the handler name to be the first argument 

Keept working on it and not it seems better

@f-skold
Copy link
Author

f-skold commented Jul 11, 2022

@vincentsarago

If I try to deploy 5ed0df5, I can deploy it, but when I do try to use it (get a tilejson for sentinel 2), I got exception when trying to parse the sceneid

https://hostaws.execute-api.eu-north-1.amazonaws.com/scenes/sentinel/tilejson.json?sceneid=S2B_31NCG_20190926_0_L2A&tile_scale=2&bands=B04&bands=B08&bands=B03&rescale=1422,2826&rescale=1247,4042&rescale=1660,2759

And adding more debugging (catching the eexception in rio-tiler-pds), this give strong indications that we try to use a
titiler-pds/titiler_pds/dependencies.py:CustomPathParams when the code expects a string with the sceneid.

This could be solved in several ways.
I guess the simplest would be to just have the sceneid as a string, and pass that.
I hesitate to update rio-tiler-pds and titiler accoring to a type in titiler-pds.

Also, to me it seems like parsing of sceneid is done both in titiler-pds/titiler_pds/dependencies.py and in rio-tiler-pds/rio_tiler_pds/sentinel/utils.py`.

Change language_version from python3.7 to any python
Bump to black 23.11.0.
Remove extra comma in CustomPathParams.__post_init__() causing reformating.

Reformated all code using black:

    git ls-files | grep "\.py" | xargs touch
    pre-commit  run -v --all-files
WIP: When running this. There is an issue that the CustomPathParams with two members
     sceneid and scene_metadata is passed as path_dependency.
     The user of that dependency assumes to get a string that is interpreted to be a sceneid, not get an object.
     **I would need some gudience on what changes to make.**

Update version of (this) package to 0.1.0
Use rio-tiler-pds and titiler 0.7.0.
Advance aws-cdk version to 1.160.0

The titiler package has been split into three packages, do refer to each of them.
Update python imports and usage.

(When trying to build using the old Dockerfile, the output was too big to be used in the old way.)
Change to build a docker imaged based on AWS python image instead of creating a bundle that is
overlayed on the AWS python environment.

Changed several things in stack/app.py:
* One thing had changed name to apigw_integrations.HttpLambdaIntegration
  and required a new id argument.
* Use a docker image instead of using docker image to construct a usable zip for the python runtime
  FROM_IMAGE.
Add wheel to use with corrections
Update dockerfile
Try to see if we could pass the correct thing.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant