-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add Azure Functions for creating images and animations #115
Conversation
This includes the "animation" and "image" functions, as well as the "funclib" library that contains reusable code for fetching rasters from the PC data API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Tested out the animation endpoint in the local dev env successfully.
pcfuncs/animation/constants.py
Outdated
MAX_TILE_COUNT = 16 | ||
|
||
MAX_FRAMES = 24 | ||
MAX_CONCURRENCY = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is not overridable by the settings; fwiw, I currently have staging set to 15 and have dialed it up over twice that to get better performance. Do you think it's too disruptive to put a higher max?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make it part of the settings so that we can play around with it.
Edit: Perhaps it makes sense not to limit us for what we put in the settings, and have that be a default with no validation rule.
pcfuncs/animation/settings.py
Outdated
def get(cls) -> "AnimationSettings": | ||
import os | ||
|
||
logger.info(f"DEBUG: {os.environ.get('ANIMATION_CONTAINER_ACCOUNT_KEY')}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prod looks to be set up to use a managed identity but consider dropping this to prevent accidental credential leaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks
Description
This PR adds an Azure Functions app that provides Function endpoints that produce images and animated gifs from images produced through mosaicing tiles from the tile server.
This is based on the Azure Functions work in PlanetaryComputerDataCatalog. The animation endpoint is lightly refactored from that codebase, and the image endpoint is based on the techniques used there.
How Has This Been Tested?
Functions have been deployed to the staging environment manually. Tested through hitting the endpoints manually with Thunder Client, and through the development of https://github.com/microsoft/planetary-computer-teams-background